mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Changes
- Try to fix scaling (if get back, tablet buttons will be small). - Try to fix Minecraft not starting.
This commit is contained in:
parent
29f14066bd
commit
e5fdd21284
5 changed files with 31 additions and 27 deletions
|
|
@ -107,9 +107,11 @@ public class BaseMainActivity extends LoggableActivity {
|
||||||
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
public void onCreate(Bundle savedInstanceState, int resId)
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initLayout(int resId) {
|
||||||
setContentView(resId);
|
setContentView(resId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ public class CustomCtrlMainActivity extends BaseMainActivity implements OnClickL
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState, R.layout.main_with_customctrl);
|
super.onCreate(savedInstanceState);
|
||||||
|
initLayout(R.layout.main_with_customctrl);
|
||||||
|
|
||||||
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
||||||
for (ControlData specialButton : specialButtons) {
|
for (ControlData specialButton : specialButtons) {
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,11 @@ public class MainActivity extends BaseMainActivity implements OnClickListener, O
|
||||||
toggleControlButton;
|
toggleControlButton;
|
||||||
|
|
||||||
private Button[] controlButtons;
|
private Button[] controlButtons;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState, R.layout.main);
|
super.onCreate(savedInstanceState);
|
||||||
|
initLayout(R.layout.main);
|
||||||
|
|
||||||
this.upButton = findButton(R.id.control_up);
|
this.upButton = findButton(R.id.control_up);
|
||||||
this.downButton = findButton(R.id.control_down);
|
this.downButton = findButton(R.id.control_down);
|
||||||
|
|
|
||||||
|
|
@ -348,8 +348,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
|
||||||
// TODO better way to scaling
|
// TODO better way to scaling
|
||||||
float scaledDp = dp / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
// float scaledDp = dp / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
||||||
return (scaledDp * ctx.getResources().getDisplayMetrics().density);
|
return (dp /* scaledDp */ * ctx.getResources().getDisplayMetrics().densityDpi);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void copyAssetFile(Context ctx, String fileName, String output, boolean overwrite) throws Exception
|
public static void copyAssetFile(Context ctx, String fileName, String output, boolean overwrite) throws Exception
|
||||||
|
|
|
||||||
|
|
@ -13,31 +13,31 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<net.kdt.pojavlaunch.MinecraftGLView
|
||||||
|
android:id="@+id/main_game_render_view"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/main_touchpad"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_height="27dp"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:src="@drawable/mouse_pointer"
|
||||||
|
android:id="@+id/main_mouse_pointer"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<net.kdt.pojavlaunch.customcontrols.ControlLayout
|
<net.kdt.pojavlaunch.customcontrols.ControlLayout
|
||||||
android:id="@+id/main_control_layout"
|
android:id="@+id/main_control_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<net.kdt.pojavlaunch.MinecraftGLView
|
|
||||||
android:id="@+id/main_game_render_view"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/main_touchpad"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_height="27dp"
|
|
||||||
android:layout_width="18dp"
|
|
||||||
android:src="@drawable/mouse_pointer"
|
|
||||||
android:id="@+id/main_mouse_pointer"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</net.kdt.pojavlaunch.customcontrols.ControlLayout>
|
</net.kdt.pojavlaunch.customcontrols.ControlLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue