mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
add 4 layout sizes for the app widget
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
<?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.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/TrackWidgetBoundingBox" >
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingTop="4dp"
|
||||
style="@style/TrackWidgetFrame" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_record_track"
|
||||
android:id="@+id/track_widget_record_button"
|
||||
style="@style/TrackWidgetButtonRecord" />
|
||||
<LinearLayout
|
||||
android:id="@+id/track_widget_stats_container"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="18"
|
||||
android:layout_width="0dp"
|
||||
android:padding="0dp"
|
||||
style="@style/TrackWidgetStatsContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item1 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_value"
|
||||
style="@style/TrackWidgetValue" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_unit"
|
||||
style="@style/TrackWidgetUnit" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- horizontal separator -->
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetHorizontalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="38"
|
||||
style="@style/TrackWidgetHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<!-- item2 -->
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_value"
|
||||
style="@style/TrackWidgetValue" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_unit"
|
||||
style="@style/TrackWidgetUnit" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_stop_recording"
|
||||
android:id="@+id/track_widget_stop_button"
|
||||
style="@style/TrackWidgetButtonStop" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:contentDescription="@string/my_tracks_app_name"
|
||||
style="@style/TrackWidgetLogo" />
|
||||
</RelativeLayout>
|
||||
+59
-43
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2011 Google Inc.
|
||||
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.
|
||||
@@ -15,27 +15,18 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<RelativeLayout 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" >
|
||||
style="@style/TrackWidgetBoundingBox" >
|
||||
<LinearLayout
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetFrame" >
|
||||
<LinearLayout
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/track_widget_statistics"
|
||||
android:layout_height="0dp"
|
||||
android:baselineAligned="false"
|
||||
android:id="@+id/track_widget_stats_container"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="4dp" >
|
||||
<LinearLayout style="@style/LinearLayoutHorizontal" >
|
||||
style="@style/TrackWidgetStatsContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item1 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x2" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
@@ -49,12 +40,18 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- vertical separator -->
|
||||
<LinearLayout style="@style/LinearLayoutVertifcal" >
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSpacer" />
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSeparator" />
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetVerticalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalLine" />
|
||||
</LinearLayout>
|
||||
<!-- item3 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x2" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
@@ -69,10 +66,22 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- horizontal separator -->
|
||||
<LinearLayout style="@style/TrackWidgetHorizontalSeparator" />
|
||||
<LinearLayout style="@style/LinearLayoutHorizontal" >
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetHorizontalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="38"
|
||||
style="@style/TrackWidgetHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item2 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x2" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
@@ -86,12 +95,18 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- vertical separator -->
|
||||
<LinearLayout style="@style/LinearLayoutVertifcal" >
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSeparator" />
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSpacer" />
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetVerticalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
<!-- item4 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x2" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
@@ -106,31 +121,32 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingTop="4dp" >
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSpacer" />
|
||||
<LinearLayout style="@style/TrackWidgetButtonContainer" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_record_track"
|
||||
android:id="@+id/track_widget_record_button"
|
||||
style="@style/TrackWidgetRecordButton" />
|
||||
style="@style/TrackWidgetButtonRecord" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_record_status"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="4"
|
||||
android:layout_weight="2"
|
||||
android:layout_width="0dp"
|
||||
android:singleLine="true"
|
||||
style="@style/TextSmall" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_stop_recording"
|
||||
android:id="@+id/track_widget_stop_button"
|
||||
style="@style/TrackWidgetStopButton" />
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSpacer" />
|
||||
style="@style/TrackWidgetButtonStop" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageView style="@style/TrackWidgetLogo" />
|
||||
<ImageView
|
||||
android:contentDescription="@string/my_tracks_app_name"
|
||||
style="@style/TrackWidgetLogo" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,148 @@
|
||||
<?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.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/TrackWidgetBoundingBox" >
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetFrame" >
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
android:id="@+id/track_widget_stats_container"
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetStatsContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item1 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- vertical separator -->
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalLine" />
|
||||
</LinearLayout>
|
||||
<!-- item3 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- horizontal separator -->
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetHorizontalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="38"
|
||||
style="@style/TrackWidgetHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item2 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- vertical separator -->
|
||||
<LinearLayout style="@style/TrackWidgetVerticalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
<!-- item4 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetButtonContainer" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_record_track"
|
||||
android:id="@+id/track_widget_record_button"
|
||||
style="@style/TrackWidgetButtonRecord" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_record_status"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:layout_width="0dp"
|
||||
android:singleLine="true"
|
||||
style="@style/TextSmall" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_stop_recording"
|
||||
android:id="@+id/track_widget_stop_button"
|
||||
style="@style/TrackWidgetButtonStop" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:contentDescription="@string/my_tracks_app_name"
|
||||
style="@style/TrackWidgetLogo" />
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?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.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/TrackWidgetBoundingBox" >
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetFrame" >
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
android:id="@+id/track_widget_stats_container"
|
||||
android:layout_weight="3"
|
||||
style="@style/TrackWidgetStatsContainer" >
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item1 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x4" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_label"
|
||||
style="@style/TrackWidgetLabel4x4" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_value"
|
||||
style="@style/TrackWidgetValue4x4" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_unit"
|
||||
style="@style/TrackWidgetUnit4x4" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- horizontal separator -->
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetHorizontalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="4"
|
||||
style="@style/TrackWidgetHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item3 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x4" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_label"
|
||||
style="@style/TrackWidgetLabel4x4" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_value"
|
||||
style="@style/TrackWidgetValue4x4" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item3_unit"
|
||||
style="@style/TrackWidgetUnit4x4" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetHorizontalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
<LinearLayout
|
||||
android:layout_weight="38"
|
||||
style="@style/TrackWidgetHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetHorizontalSpacer" />
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetStatsSection" >
|
||||
<!-- item2 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- vertical separator -->
|
||||
<LinearLayout
|
||||
android:baselineAligned="false"
|
||||
style="@style/TrackWidgetVerticalSeparator" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalLine" />
|
||||
<LinearLayout
|
||||
android:layout_weight="2"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
<!-- item4 -->
|
||||
<LinearLayout style="@style/TrackWidgetItemContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_label"
|
||||
style="@style/TrackWidgetLabel4x3" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer4x3" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_value"
|
||||
style="@style/TrackWidgetValue4x3" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item4_unit"
|
||||
style="@style/TrackWidgetUnit4x3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetButtonContainer" >
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_record_track"
|
||||
android:id="@+id/track_widget_record_button"
|
||||
style="@style/TrackWidgetButtonRecord" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_record_status"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:layout_width="0dp"
|
||||
android:singleLine="true"
|
||||
style="@style/TextSmall" />
|
||||
<ImageButton
|
||||
android:contentDescription="@string/icon_stop_recording"
|
||||
android:id="@+id/track_widget_stop_button"
|
||||
style="@style/TrackWidgetButtonStop" />
|
||||
<LinearLayout
|
||||
android:layout_weight="1"
|
||||
style="@style/TrackWidgetVerticalSpacer" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:contentDescription="@string/my_tracks_app_name"
|
||||
style="@style/TrackWidgetLogo4x4" />
|
||||
</RelativeLayout>
|
||||
@@ -1,86 +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.
|
||||
-->
|
||||
<RelativeLayout 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:layout_alignParentTop="true"
|
||||
android:layout_height="100dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingTop="4dp" >
|
||||
<ImageButton
|
||||
android:id="@+id/track_widget_record_button"
|
||||
style="@style/TrackWidgetRecordButton" />
|
||||
<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="4dp"
|
||||
android:paddingRight="4dp" >
|
||||
<LinearLayout
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<!-- item1 -->
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_value"
|
||||
style="@style/TrackWidgetValue" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item1_unit"
|
||||
style="@style/TrackWidgetUnit" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout style="@style/TrackWidgetHorizontalSeparator" />
|
||||
<LinearLayout
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<!-- item2 -->
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_label"
|
||||
style="@style/TrackWidgetLabel" />
|
||||
<LinearLayout style="@style/TrackWidgetValueContainer" >
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_value"
|
||||
style="@style/TrackWidgetValue" />
|
||||
<TextView
|
||||
android:id="@+id/track_widget_item2_unit"
|
||||
style="@style/TrackWidgetUnit" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/track_widget_stop_button"
|
||||
style="@style/TrackWidgetStopButton" />
|
||||
</LinearLayout>
|
||||
<ImageView style="@style/TrackWidgetLogo" />
|
||||
</RelativeLayout>
|
||||
+169
-80
@@ -15,44 +15,44 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The style for the about value -->
|
||||
<!-- about value -->
|
||||
<style name="AboutValue" parent="@style/TextMedium">
|
||||
<item name="android:paddingLeft">48dp</item>
|
||||
</style>
|
||||
<!-- The style for the bottom button -->
|
||||
<!-- bottom button -->
|
||||
<style name="BottomButton" parent="@android:style/Widget.DeviceDefault.Button.Borderless">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
</style>
|
||||
<!-- The style for the bottom button bar -->
|
||||
<!-- bottom button bar -->
|
||||
<style name="BottomButtonBar" parent="@android:style/DeviceDefault.ButtonBar">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:measureWithLargestChild">true</item>
|
||||
</style>
|
||||
<!-- The style for choose upload service check box -->
|
||||
<!-- choose upload service checkbox -->
|
||||
<style name="ChooseUploadServiceCheckBox" parent="@style/TextMedium">
|
||||
<item name="android:layout_gravity">center_vertical</item>
|
||||
<item name="android:layout_marginLeft">8dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:maxLines">5</item>
|
||||
</style>
|
||||
<!-- The style for choose upload service image view -->
|
||||
<!-- choose upload service image view -->
|
||||
<style name="ChooseUploadServiceImageView">
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
</style>
|
||||
<!-- The style for the editing category -->
|
||||
<!-- edit category -->
|
||||
<style name="EditCategory" parent="@style/TextMedium">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:selectAllOnFocus">true</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
<!-- The style for the edit description -->
|
||||
<!-- edit description -->
|
||||
<style name="EditDescription" parent="@style/TextMedium">
|
||||
<item name="android:inputType">textAutoCorrect|textCapSentences|textMultiLine</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
@@ -60,81 +60,69 @@ limitations under the License.
|
||||
<item name="android:selectAllOnFocus">true</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
</style>
|
||||
<!-- The style for the edit label -->
|
||||
<!-- edit label -->
|
||||
<style name="EditLabel" parent="@style/TextMedium">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
</style>
|
||||
<!-- The style for the edit label with icon -->
|
||||
<!-- edit label with icon -->
|
||||
<style name="EditLabel.WithIcon" parent="@style/TextMedium.WithIcon">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
</style>
|
||||
<!-- The style for the edit label with icon and with padding top -->
|
||||
<!-- edit label with icon, width padding top -->
|
||||
<style name="EditLabel.WithIcon.WithPaddingTop">
|
||||
<item name="android:paddingTop">16dp</item>
|
||||
</style>
|
||||
<!-- The style for the edit lable with padding top -->
|
||||
<!-- edit label with padding top -->
|
||||
<style name="EditLabel.WithPaddingTop">
|
||||
<item name="android:paddingTop">16dp</item>
|
||||
</style>
|
||||
<!-- The style for editing marker name -->
|
||||
<!-- edit name marker -->
|
||||
<style name="EditNameMarker" parent="@style/TextMedium.WithIcon">
|
||||
<item name="android:inputType">textAutoCorrect|textCapWords</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:selectAllOnFocus">true</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
<!-- The style for editing track name -->
|
||||
<!-- edit name track -->
|
||||
<style name="EditNameTrack" parent="@style/TextMedium">
|
||||
<item name="android:inputType">textAutoCorrect|textCapWords</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:selectAllOnFocus">true</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
<!-- The style for the help answer -->
|
||||
<!-- help answer -->
|
||||
<style name="HelpAnswer" parent="@style/TextSmall">
|
||||
<item name="android:autoLink">web</item>
|
||||
<item name="android:paddingBottom">8dp</item>
|
||||
</style>
|
||||
<!-- The style for help question -->
|
||||
<!-- help question -->
|
||||
<style name="HelpQuestion" parent="@style/TextMedium">
|
||||
<item name="android:paddingTop">8dp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
<!-- The style for the list empty text view -->
|
||||
<!-- list empty text view -->
|
||||
<style name="ListEmptyTextView" parent="@style/TextLarge">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
</style>
|
||||
<!-- style for the list item stats -->
|
||||
<!-- list item stats -->
|
||||
<style name="ListItemStats" parent="@style/TextSmall">
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:textColor">@android:color/secondary_text_dark</item>
|
||||
</style>
|
||||
<!-- The style for a horizontal linear layout -->
|
||||
<style name="LinearLayoutHorizontal">
|
||||
<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 a vertical linear layout -->
|
||||
<style name="LinearLayoutVertifcal">
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
</style>
|
||||
<!-- The style for the scroll view -->
|
||||
<!-- scroll view -->
|
||||
<style name="ScrollView">
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:scrollbarStyle">outsideInset</item>
|
||||
</style>
|
||||
<!-- The style for the scroll view with bottom buttons -->
|
||||
<!-- scroll view with bottom buttons -->
|
||||
<style name="ScrollView.WithBottomButtons">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
</style>
|
||||
<!-- The style for the sensor state value -->
|
||||
<!-- sensor state value -->
|
||||
<style name="SensorStateValue" parent="@style/TextLarge">
|
||||
<item name="android:background">@android:color/background_light</item>
|
||||
<item name="android:gravity">right</item>
|
||||
@@ -142,17 +130,17 @@ limitations under the License.
|
||||
<item name="android:paddingRight">8dp</item>
|
||||
<item name="android:textColor">@android:color/primary_text_light</item>
|
||||
</style>
|
||||
<!-- The style for the stats label -->
|
||||
<!-- stats label -->
|
||||
<style name="StatsLabel" parent="@style/TextMedium">
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<!-- The style for the stats spacer -->
|
||||
<!-- stats spacer -->
|
||||
<style name="StatsSpacer">
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">8dp</item>
|
||||
</style>
|
||||
<!-- The style for the stats value -->
|
||||
<!-- stats value -->
|
||||
<style name="StatsValue" parent="@style/TextLarge">
|
||||
<item name="android:background">@android:color/background_light</item>
|
||||
<item name="android:gravity">right</item>
|
||||
@@ -161,84 +149,131 @@ limitations under the License.
|
||||
<item name="android:paddingRight">8dp</item>
|
||||
<item name="android:textColor">@android:color/primary_text_light</item>
|
||||
</style>
|
||||
<!-- The style for choose activity text -->
|
||||
<!-- text choose activity -->
|
||||
<style name="TextChooseActivity">
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
<!-- The style for large size text -->
|
||||
<!-- text large -->
|
||||
<style name="TextLarge">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
</style>
|
||||
<!-- The style for large size text with top margin -->
|
||||
<!-- text large with top margin -->
|
||||
<style name="TextLarge.WithTopMargin">
|
||||
<item name="android:layout_marginTop">8dp</item>
|
||||
</style>
|
||||
<!-- The style for medium size text -->
|
||||
<!-- text medium -->
|
||||
<style name="TextMedium">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
<!-- The style for medium size text with an icon on the left -->
|
||||
<!-- text medium with icon -->
|
||||
<style name="TextMedium.WithIcon">
|
||||
<item name="android:drawablePadding">8dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
<!-- The style for small size text -->
|
||||
<style name="TextSmall">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
<!-- The style for micro size text -->
|
||||
<!-- text micro -->
|
||||
<style name="TextMicro">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
<!-- Theme selector -->
|
||||
<!-- text small -->
|
||||
<style name="TextSmall">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
<!-- theme selector -->
|
||||
<style name="ThemeSelector" parent="android:Theme" />
|
||||
<!-- The style for the track controller container -->
|
||||
<!-- track controller container -->
|
||||
<style name="TrackControllerContainer">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
</style>
|
||||
<!-- The style for the track widget button -->
|
||||
<!-- track widget bounding box -->
|
||||
<style name="TrackWidgetBoundingBox">
|
||||
<item name="android:background">@drawable/track_widget_background</item>
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:padding">@dimen/widget_margin</item>
|
||||
</style>
|
||||
<!-- track widget button -->
|
||||
<style name="TrackWidgetButton">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:layout_gravity">center_vertical</item>
|
||||
<item name="android:scaleType">fitXY</item>
|
||||
</style>
|
||||
<!-- The style for the track widget config row -->
|
||||
<!-- track widget button container -->
|
||||
<style name="TrackWidgetButtonContainer">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
</style>
|
||||
<!-- track widget button record -->
|
||||
<style name="TrackWidgetButtonRecord" parent="@style/TrackWidgetButton">
|
||||
<item name="android:layout_height">63dp</item>
|
||||
<item name="android:layout_width">75dp</item>
|
||||
<item name="android:src">@drawable/btn_record</item>
|
||||
</style>
|
||||
<!-- track widget button stop -->
|
||||
<style name="TrackWidgetButtonStop" parent="@style/TrackWidgetButton">
|
||||
<item name="android:layout_height">63dp</item>
|
||||
<item name="android:layout_width">63dp</item>
|
||||
<item name="android:src">@drawable/btn_stop_0</item>
|
||||
</style>
|
||||
<!-- track widget config row -->
|
||||
<style name="TrackWidgetConfigRow">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:paddingTop">16dp</item>
|
||||
<item name="android:paddingBottom">16dp</item>
|
||||
<item name="android:paddingTop">16dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget config spacer -->
|
||||
<!-- track widget config spacer -->
|
||||
<style name="TrackWidgetConfigSpacer">
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_weight">2</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget config spiner -->
|
||||
<!-- track widget config spiner -->
|
||||
<style name="TrackWidgetConfigSpinner">
|
||||
<item name="android:gravity">left</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">9</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget horizontal separator -->
|
||||
<style name="TrackWidgetHorizontalSeparator">
|
||||
<!-- Track widget frame -->
|
||||
<style name="TrackWidgetFrame">
|
||||
<item name="android:layout_alignParentTop">true</item>
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
</style>
|
||||
<!-- track widget horizontal line -->
|
||||
<style name="TrackWidgetHorizontalLine">
|
||||
<item name="android:background">@color/track_widget_line</item>
|
||||
<item name="android:layout_height">1dp</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget item container -->
|
||||
<!-- track widget horizontal spacer -->
|
||||
<style name="TrackWidgetHorizontalSpacer">
|
||||
<item name="android:layout_height">1dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<!-- track widget horizontal separator -->
|
||||
<style name="TrackWidgetHorizontalSeparator">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
<!-- track widget item container -->
|
||||
<style name="TrackWidgetItemContainer">
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
@@ -248,7 +283,22 @@ limitations under the License.
|
||||
<item name="android:paddingBottom">2dp</item>
|
||||
<item name="android:paddingTop">2dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget label -->
|
||||
<!-- track widget item container 4x2 -->
|
||||
<style name="TrackWidgetItemContainer4x2" parent="@style/TrackWidgetItemContainer">
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
</style>
|
||||
<!-- track widget item container 4x3 -->
|
||||
<style name="TrackWidgetItemContainer4x3" parent="@style/TrackWidgetItemContainer">
|
||||
<item name="android:paddingBottom">6dp</item>
|
||||
<item name="android:paddingTop">12dp</item>
|
||||
</style>
|
||||
<!-- track widget item container 4x4 -->
|
||||
<style name="TrackWidgetItemContainer4x4" parent="@style/TrackWidgetItemContainer">
|
||||
<item name="android:paddingBottom">12dp</item>
|
||||
<item name="android:paddingTop">12dp</item>
|
||||
</style>
|
||||
<!-- track widget label -->
|
||||
<style name="TrackWidgetLabel">
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
@@ -259,8 +309,16 @@ limitations under the License.
|
||||
<item name="android:textSize">10dp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
<!-- track widget label 4x3 -->
|
||||
<style name="TrackWidgetLabel4x3" parent="@style/TrackWidgetLabel">
|
||||
<item name="android:textSize">14dp</item>
|
||||
</style>
|
||||
<!-- track widget label 4x4 -->
|
||||
<style name="TrackWidgetLabel4x4" parent="@style/TrackWidgetLabel">
|
||||
<item name="android:textSize">18dp</item>
|
||||
</style>
|
||||
<!-- track widget logo -->
|
||||
<style name="TrackWidgetLogo">
|
||||
<item name="android:contentDescription">@string/my_tracks_app_name</item>
|
||||
<item name="android:layout_alignParentRight">true</item>
|
||||
<item name="android:layout_alignParentTop">true</item>
|
||||
<item name="android:layout_height">24dp</item>
|
||||
@@ -269,21 +327,28 @@ limitations under the License.
|
||||
<item name="android:scaleType">fitXY</item>
|
||||
<item name="android:src">@drawable/my_tracks_icon</item>
|
||||
</style>
|
||||
<!-- The style for the track widget record button -->
|
||||
<style name="TrackWidgetRecordButton" parent="@style/TrackWidgetButton">
|
||||
<item name="android:contentDescription">@string/icon_record_track</item>
|
||||
<item name="android:layout_height">63dp</item>
|
||||
<item name="android:layout_width">75dp</item>
|
||||
<item name="android:src">@drawable/btn_record</item>
|
||||
<!-- track widget logo 4x4 -->
|
||||
<style name="TrackWidgetLogo4x4" parent="@style/TrackWidgetLogo">
|
||||
<item name="android:layout_height">30dp</item>
|
||||
<item name="android:layout_width">30dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget stop button -->
|
||||
<style name="TrackWidgetStopButton" parent="@style/TrackWidgetButton">
|
||||
<item name="android:contentDescription">@string/icon_stop_recording</item>
|
||||
<item name="android:layout_height">63dp</item>
|
||||
<item name="android:layout_width">63dp</item>
|
||||
<item name="android:src">@drawable/btn_stop_0</item>
|
||||
<!-- track widget stats container -->
|
||||
<style name="TrackWidgetStatsContainer">
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:padding">4dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget unit -->
|
||||
<!-- track widget stats section -->
|
||||
<style name="TrackWidgetStatsSection">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
<!-- track widget unit -->
|
||||
<style name="TrackWidgetUnit">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
@@ -292,7 +357,15 @@ limitations under the License.
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:textSize">10dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget value -->
|
||||
<!-- track widget unit 4x3 -->
|
||||
<style name="TrackWidgetUnit4x3" parent="@style/TrackWidgetUnit">
|
||||
<item name="android:textSize">14dp</item>
|
||||
</style>
|
||||
<!-- track widget unit 4x4 -->
|
||||
<style name="TrackWidgetUnit4x4" parent="@style/TrackWidgetUnit">
|
||||
<item name="android:textSize">18dp</item>
|
||||
</style>
|
||||
<!-- track widget value -->
|
||||
<style name="TrackWidgetValue" parent="@style/TextMedium">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">2</item>
|
||||
@@ -301,7 +374,15 @@ limitations under the License.
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
<!-- The style for the track widget value container -->
|
||||
<!-- track widget value 4x3 -->
|
||||
<style name="TrackWidgetValue4x3" parent="@style/TrackWidgetValue">
|
||||
<item name="android:textSize">28sp</item>
|
||||
</style>
|
||||
<!-- track widget value 4x4 -->
|
||||
<style name="TrackWidgetValue4x4" parent="@style/TrackWidgetValue">
|
||||
<item name="android:textSize">36sp</item>
|
||||
</style>
|
||||
<!-- track widget value container -->
|
||||
<style name="TrackWidgetValueContainer">
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
@@ -309,17 +390,25 @@ limitations under the License.
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
<!-- The style for the track widget vertical separator -->
|
||||
<style name="TrackWidgetVerticalSeparator">
|
||||
<!-- track widget value container 4x3 -->
|
||||
<style name="TrackWidgetValueContainer4x3" parent="@style/TrackWidgetValueContainer">
|
||||
<item name="android:layout_marginTop">0dp</item>
|
||||
</style>
|
||||
<!-- track widget vertical line -->
|
||||
<style name="TrackWidgetVerticalLine">
|
||||
<item name="android:background">@color/track_widget_line</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">1dp</item>
|
||||
</style>
|
||||
<!-- The style for the track widget vertical spacer -->
|
||||
<!-- track widget vertical spacer -->
|
||||
<style name="TrackWidgetVerticalSpacer">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_weight">2</item>
|
||||
<item name="android:layout_width">1dp</item>
|
||||
</style>
|
||||
<!-- track widget vertical separator -->
|
||||
<style name="TrackWidgetVerticalSeparator">
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
-->
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:configure="com.google.android.apps.mytracks.widgets.TrackWidgetConfigActivity"
|
||||
android:initialLayout="@layout/track_widget_large"
|
||||
android:initialLayout="@layout/track_widget_4x2"
|
||||
android:minHeight="110dp"
|
||||
android:minResizeHeight="40dp"
|
||||
android:minResizeWidth="250dp"
|
||||
|
||||
@@ -36,7 +36,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.TaskStackBuilder;
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.View;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
@@ -50,9 +50,13 @@ import android.widget.RemoteViews;
|
||||
*/
|
||||
public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
|
||||
private static final int LARGE_HEIGHT = 110;
|
||||
// Array of appwidget id to use large size
|
||||
private static final SparseBooleanArray useLargeSize = new SparseBooleanArray();
|
||||
private static final int TWO_CELLS = 110;
|
||||
private static final int THREE_CELLS = 180;
|
||||
private static final int FOUR_CELLS = 250;
|
||||
|
||||
// Array of appwidget id to height size in cells
|
||||
private static final SparseIntArray HEIGHT_SIZE = new SparseIntArray();
|
||||
private static final int DEFAULT_HEIGHT = 2;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
@@ -70,7 +74,7 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
new ComponentName(context, TrackWidgetProvider.class));
|
||||
for (int appWidgetId : appWidgetIds) {
|
||||
RemoteViews remoteViews = getRemoteViews(
|
||||
context, trackId, useLargeSize.get(appWidgetId, true));
|
||||
context, trackId, HEIGHT_SIZE.get(appWidgetId, DEFAULT_HEIGHT));
|
||||
appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
|
||||
}
|
||||
}
|
||||
@@ -80,10 +84,23 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
@Override
|
||||
public void onAppWidgetOptionsChanged(
|
||||
Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions) {
|
||||
boolean large = newOptions == null
|
||||
|| newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT) >= LARGE_HEIGHT;
|
||||
useLargeSize.put(appWidgetId, large);
|
||||
RemoteViews remoteViews = getRemoteViews(context, -1L, large);
|
||||
int heightSize;
|
||||
if (newOptions == null) {
|
||||
heightSize = 2;
|
||||
} else {
|
||||
int height = newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);
|
||||
if (height >= FOUR_CELLS) {
|
||||
heightSize = 4;
|
||||
} else if (height >= THREE_CELLS) {
|
||||
heightSize = 3;
|
||||
} else if (height >= TWO_CELLS) {
|
||||
heightSize = 2;
|
||||
} else {
|
||||
heightSize = 1;
|
||||
}
|
||||
}
|
||||
HEIGHT_SIZE.put(appWidgetId, heightSize);
|
||||
RemoteViews remoteViews = getRemoteViews(context, -1L, heightSize);
|
||||
appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
|
||||
}
|
||||
|
||||
@@ -96,7 +113,8 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
*/
|
||||
public static void updateAppWidget(
|
||||
Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
|
||||
RemoteViews remoteViews = getRemoteViews(context, -1L, useLargeSize.get(appWidgetId, true));
|
||||
RemoteViews remoteViews = getRemoteViews(
|
||||
context, -1L, HEIGHT_SIZE.get(appWidgetId, DEFAULT_HEIGHT));
|
||||
appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
|
||||
}
|
||||
|
||||
@@ -105,11 +123,28 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
*
|
||||
* @param context the context
|
||||
* @param trackId the track id
|
||||
* @param large true to use the large layout
|
||||
* @param heightSize the layout height size
|
||||
*/
|
||||
private static RemoteViews getRemoteViews(Context context, long trackId, boolean large) {
|
||||
RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
|
||||
large ? R.layout.track_widget_large : R.layout.track_widget_small);
|
||||
private static RemoteViews getRemoteViews(Context context, long trackId, int heightSize) {
|
||||
int layout;
|
||||
switch (heightSize) {
|
||||
case 4:
|
||||
layout = R.layout.track_widget_4x4;
|
||||
break;
|
||||
case 3:
|
||||
layout = R.layout.track_widget_4x3;
|
||||
break;
|
||||
case 2:
|
||||
layout = R.layout.track_widget_4x2;
|
||||
break;
|
||||
case 1:
|
||||
layout = R.layout.track_widget_4x1;
|
||||
break;
|
||||
default:
|
||||
layout = R.layout.track_widget_4x2;
|
||||
break;
|
||||
}
|
||||
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), layout);
|
||||
|
||||
// Get the preferences
|
||||
long recordingTrackId = PreferencesUtils.getLong(context, R.string.recording_track_id_key);
|
||||
@@ -142,7 +177,7 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
|
||||
updateRecordButton(context, remoteViews, isRecording, recordingTrackPaused);
|
||||
updateStopButton(context, remoteViews, isRecording);
|
||||
if (large) {
|
||||
if (heightSize > 1) {
|
||||
int item3 = PreferencesUtils.getInt(
|
||||
context, R.string.track_widget_item3, PreferencesUtils.TRACK_WIDGET_ITEM3_DEFAULT);
|
||||
int item4 = PreferencesUtils.getInt(
|
||||
@@ -214,7 +249,7 @@ public class TrackWidgetProvider extends AppWidgetProvider {
|
||||
TaskStackBuilder taskStackBuilder = TaskStackBuilder.from(context);
|
||||
taskStackBuilder.addNextIntent(intent);
|
||||
PendingIntent pendingIntent = taskStackBuilder.getPendingIntent(0, 0);
|
||||
remoteViews.setOnClickPendingIntent(R.id.track_widget_statistics, pendingIntent);
|
||||
remoteViews.setOnClickPendingIntent(R.id.track_widget_stats_container, pendingIntent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user