mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 00:59:35 -04:00
[Custom controls] Add settings to change size manually
This commit is contained in:
parent
76c7b4aeb2
commit
46a2bddbcd
@ -116,6 +116,11 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
final CheckBox checkToggle = dialog.findViewById(R.id.controlsetting_checkbox_toggle);
|
||||
checkToggle.setChecked(properties.isToggle);
|
||||
|
||||
final EditText editWidth = dialog.findViewById(R.id.controlsetting_edit_width);
|
||||
final EditText editHeight = dialog.findViewById(R.id.controlsetting_edit_height);
|
||||
editWidth.setText(Float.toString(properties.width));
|
||||
editHeight.setText(Float.toString(properties.height));
|
||||
|
||||
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);
|
||||
@ -201,6 +206,8 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
properties.hidden = false;
|
||||
properties.isToggle = checkToggle.isChecked();
|
||||
properties.isDynamicBtn = checkDynamicPos.isChecked();
|
||||
properties.width = Float.parseFloat(editWidth.toString());
|
||||
properties.height = Float.parseFloat(editHeight.toString());
|
||||
properties.dynamicX = editDynamicX.getText().toString();
|
||||
properties.dynamicY = editDynamicY.getText().toString();
|
||||
|
||||
|
@ -30,11 +30,11 @@
|
||||
android:singleLine="true"
|
||||
android:id="@+id/controlsetting_edit_name"/>
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/customctrl_transparency_bg"/>
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/customctrl_transparency_bg"/>
|
||||
|
||||
<SeekBar
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
@ -46,6 +46,41 @@
|
||||
android:text="@string/customctrl_toggle"
|
||||
android:id="@+id/controlsetting_checkbox_toggle"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customctrl_size"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<EditText
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/controlsetting_edit_width"
|
||||
android:hint="@string/customctrl_size_width"
|
||||
android:inputType="numberDecimal"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="×"
|
||||
android:gravity="center"/>
|
||||
|
||||
<EditText
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/controlsetting_edit_height"
|
||||
android:hint="@string/customctrl_size_height"
|
||||
android:inputType="numberDecimal"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -177,6 +177,9 @@
|
||||
|
||||
<string name="customctrl_keyname">Keycode</string>
|
||||
<string name="customctrl_toggle">Toggleable</string>
|
||||
<string name="customctrl_size">Size</string>
|
||||
<string name="customctrl_size_width">Width</string>
|
||||
<string name="customctrl_size_height">Height</string>
|
||||
|
||||
<string name="customctrl_dynamicpos">Dynamic position</string>
|
||||
<string name="customctrl_dynamicpos_x">Dynamic X</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user