Skip to content

Commit

Permalink
refactor(wear): extract ui strings
Browse files Browse the repository at this point in the history
  • Loading branch information
matey97 committed Jul 7, 2022
1 parent 92b36d1 commit c4ab89f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
17 changes: 8 additions & 9 deletions wear-app/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -29,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:justificationMode="inter_word"
android:text='Tap "START ALL"/"STOP ALL" to instruct the smartphone to request/cancel updates for each sensor' />
android:text='@string/info_command_txt' />

<Button
android:id="@+id/start_all_command"
Expand All @@ -39,7 +38,7 @@
android:layout_gravity="center|center_horizontal"
android:layout_margin="10dp"
android:onClick="onStartAllCommandTap"
android:text="Start all" />
android:text="@string/start_all_btn" />

<Button
android:id="@+id/stop_all_command"
Expand All @@ -50,14 +49,14 @@
android:layout_margin="10dp"
android:onClick="onStopAllCommandTap"
android:visibility="gone"
android:text="Stop all" />
android:text="@string/stop_all_btn" />

<TextView
android:id="@+id/info_command_single"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:justificationMode="inter_word"
android:text='Tap "START"/"STOP" to instruct the smartphone to request/cancel updates for the selected sensor' />
android:text='@string/info_command_single_txt' />

<Spinner
android:id="@+id/sensor_spinner"
Expand All @@ -73,7 +72,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="onStartSingleCommandTap"
android:text="Start" />
android:text="@string/start_btn" />

<Button
android:id="@+id/stop_single_command"
Expand All @@ -83,14 +82,14 @@
android:layout_gravity="center"
android:onClick="onStopSingleCommandTap"
android:visibility="gone"
android:text="Stop" />
android:text="@string/stop_btn" />

<TextView
android:id="@+id/info_free_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:justificationMode="inter_word"
android:text="You can also send and receive custom messages to/from the smartphone. Tap &quot;SEND TEST&quot; to send a message to the smartphone" />
android:text="@string/info_free_txt" />

<Button
android:id="@+id/send_free_message"
Expand All @@ -100,6 +99,6 @@
android:layout_gravity="center"
android:layout_margin="10dp"
android:onClick="onSendFreeMessageTap"
android:text="SEND TEST" />
android:text="@string/send_free_btn" />
</LinearLayout>
</ScrollView>
8 changes: 8 additions & 0 deletions wear-app/app/src/main/res/values-round/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<resources>
<string name="hello_world">Hello Round World!</string>
<string name="info_command_txt">Tap START ALL/STOP ALL to instruct the smartphone to request/cancel updates for each sensor</string>
<string name="start_all_btn">Start all</string>
<string name="stop_all_btn">Stop all</string>
<string name="info_command_single_txt">Tap START/STOP to instruct the smartphone to request/cancel updates for the selected sensor</string>
<string name="start_btn">Start</string>
<string name="stop_btn">Stop</string>
<string name="info_free_txt">You can also send and receive custom messages to/from the smartphone. Tap \"SEND TEST\" to send a message to the smartphone</string>
<string name="send_free_btn">SEND TEST</string>
</resources>
8 changes: 8 additions & 0 deletions wear-app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@
values-round/strings.xml for round devices.
-->
<string name="hello_world">Hello Square World!</string>
<string name="info_command_txt">Tap START ALL/STOP ALL to instruct the smartphone to request/cancel updates for each sensor</string>
<string name="start_all_btn">Start all</string>
<string name="stop_all_btn">Stop all</string>
<string name="info_command_single_txt">Tap START/STOP to instruct the smartphone to request/cancel updates for the selected sensor</string>
<string name="start_btn">Start</string>
<string name="stop_btn">Stop</string>
<string name="info_free_txt">You can also send and receive custom messages to/from the smartphone. Tap \"SEND TEST\" to send a message to the smartphone</string>
<string name="send_free_btn">SEND TEST</string>
</resources>

0 comments on commit c4ab89f

Please sign in to comment.