mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 17:15:40 -04:00
Clean some code
This commit is contained in:
parent
0fa13e2328
commit
e2f35f3f6f
@ -271,8 +271,8 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModifiable(boolean z) {
|
public void setModifiable(boolean isModifiable) {
|
||||||
mModifiable = z;
|
mModifiable = isModifiable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setModified(boolean modified) {
|
private void setModified(boolean modified) {
|
||||||
|
@ -44,20 +44,12 @@ public class ControlLayout extends FrameLayout
|
|||||||
if (mModifiable) {
|
if (mModifiable) {
|
||||||
hideAllHandleViews();
|
hideAllHandleViews();
|
||||||
}
|
}
|
||||||
/*if (getChildAt(0) instanceof MinecraftGLView) {
|
removeAllButtons();
|
||||||
View viewGL = getChildAt(0);
|
if(mLayout != null) {
|
||||||
View viewTouchpad = getChildAt(1);
|
mLayout.mControlDataList = null;
|
||||||
removeAllViews();
|
mLayout = null;
|
||||||
addView(viewGL);
|
}
|
||||||
addView(viewTouchpad);
|
|
||||||
} else {
|
|
||||||
removeAllViews();*/
|
|
||||||
removeAllButtons();
|
|
||||||
//}
|
|
||||||
if (mLayout != null) {
|
|
||||||
mLayout.mControlDataList = null;
|
|
||||||
mLayout = null;
|
|
||||||
}
|
|
||||||
System.gc();
|
System.gc();
|
||||||
|
|
||||||
// Cleanup buttons only when input layout is null
|
// Cleanup buttons only when input layout is null
|
||||||
@ -70,8 +62,8 @@ public class ControlLayout extends FrameLayout
|
|||||||
button.width = button.width / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
button.width = button.width / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
||||||
button.height = button.height / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
button.height = button.height / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
||||||
if (!button.isDynamicBtn) {
|
if (!button.isDynamicBtn) {
|
||||||
button.dynamicX = Float.toString(button.x / CallbackBridge.physicalWidth) + " * ${screen_width}";
|
button.dynamicX = button.x / CallbackBridge.physicalWidth + " * ${screen_width}";
|
||||||
button.dynamicY = Float.toString(button.y / CallbackBridge.physicalHeight) + " * ${screen_height}";
|
button.dynamicY = button.y / CallbackBridge.physicalHeight + " * ${screen_height}";
|
||||||
}
|
}
|
||||||
button.update();
|
button.update();
|
||||||
addControlView(button);
|
addControlView(button);
|
||||||
@ -138,7 +130,7 @@ public class ControlLayout extends FrameLayout
|
|||||||
for (int i = 0; i < getChildCount(); i++) {
|
for (int i = 0; i < getChildCount(); i++) {
|
||||||
View view = getChildAt(i);
|
View view = getChildAt(i);
|
||||||
if (view instanceof ControlButton && ((ControlButton) view).getProperties().isHideable) {
|
if (view instanceof ControlButton && ((ControlButton) view).getProperties().isHideable) {
|
||||||
((ControlButton) view).setVisibility(mControlVisible ? View.VISIBLE : View.GONE);
|
view.setVisibility(mControlVisible ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user