mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-18 12:30:11 -07:00
Custom controls: fix wrong pos
This commit is contained in:
parent
89545f9256
commit
d6988fea87
7 changed files with 26 additions and 20 deletions
|
|
@ -369,6 +369,12 @@ public final class Tools
|
|||
ctx.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
return displayMetrics;
|
||||
}
|
||||
|
||||
public static void updateWindowSize(Activity ctx) {
|
||||
DisplayMetrics dm = getDisplayMetrics(ctx);
|
||||
CallbackBridge.windowWidth = dm.widthPixels;
|
||||
CallbackBridge.windowHeight = dm.heightPixels;
|
||||
}
|
||||
|
||||
public static float pxToDp(Context ctx, float px) {
|
||||
return (px / ctx.getResources().getDisplayMetrics().density);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue