Page 1203 - 3-3
P. 1203
@Override
protected ScalableLayout.LayoutParams generateDefaultLayoutParams() {
return new ScalableLayout.LayoutParams(0f, 0f, getScaleWidth(), getScaleHeight());
}
@Override
public ScalableLayout.LayoutParams generateLayoutParams(AttributeSet pAttrs) {
return new ScalableLayout.LayoutParams(getContext(), pAttrs);
}
@Override
protected ScalableLayout.LayoutParams generateLayoutParams(ViewGroup.LayoutParams pP) {
if(pP instanceof ScalableLayout.LayoutParams) {
return (ScalableLayout.LayoutParams) pP;
}
return new ScalableLayout.LayoutParams(pP);
}
/**
* move childView inside ScalableLayout
* @param pChildView view to move. should be child of ScaleLayout
* @param pScale_Left
* @param pScale_Top
*/
public void moveChildView(View pChildView, float pScale_Left, float pScale_Top) {
ScalableLayout.LayoutParams lSLLP = getChildLayoutParams(pChildView);
lSLLP.mScale_Left = pScale_Left;
lSLLP.mScale_Top = pScale_Top;
postInvalidate();
}
/**
* move and resize childView inside ScalableLayout
* @param pChildView view to move. should be child of ScaleLayout
* @param pScale_Left
* @param pScale_Top
* @param pScale_Width
* @param pScale_Height
*/
public void moveChildView(View pChildView, float pScale_Left, float pScale_Top, float
pScale_Width, float pScale_Height) {
ScalableLayout.LayoutParams lSLLP = getChildLayoutParams(pChildView);
lSLLP.mScale_Left = pScale_Left;
lSLLP.mScale_Top = pScale_Top;
lSLLP.mScale_Width = pScale_Width;
lSLLP.mScale_Height = pScale_Height;
- 1203 -