mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 09:07:48 -04:00
[Custom control] Bug fix: dynamic position is editable on non-dynamic state
This commit is contained in:
parent
77c4dd12c1
commit
c19d5791d4
@ -122,20 +122,22 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||||||
final CheckBox checkToggle = dialog.findViewById(R.id.controlsetting_checkbox_toggle);
|
final CheckBox checkToggle = dialog.findViewById(R.id.controlsetting_checkbox_toggle);
|
||||||
checkToggle.setChecked(properties.isToggle);
|
checkToggle.setChecked(properties.isToggle);
|
||||||
|
|
||||||
final LinearLayout layoutDynamicBtn = dialog.findViewById(R.id.controlsetting_dynamicbtnlayout);
|
final EditText editDynamicX = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_x);
|
||||||
|
final EditText editDynamicY = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_y);
|
||||||
|
editDynamicX.setEnabled(properties.isDynamicBtn);
|
||||||
|
editDynamicY.setEnabled(properties.isDynamicBtn);
|
||||||
|
|
||||||
final CheckBox checkDynamicPos = dialog.findViewById(R.id.controlsetting_checkbox_dynamicpos);
|
final CheckBox checkDynamicPos = dialog.findViewById(R.id.controlsetting_checkbox_dynamicpos);
|
||||||
checkDynamicPos.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener(){
|
checkDynamicPos.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton btn, boolean checked) {
|
public void onCheckedChanged(CompoundButton btn, boolean checked) {
|
||||||
layoutDynamicBtn.setVisibility(checked ? View.VISIBLE : View.GONE);
|
editDynamicX.setEnabled(checked);
|
||||||
|
editDynamicY.setEnabled(checked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkDynamicPos.setChecked(properties.isDynamicBtn);
|
checkDynamicPos.setChecked(properties.isDynamicBtn);
|
||||||
|
|
||||||
final EditText editDynamicX = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_x);
|
|
||||||
final EditText editDynamicY = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_y);
|
|
||||||
|
|
||||||
editDynamicX.setHint(Float.toString(properties.x));
|
editDynamicX.setHint(Float.toString(properties.x));
|
||||||
editDynamicX.setText(properties.dynamicX);
|
editDynamicX.setText(properties.dynamicX);
|
||||||
|
|
||||||
|
@ -51,8 +51,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:id="@+id/controlsetting_dynamicbtnlayout">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user