Exemplo n.º 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);
   }
 }
Exemplo n.º 2
0
 @Override
 protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) {
   PercentLayoutHelper.fetchWidthAndHeight(this, a, widthAttr, heightAttr);
 }
Exemplo n.º 3
0
 public LayoutParams(Context c, AttributeSet attrs) {
   super(c, attrs);
   mPercentLayoutInfo = PercentLayoutHelper.getPercentLayoutInfo(c, attrs);
 }
Exemplo n.º 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();
 }