The subButton is now properly hidden on launch

This commit is contained in:
SerpentSpirale 2021-05-10 21:34:05 +02:00
parent 4de83829fa
commit 659563d3f8
2 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,7 @@ public class ControlDrawer extends ControlButton {
public ArrayList<ControlSubButton> buttons;
public ControlDrawerData drawerData;
public ControlLayout mLayout;
private boolean areButtonsVisible = false;
public boolean areButtonsVisible = false;
public ControlDrawer(ControlLayout layout, ControlDrawerData drawerData) {

View File

@ -1,5 +1,9 @@
package net.kdt.pojavlaunch.customcontrols;
import android.os.Handler;
import android.os.Looper;
import android.view.ViewGroup;
public class ControlSubButton extends ControlButton {
public ControlDrawer parentDrawer;
@ -7,6 +11,10 @@ public class ControlSubButton extends ControlButton {
public ControlSubButton(ControlLayout layout, ControlData properties, ControlDrawer parentDrawer) {
super(layout, properties);
this.parentDrawer = parentDrawer;
//Delayed to let the button inflate first
new Handler(Looper.getMainLooper()).postDelayed(() -> setVisibility(parentDrawer.areButtonsVisible ? VISIBLE : GONE), 0);
filterProperties();
}