move layout files into res_src, and modify script to mark their localizable strings with loc:; run all layout inflation through new function that substitutes for loc:

This commit is contained in:
Eric House 2014-04-08 06:47:33 -07:00
parent 848f6ff221
commit 201e808b4a
36 changed files with 23 additions and 34 deletions

View file

@ -1,7 +0,0 @@
<resources>
<declare-styleable name="LocText">
<!-- It doesn't matter the format: string, integer and
reference all "work" -->
<attr name="strid" format="integer" />
</declare-styleable>
</resources>

View file

@ -4,7 +4,6 @@
<!-- top-level layout is hozontal, with an image and another layout -->
<org.eehouse.android.xw4.GameListItem
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/org.eehouse.android.xw4"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -21,7 +20,7 @@
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
custom:strid="@string/game_list_tmp"
android:text="@string/game_list_tmp"
/>
<LinearLayout android:id="@+id/view_loaded"

View file

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ListItem
<org.eehouse.android.xw4.loc.LocListItem
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/org.eehouse.android.xw4"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -15,4 +14,4 @@
style="@style/evenly_spaced_horizontal"
/>
</ListItem>
</org.eehouse.android.xw4.loc.LocListItem>

View file

@ -2,7 +2,6 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/org.eehouse.android.xw4"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -41,7 +40,7 @@
/>
<TextView style="@style/evenly_spaced_horizontal"
custom:strid="@string/loc_main_yourlang"
android:text="@string/loc_main_yourlang"
/>
</LinearLayout>

View file

@ -15,7 +15,6 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/org.eehouse.android.xw4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
@ -29,7 +28,7 @@
<TextView
style="@style/config_separator"
android:textAppearance="?android:attr/textAppearanceMedium"
custom:strid="@string/newgame_local_header"
android:text="@string/newgame_local_header"
/>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
@ -53,11 +52,11 @@
android:layout_height="wrap_content"
>
<Button android:id="@+id/newgame_local"
custom:strid="@string/newgame_local"
android:text="@string/newgame_local"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/newgame_local_config"
custom:strid="@string/newgame_local_config"
android:text="@string/newgame_local_config"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
@ -66,7 +65,7 @@
<TextView style="@style/config_separator"
android:layout_marginTop="10dip"
android:textAppearance="?android:attr/textAppearanceMedium"
custom:strid="@string/newgame_networked_header"
android:text="@string/newgame_networked_header"
/>
<LinearLayout android:orientation="horizontal"
@ -81,7 +80,7 @@
android:layout_weight="0"
android:layout_gravity="center_vertical|center_horizontal"
/>
<TextView custom:strid="@string/newgame_networked_desc"
<TextView android:text="@string/newgame_networked_desc"
style="@style/relay_explain"
/>
</LinearLayout>
@ -91,12 +90,12 @@
android:layout_height="wrap_content"
>
<Button android:id="@+id/newgame_invite_net"
custom:strid="@string/newgame_invite"
android:text="@string/newgame_invite"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/newgame_net_config"
custom:strid="@string/newgame_net_config"
android:text="@string/newgame_net_config"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
@ -106,7 +105,7 @@
style="@style/config_separator"
android:layout_marginTop="10dip"
android:textAppearance="?android:attr/textAppearanceMedium"
custom:strid="@string/newgame_sms_header"
android:text="@string/newgame_sms_header"
android:visibility="gone"
/>
@ -116,13 +115,13 @@
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView custom:strid="@string/sms_disabled"
<TextView android:text="@string/sms_disabled"
style="@style/relay_explain"
/>
<Button android:id="@+id/newgame_enable_sms"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
custom:strid="@string/newgame_enable_sms"
android:text="@string/newgame_enable_sms"
/>
</LinearLayout>
@ -144,7 +143,7 @@
android:layout_weight="0"
android:layout_gravity="center_vertical|center_horizontal"
/>
<TextView custom:strid="@string/sms_networked_desc"
<TextView android:text="@string/sms_networked_desc"
style="@style/relay_explain"
/>
</LinearLayout>
@ -154,12 +153,12 @@
android:layout_height="wrap_content"
>
<Button android:id="@+id/newgame_invite_sms"
custom:strid="@string/newgame_invite"
android:text="@string/newgame_invite"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/newgame_sms_config"
custom:strid="@string/newgame_net_config"
android:text="@string/newgame_net_config"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
@ -170,7 +169,7 @@
style="@style/config_separator"
android:layout_marginTop="10dip"
android:textAppearance="?android:attr/textAppearanceMedium"
custom:strid="@string/newgame_bt_header"
android:text="@string/newgame_bt_header"
android:visibility="gone"
/>
@ -180,13 +179,13 @@
android:layout_height="wrap_content"
android:visibility="gone"
>
<TextView custom:strid="@string/bt_disabled"
<TextView android:text="@string/bt_disabled"
style="@style/relay_explain"
/>
<Button android:id="@+id/newgame_enable_bt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
custom:strid="@string/newgame_enable_bt"
android:text="@string/newgame_enable_bt"
/>
</LinearLayout>
@ -208,7 +207,7 @@
android:layout_weight="0"
android:layout_gravity="center_vertical|center_horizontal"
/>
<TextView custom:strid="@string/bt_networked_desc"
<TextView android:text="@string/bt_networked_desc"
style="@style/relay_explain"
/>
</LinearLayout>
@ -218,12 +217,12 @@
android:layout_height="wrap_content"
>
<Button android:id="@+id/newgame_invite_bt"
custom:strid="@string/newgame_invite"
android:text="@string/newgame_invite"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/newgame_bt_config"
custom:strid="@string/newgame_net_config"
android:text="@string/newgame_net_config"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>