mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
Fixes
- Some crashes - Button too big
This commit is contained in:
parent
3d4ac3e287
commit
644af4eaaf
@ -42,7 +42,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getInternalId(String type, String name) {
|
private int getInternalId(String type, String name) {
|
||||||
int id = Resources.getSystem().getIdentifier(name, type, "com.android.internal.R");
|
int id = Resources.getSystem().getIdentifier(name, type, "com.android.internal");
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
mHandleView.getContext().getResources().getIdentifier(name, type, "android");
|
mHandleView.getContext().getResources().getIdentifier(name, type, "android");
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
import android.support.v7.app.*;
|
import android.support.v7.app.*;
|
||||||
|
import android.os.*;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
Tools.updateWindowSize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,8 +347,8 @@ public final class Tools
|
|||||||
|
|
||||||
public static float dpToPx(Context ctx, float dp) {
|
public static float dpToPx(Context ctx, float dp) {
|
||||||
// 921600 = 1280 * 720, default scale
|
// 921600 = 1280 * 720, default scale
|
||||||
float scaledDp = dp * currentDisplayMetrics.scaledDensity;
|
// TODO better way to scaling
|
||||||
// / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
float scaledDp = dp / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
||||||
return (scaledDp * ctx.getResources().getDisplayMetrics().density);
|
return (scaledDp * ctx.getResources().getDisplayMetrics().density);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user