Support multiple lines on Send to Google CheckBox and RadioButtons

- Center align the CheckBox to the ImageView
- Note that to support line wrapping inside a TableLayout, need to
set the layout_width to 0dp.
This commit is contained in:
Jimmy Shih
2012-01-03 14:47:54 -08:00
parent 40d0eed281
commit 235fd16e5a
3 changed files with 66 additions and 80 deletions
+43 -77
View File
@@ -18,23 +18,17 @@ limitations under the License.
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <TextView
android:background="@drawable/list_bar" android:background="@drawable/list_bar"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent"> android:layout_width="fill_parent"
<TextView android:paddingLeft="10dp"
android:layout_height="wrap_content" android:text="@string/send_google_title"
android:layout_marginLeft="10dip" android:textColor="@color/white"
android:layout_width="fill_parent" android:textSize="20sp"/>
android:text="@string/send_google_title"
android:textColor="#fff"
android:textSize="20dip"/>
</LinearLayout>
<ScrollView <ScrollView
android:layout_height="0dip" android:layout_height="0dp"
android:layout_marginBottom="5dip" android:layout_margin="5dp"
android:layout_marginLeft="5dip"
android:layout_marginTop="5dip"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="fill_parent"> android:layout_width="fill_parent">
<TableLayout <TableLayout
@@ -42,82 +36,54 @@ limitations under the License.
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:stretchColumns="1"> android:stretchColumns="1">
<!-- Google My Maps --> <!-- Google Maps -->
<TableRow> <TableRow>
<ImageView <ImageView
android:src="@drawable/mymaps_icon"
style="@style/SendGoogleImageView"/>
<CheckBox
android:id="@+id/send_google_my_maps"
android:text="@string/send_google_my_maps"
style="@style/SendGoogleCheckBox"/>
</TableRow>
<TableRow>
<RadioGroup
android:id="@+id/send_google_my_maps_group"
android:layout_column="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_marginLeft="10dp"
android:src="@drawable/mymaps_icon"/> android:layout_width="0dp">
<LinearLayout <RadioButton
android:layout_height="wrap_content" android:id="@+id/send_google_new_map"
android:layout_marginLeft="10dip" android:text="@string/send_google_new_map"
android:layout_width="fill_parent" style="@style/SendGoogleRadioButton"/>
android:orientation="vertical"> <RadioButton
<CheckBox android:id="@+id/send_google_existing_map"
android:checked="true" android:text="@string/send_google_existing_map"
android:id="@+id/send_google_my_maps" style="@style/SendGoogleRadioButton"/>
android:layout_height="wrap_content" </RadioGroup>
android:layout_width="fill_parent"
android:text="@string/send_google_my_maps"
android:textSize="18dip"/>
<RadioGroup
android:id="@+id/send_google_my_maps_group"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<RadioButton
android:id="@+id/send_google_new_map"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/send_google_new_map"/>
<RadioButton
android:id="@+id/send_google_existing_map"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/send_google_existing_map"/>
</RadioGroup>
</LinearLayout>
</TableRow> </TableRow>
<!-- Google Fusion Tables --> <!-- Google Fusion Tables -->
<TableRow> <TableRow>
<ImageView <ImageView
android:layout_height="wrap_content" android:src="@drawable/googledocs_icon"
android:layout_width="wrap_content" style="@style/SendGoogleImageView"/>
android:src="@drawable/googledocs_icon"/> <CheckBox
<LinearLayout android:id="@+id/send_google_fusion_tables"
android:layout_height="wrap_content" android:text="@string/send_google_fusion_tables"
android:layout_marginLeft="10dip" style="@style/SendGoogleCheckBox"/>
android:layout_width="fill_parent"
android:orientation="vertical">
<CheckBox
android:checked="true"
android:id="@+id/send_google_fusion_tables"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/send_google_fusion_tables"
android:textSize="18dip"/>
</LinearLayout>
</TableRow> </TableRow>
<!-- Google Docs --> <!-- Google Docs -->
<TableRow android:id="@+id/send_google_docs_table_row"> <TableRow android:id="@+id/send_google_docs_table_row">
<ImageView <ImageView
android:layout_height="wrap_content" android:src="@drawable/googledocs_icon"
android:layout_width="wrap_content" style="@style/SendGoogleImageView"/>
android:src="@drawable/googledocs_icon"/> <CheckBox
<LinearLayout android:id="@+id/send_google_docs"
android:layout_height="wrap_content" android:text="@string/send_google_docs"
android:layout_marginLeft="10dip" style="@style/SendGoogleCheckBox"/>
android:layout_width="fill_parent"
android:orientation="vertical">
<CheckBox
android:checked="true"
android:id="@+id/send_google_docs"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/send_google_docs"
android:textSize="18dip"/>
</LinearLayout>
</TableRow> </TableRow>
</TableLayout> </TableLayout>
</ScrollView> </ScrollView>
-2
View File
@@ -1129,7 +1129,6 @@ limitations under the License.
translation_description="When sending a track to Google Maps, the radio option to use an translation_description="When sending a track to Google Maps, the radio option to use an
existing map as opposed to create a new map. existing map as opposed to create a new map.
Character limit: ~21 (1 line)
Screenshot: send_google_choose_service.png"> Screenshot: send_google_choose_service.png">
Use existing map Use existing map
</string> </string>
@@ -1151,7 +1150,6 @@ limitations under the License.
translation_description="When sending a track to Google Maps, the radio option to create a translation_description="When sending a track to Google Maps, the radio option to create a
new map as opposed to use an existing map. new map as opposed to use an existing map.
Character limit: ~21 (1 line)
Screenshot: send_google_choose_service.png"> Screenshot: send_google_choose_service.png">
Create new map Create new map
</string> </string>
+22
View File
@@ -107,6 +107,28 @@ limitations under the License.
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
</style> </style>
<!-- Send Google CheckBox -->
<style name="SendGoogleCheckBox">
<item name="android:checked">true</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:textSize">18sp</item>
</style>
<!-- Send Google ImageView -->
<style name="SendGoogleImageView">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
</style>
<!-- Send Google RadioButton -->
<style name="SendGoogleRadioButton">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textSize">18sp</item>
</style>
<style name="SensorStateLabel"> <style name="SensorStateLabel">
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item> <item name="android:layout_width">fill_parent</item>