I\'m not sure if this is possible, and I couldn\'t find a topic based on it, but if it\'s been answered before drop me a link and that will be that.
What I\'m looking to
It is a very bad hack, but it should work:
Create a new view extending LinearLayout
, overwrite method getChildStaticTransformation and setStaticTransformationsEnabled
explicit to true
.
In the method getChildStaticTransformation
you can manipulate the tranformation parameter to scale down all the content of your extended LinearLayout.
And then add the DatePicker
or something else as a child of this view.
EG:
public class ZoomView
extends LinearLayout
{
private float sf = 1f;
public ZoomView(final Context context, final AttributeSet attrs)
{
super(context, attrs);
setStaticTransformationsEnabled(true);
}
public ZoomView(final Context context)
{
super(context);
setStaticTransformationsEnabled(true);
}
public void setScaling(final float sf)
{
this.sf = sf;
}
@Override
protected boolean getChildStaticTransformation(final View child, final Transformation t)
{
t.clear();
t.setTransformationType(Transformation.TYPE_MATRIX);
final Matrix m = t.getMatrix();
m.setScale(this.sf, this.sf);
return true;
}
}