set android object by percentage

Solutions on MaxInterview for set android object by percentage by the best coders in the world

showing results for - "set android object by percentage"
Violeta
24 Aug 2018
1Example:
2...
3TextView label=findViewById(R.id.label);
4Utils.setObjectDimensions(this,label,"TextView",6.27,55,3);
5...
6this-> Context,
7label-> your Android object,
8"TextView" -> type of android object,
96.27 -> percentage of height of android device screen,
1055 -> percentage of width of android device screen,
113 -> percentage of height of android device used to convert object textsize to its sp value
12
13//
14You should provide -1 to height, width and percentage for text accordingly your need of change the object dimensions,