Java Code Examples for android.view.ViewGroup.setScaleY()

The following are Jave code examples for showing how to use setScaleY() of the android.view.ViewGroup class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: NoticeDog   File: AspectRatioedRelativeLayout.java   Source Code and License Vote up 5 votes
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    ViewGroup content = (ViewGroup) findViewById(R.id.content);
    if (content != null) {
        float heightScale = ((float) MeasureSpec.getSize(heightMeasureSpec)) / ((float) content.getHeight());
        content.setScaleX(heightScale);
        content.setScaleY(heightScale);
        Log.d(TAG, "Scaling content by: " + heightScale);
    }
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}