mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -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) {
|
||||
int id = Resources.getSystem().getIdentifier(name, type, "com.android.internal.R");
|
||||
int id = Resources.getSystem().getIdentifier(name, type, "com.android.internal");
|
||||
if (id == 0) {
|
||||
mHandleView.getContext().getResources().getIdentifier(name, type, "android");
|
||||
}
|
||||
|
@ -1,7 +1,13 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class MCLauncherActivity extends BaseLauncherActivity
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
|
||||
viewInit();
|
||||
|
||||
Tools.setFullscreen(this);
|
||||
|
@ -347,8 +347,8 @@ public final class Tools
|
||||
|
||||
public static float dpToPx(Context ctx, float dp) {
|
||||
// 921600 = 1280 * 720, default scale
|
||||
float scaledDp = dp * currentDisplayMetrics.scaledDensity;
|
||||
// / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
||||
// TODO better way to scaling
|
||||
float scaledDp = dp / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
||||
return (scaledDp * ctx.getResources().getDisplayMetrics().density);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user