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:
parent
a6e5df0052
commit
a3142ea85b
3 changed files with 109 additions and 8 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue