- Some crashes
- Button too big
This commit is contained in:
khanhduytran0 2020-11-20 12:59:59 +07:00
parent 3d4ac3e287
commit 644af4eaaf
4 changed files with 12 additions and 6 deletions

View File

@ -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");
} }

View File

@ -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);
}
} }

View File

@ -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);
} }