Update app widget to support pause/resume.

This commit is contained in:
Jimmy Shih
2012-09-06 11:05:53 -07:00
parent 65fbb30f01
commit e881af032e
14 changed files with 252 additions and 251 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
<padding
android:bottom="8dp"
android:left="8dp"
android:right="8dp"
android:top="8dp" />
<corners android:radius="8dp" />
<stroke
android:color="@android:color/white"
android:width="2dp" />
</shape>
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/track_widget_red" />
<padding
android:bottom="8dp"
android:left="8dp"
android:right="8dp"
android:top="8dp" />
<corners android:radius="8dp" />
</shape>
+58 -52
View File
@@ -15,94 +15,100 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/track_widget_background"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:padding="@dimen/widget_margin" >
<LinearLayout
android:background="@drawable/track_widget_background"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="horizontal" >
<ImageButton
android:background="@android:color/transparent"
android:contentDescription="@string/my_tracks_app_name"
android:id="@+id/track_widget_icon"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:padding="8dp"
android:src="@drawable/my_tracks_icon" />
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp" >
<LinearLayout
android:clickable="true"
android:id="@+id/track_widget_statistics"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_width="0dp"
android:orientation="vertical"
android:paddingLeft="8dp" >
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical" >
<LinearLayout style="@style/TrackWidgetStat" >
<TextView
android:id="@+id/track_widget_distance_value"
style="@style/TrackWidgetValue" />
<TextView
android:text="@string/stats_total_distance"
style="@style/TrackWidgetLabel" />
<TextView style="@style/TrackWidgetSpacer" />
<TextView
android:id="@+id/track_widget_total_distance_value"
style="@style/TrackWidgetLabel" />
</LinearLayout>
<LinearLayout style="@style/TrackWidgetSeparator" />
<LinearLayout style="@style/TrackWidgetStat" >
<TextView
android:id="@+id/track_widget_total_time_value"
style="@style/TrackWidgetValue" />
<TextView
android:text="@string/stats_total_time"
style="@style/TrackWidgetLabel" />
<TextView style="@style/TrackWidgetSpacer" />
<TextView
android:id="@+id/track_widget_total_time_value"
style="@style/TrackWidgetLabel" />
</LinearLayout>
<LinearLayout style="@style/TrackWidgetSeparator" />
<LinearLayout style="@style/TrackWidgetStat" >
<TextView
android:id="@+id/track_widget_average_speed_value"
style="@style/TrackWidgetValue" />
<TextView
android:id="@+id/track_widget_average_speed_label"
style="@style/TrackWidgetLabel" />
</LinearLayout>
<LinearLayout
android:id="@+id/track_widget_moving_time_separator"
style="@style/TrackWidgetSeparator" />
<LinearLayout
android:id="@+id/track_widget_moving_time_stat"
style="@style/TrackWidgetStat" >
<TextView style="@style/TrackWidgetSpacer" />
<TextView
android:id="@+id/track_widget_moving_time_value"
style="@style/TrackWidgetValue" />
<TextView
android:text="@string/stats_moving_time"
android:id="@+id/track_widget_average_speed_value"
style="@style/TrackWidgetLabel" />
</LinearLayout>
<LinearLayout
android:id="@+id/track_widget_average_moving_speed_separator"
style="@style/TrackWidgetSeparator" />
<LinearLayout
android:id="@+id/track_widget_average_moving_speed_stat"
style="@style/TrackWidgetStat" >
<TextView
android:id="@+id/track_widget_average_moving_speed_value"
style="@style/TrackWidgetValue" />
<TextView
android:id="@+id/track_widget_average_moving_speed_label"
style="@style/TrackWidgetLabel" />
android:id="@+id/track_widget_moving_time_container"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical" >
<LinearLayout style="@style/TrackWidgetSeparator" />
<LinearLayout style="@style/TrackWidgetStat" >
<TextView
android:text="@string/stats_moving_time"
style="@style/TrackWidgetLabel" />
<TextView style="@style/TrackWidgetSpacer" />
<TextView
android:id="@+id/track_widget_moving_time_value"
style="@style/TrackWidgetLabel" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:clipChildren="false"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingTop="4dp" >
<ImageButton
android:background="@drawable/track_widget_record_button_background"
android:background="@android:color/transparent"
android:contentDescription="@string/icon_record_track"
android:id="@+id/track_widget_record_button"
android:src="@drawable/track_widget_record_button"
style="@style/TrackWidgetButton" />
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/btn_record" />
<TextView
android:id="@+id/track_widget_record_status"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:singleLine="true"
style="@style/TextSmall" />
<ImageButton
android:background="@drawable/track_widget_stop_button_background"
android:background="@android:color/transparent"
android:contentDescription="@string/icon_stop_recording"
android:id="@+id/track_widget_stop_button"
android:src="@drawable/track_widget_stop_button"
style="@style/TrackWidgetButton" />
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/btn_stop_0" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
+2 -1
View File
@@ -94,7 +94,8 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
<string name="settings_recording_track_name_location_value">LOCATION</string>
<string name="settings_recording_track_name_number_value">NUMBER</string>
<string name="track_action_end">com.google.android.apps.mytracks.END_CURRENT_TRACK</string>
<string name="track_action_save">android.intent.action.SAVE</string>
<string name="track_action_pause">com.google.android.apps.mytracks.PAUSE_CURRENT_TRACK</string>
<string name="track_action_resume">com.google.android.apps.mytracks.RESUME_CURRENT_TRACK</string>
<string name="track_action_start">com.google.android.apps.mytracks.START_NEW_TRACK</string>
<string name="value_unknown">-</string>
</resources>
+8 -14
View File
@@ -192,17 +192,11 @@ limitations under the License.
<item name="android:layout_width">fill_parent</item>
<item name="android:orientation">vertical</item>
</style>
<!-- The style for the track widget button -->
<style name="TrackWidgetButton">
<item name="android:layout_gravity">center_horizontal</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:padding">8dp</item>
</style>
<!-- The style for the track widget label -->
<style name="TrackWidgetLabel" parent="@style/TextSmall">
<item name="android:width">100dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_width">0dp</item>
</style>
<!-- The style for the track widget separator -->
<style name="TrackWidgetSeparator">
@@ -210,15 +204,15 @@ limitations under the License.
<item name="android:layout_height">1dp</item>
<item name="android:layout_width">fill_parent</item>
</style>
<!-- The style for the track widget spacer -->
<style name="TrackWidgetSpacer">
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_width">4dp</item>
</style>
<!-- The style for the track widget stat -->
<style name="TrackWidgetStat">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:orientation">horizontal</item>
</style>
<!-- The style for the track widget value -->
<style name="TrackWidgetValue" parent="@style/TextSmall">
<item name="android:layout_weight">1</item>
<item name="android:layout_width">0dp</item>
</style>
</resources>