You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -97,40 +69,14 @@ public static void init(Resources res) {
97
69
* device density
98
70
*/
99
71
publicstaticfloatconvertDpToPixel(floatdp) {
100
-
101
72
if (mMetrics == null) {
102
-
103
-
Log.e("chartLib-Utils",
104
-
"Utils NOT INITIALIZED. You need to call Utils.init(...) at least once before" +
105
-
" calling Utils.convertDpToPixel(...). Otherwise conversion does not " +
106
-
"take place.");
73
+
Log.e("chartLib-Utils", "Utils NOT INITIALIZED. You need to call Utils.init(...) at least once before calling Utils.convertDpToPixel(...). Otherwise conversion does not take place.");
107
74
returndp;
108
75
}
109
76
110
77
returndp * mMetrics.density;
111
78
}
112
79
113
-
/**
114
-
* This method converts device specific pixels to density independent
115
-
* pixels. NEEDS UTILS TO BE INITIALIZED BEFORE USAGE.
116
-
*
117
-
* @param px A value in px (pixels) unit. Which we need to convert into db
118
-
* @return A float value to represent dp equivalent to px value
119
-
*/
120
-
publicstaticfloatconvertPixelsToDp(floatpx) {
121
-
122
-
if (mMetrics == null) {
123
-
124
-
Log.e("chartLib-Utils",
125
-
"Utils NOT INITIALIZED. You need to call Utils.init(...) at least once before" +
126
-
" calling Utils.convertPixelsToDp(...). Otherwise conversion does not" +
127
-
" take place.");
128
-
returnpx;
129
-
}
130
-
131
-
returnpx / mMetrics.density;
132
-
}
133
-
134
80
/**
135
81
* calculates the approximate width of a text, depending on a demo text
0 commit comments