MCPcopy Create free account
hub / github.com/cinit/TMoe / dip2px

Method dip2px

app/src/main/java/cc/ioctl/tmoe/ui/LayoutHelper.java:48–51  ·  view source on GitHub ↗
(float dip)

Source from the content-addressed store, hash-verified

46 }
47
48 public static float dip2px(float dip) {
49 Resources r = HostInfo.getApplication().getResources();
50 return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, r.getDisplayMetrics());
51 }
52
53 public static int dp(float dp) {
54 return (int) dip2px(dp);

Callers 2

getSizeMethod · 0.95
dpMethod · 0.95

Calls 2

getApplicationMethod · 0.95
getResourcesMethod · 0.80

Tested by

no test coverage detected