mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-22 10:37:16 -04:00
A lot of changes
* Custom controls: - Rename classes - Add Dynamic position calculator for auto scale. TODO: document position variables * Source code - Abstracts MainActivity.java to prepare implement custom control.
This commit is contained in:
@@ -120,7 +120,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
alert.setPositiveButton(android.R.string.ok, null);
|
||||
alert.setNegativeButton(android.R.string.cancel, null);
|
||||
final AlertDialog dialog = alert.create();
|
||||
final ControlButton properties = mHandleView.mView.getProperties();
|
||||
final ControlData properties = mHandleView.mView.getProperties();
|
||||
|
||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
final Spinner spinnerKeycode = dialog.findViewById(R.id.controlsetting_spinner_lwjglkeycode);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(view.getContext(), android.R.layout.simple_spinner_item);
|
||||
|
||||
String[] oldSpecialArr = ControlButton.buildSpecialButtonArray();
|
||||
String[] oldSpecialArr = ControlData.buildSpecialButtonArray();
|
||||
String[] specialArr = new String[oldSpecialArr.length];
|
||||
for (int i = 0; i < specialArr.length; i++) {
|
||||
specialArr[i] = "SPECIAL_" + oldSpecialArr[i];
|
||||
@@ -145,7 +145,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
spinnerKeycode.setAdapter(adapter);
|
||||
if (properties.keycode < 0) {
|
||||
spinnerKeycode.setSelection(properties.keycode + 2);
|
||||
spinnerKeycode.setSelection(properties.keycode + 5);
|
||||
} else {
|
||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 2));
|
||||
}
|
||||
@@ -194,7 +194,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
ControlsLayout layout = ((ControlsLayout) mHandleView.mView.getParent());
|
||||
ControlLayout layout = ((ControlLayout) mHandleView.mView.getParent());
|
||||
layout.removeControlButton(mHandleView.mView);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
||||
private Runnable mActionPopupShower;
|
||||
// Minimum touch target size for handles
|
||||
private int mMinSize;
|
||||
protected ControlView mView;
|
||||
protected ControlButton mView;
|
||||
|
||||
// MOD: Addition. Save old size of parent
|
||||
private int mDownWidth, mDownHeight;
|
||||
@@ -92,7 +92,7 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
||||
return -1;
|
||||
}
|
||||
|
||||
public HandleView(ControlView view) {
|
||||
public HandleView(ControlButton view) {
|
||||
super(view.getContext());
|
||||
|
||||
mView = view;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.kdt.pojavlaunch.customcontrols.*;
|
||||
|
||||
public class SelectionEndHandleView extends HandleView
|
||||
{
|
||||
public SelectionEndHandleView(ControlView view) {
|
||||
public SelectionEndHandleView(ControlButton view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user