コード例 #1
0
 @Override
 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
   mPercentLayoutHelper.adjustChildren(widthMeasureSpec, heightMeasureSpec);
   super.onMeasure(widthMeasureSpec, heightMeasureSpec);
   if (mPercentLayoutHelper.handleMeasuredStateTooSmall()) {
     super.onMeasure(widthMeasureSpec, heightMeasureSpec);
   }
 }
コード例 #2
0
 @Override
 protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) {
   PercentLayoutHelper.fetchWidthAndHeight(this, a, widthAttr, heightAttr);
 }
コード例 #3
0
 public LayoutParams(Context c, AttributeSet attrs) {
   super(c, attrs);
   mPercentLayoutInfo = PercentLayoutHelper.getPercentLayoutInfo(c, attrs);
 }
コード例 #4
0
 @Override
 protected void onLayout(boolean changed, int l, int t, int r, int b) {
   super.onLayout(changed, l, t, r, b);
   mPercentLayoutHelper.restoreOriginalParams();
 }