Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. @Override
  2. protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  3. super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  4. Log.d("onMeasure", "...");
  5. Log.d("onMeasure", "...");
  6.  
  7. int width = getMeasuredWidth();
  8. int height = getMeasuredHeight();
  9. int measureSpec = keepAspectRatioByHeight ? height : width;
  10. Log.d("onMeasure", "getMeasuredWidth() = " + width);
  11. Log.d("onMeasure", "getMeasuredHeight() = " + height);
  12.  
  13. // ViewGroup.LayoutParams params = this.getLayoutParams();
  14. // params.height = measureSpec;
  15. // params.width = measureSpec;
  16. // this.setLayoutParams(params);
  17.  
  18. setMeasuredDimension(measureSpec, measureSpec);
  19. // int measureSpec = keepAspectRatioByHeight ? heightMeasureSpec : widthMeasureSpec;
  20. // super.onMeasure(measureSpec, measureSpec);
  21. }
  22.  
  23. @Override
  24. protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
  25. super.onLayout(changed, left, top, right, bottom);
  26. Log.d("onLayout", "...");
  27. Log.d("onLayout", "...");
  28. Log.d("onLayout", "changed = " + changed);
  29. Log.d("onLayout", "left = " + left);
  30. Log.d("onLayout", "top = " + top);
  31. Log.d("onLayout", "right = " + right);
  32. Log.d("onLayout", "bottom = " + bottom);
  33. Log.d("onLayout", "right - left = " + (right - left));
  34. Log.d("onLayout", "bottom - top = " + (bottom - top));
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement