Add user-defined button labels with color change on press

- PrefsHelper: PREF_LABEL1, PREF_LABEL2 constants
- SettingsActivity: EditText fields with Done-keyboard action to save labels
- MainActivity: buttons show user label, colorAccent on press, textAllCaps disabled
- activity_main.xml: textAllCaps=false for case-sensitive labels
This commit is contained in:
eddy 2026-07-29 20:25:27 +02:00
commit a3142ea85b
3 changed files with 109 additions and 8 deletions

View file

@ -26,6 +26,7 @@
android:layout_height="200dp"
android:text="1"
android:textSize="24sp"
android:textAllCaps="false"
android:enabled="false" />
<Button
@ -35,6 +36,7 @@
android:layout_marginStart="16dp"
android:text="2"
android:textSize="24sp"
android:textAllCaps="false"
android:enabled="false" />
</LinearLayout>

View file

@ -45,6 +45,49 @@
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/section_labels"
android:textSize="14sp"
android:textStyle="bold"
android:layout_marginBottom="8dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="16dp">
<EditText
android:id="@+id/labelRelay1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/hint_label_relay1"
android:maxLines="1"
android:inputType="text"
android:imeOptions="actionDone"
android:gravity="center" />
<EditText
android:id="@+id/labelRelay2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/hint_label_relay2"
android:maxLines="1"
android:inputType="text"
android:imeOptions="actionDone"
android:gravity="center" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
android:layout_marginBottom="16dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -55,6 +55,11 @@
<string name="button_close">Sluiten</string>
<string name="button_cancel">Annuleren</string>
<!-- Label customization -->
<string name="section_labels">Knoptekst</string>
<string name="hint_label_relay1">Relay 1</string>
<string name="hint_label_relay2">Relay 2</string>
<!-- Theme -->
<string name="section_theme">Weergave</string>
<string name="theme_system">Systeem</string>