Compatible methods for viewing on Android 2.2 (setScale & setPivot)

I have an application that was developed for Honeycomb, and now I need to run it on the old Galaxy Tab tab (Android 2.2).

But I used some methods that are not part of the Froyo API:

//child is a View child.setPivotX(0); child.setPivotY(0); child.setScaleY(scaleFromOriginal); child.setScaleX(scaleFromOriginal); 

Does anyone know how to achieve the same result on 2.2?

PS: I am looking at the Compatibility Package, but there is no helper for these methods.

+4
source share
1 answer

you can use nineoldandroids

 ViewHelper.setPivotY(child, 0f); ViewHelper.setPivotX(child, 0f); ViewHelper.setScaleY(child, scaleFromOriginal); ViewHelper.setScaleX(child, scaleFromOriginal); 

http://nineoldandroids.com/#usage

+7
source

Source: https://habr.com/ru/post/1384329/


All Articles