forked from upstream-mirrors/OpenTracks
add landscape view for stats page
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2013 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.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- Distance, calorie, total time, and moving time -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_distance"
|
||||
layout="@layout/stats_large_item" />
|
||||
<include
|
||||
android:id="@+id/stats_calorie"
|
||||
layout="@layout/stats_large_item" />
|
||||
<View
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="1dp"
|
||||
android:visibility="invisible" />
|
||||
<include
|
||||
android:id="@+id/stats_total_time"
|
||||
layout="@layout/stats_large_item" />
|
||||
<include
|
||||
android:id="@+id/stats_moving_time"
|
||||
layout="@layout/stats_large_item" />
|
||||
</LinearLayout>
|
||||
<!-- Horizontal line -->
|
||||
<View style="@style/StatsHorizontalLine" />
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<TableLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp" >
|
||||
<!-- Speed and average speed -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
<include
|
||||
android:id="@+id/stats_average_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
</LinearLayout>
|
||||
<!-- Max speed and average moving speed -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_max_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
<include
|
||||
android:id="@+id/stats_average_moving_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
</LinearLayout>
|
||||
<!-- Latitude and longitude -->
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_coordinate_container"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_latitude"
|
||||
layout="@layout/stats_small_item" />
|
||||
<include
|
||||
android:id="@+id/stats_longitude"
|
||||
layout="@layout/stats_small_item" />
|
||||
</LinearLayout>
|
||||
</TableLayout>
|
||||
<!-- Vertical line -->
|
||||
<View
|
||||
android:background="@color/stats_separator"
|
||||
android:id="@+id/stats_grade_elevation_separator"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="1dp" />
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_grade_elevation_container"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp" >
|
||||
<!-- Grade -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer" >
|
||||
<!-- Grade label -->
|
||||
<TextView
|
||||
android:text="@string/stats_grade"
|
||||
style="@style/StatsSmallLabel" />
|
||||
<TableLayout
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content" >
|
||||
<!-- Grade min -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_min"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Grade max -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_max"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
<!-- Elevation -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer" >
|
||||
<!-- Elevation label -->
|
||||
<TextView
|
||||
android:text="@string/stats_elevation"
|
||||
style="@style/StatsSmallLabel" />
|
||||
<TableLayout
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content" >
|
||||
<!-- Elevation -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation gain -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_gain"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation min -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_min"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation max -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_max"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -19,9 +19,7 @@ limitations under the License.
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp" >
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/stats_content" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -15,67 +15,62 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- Row 1: distance and calorie -->
|
||||
<!-- Distance and calorie -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_distance"
|
||||
layout="@layout/stats_large_item" />
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<include
|
||||
android:id="@+id/stats_calorie"
|
||||
layout="@layout/stats_large_item" />
|
||||
</LinearLayout>
|
||||
<!-- Row 2: total time and moving time -->
|
||||
<!-- Total time and moving time -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_total_time"
|
||||
layout="@layout/stats_large_item" />
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<include
|
||||
android:id="@+id/stats_moving_time"
|
||||
layout="@layout/stats_large_item" />
|
||||
</LinearLayout>
|
||||
<!-- Row 3: horizontal line -->
|
||||
<!-- Horizontal line -->
|
||||
<View style="@style/StatsHorizontalLine" />
|
||||
<!-- Row 3: speed and average speed -->
|
||||
<!-- Speed and average speed -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<include
|
||||
android:id="@+id/stats_average_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
</LinearLayout>
|
||||
<!-- Row 4: max speed and average moving speed -->
|
||||
<!-- Max speed and average moving speed -->
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<include
|
||||
android:id="@+id/stats_max_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<include
|
||||
android:id="@+id/stats_average_moving_speed"
|
||||
layout="@layout/stats_small_item" />
|
||||
</LinearLayout>
|
||||
<!-- Row 5: horizontal line -->
|
||||
<!-- Horizontal line -->
|
||||
<View
|
||||
android:id="@+id/stats_grade_elevation_horizontal_line"
|
||||
android:id="@+id/stats_grade_elevation_separator"
|
||||
style="@style/StatsHorizontalLine" />
|
||||
<!-- Row 5: grade and elevation -->
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_grade_elevation_container"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" >
|
||||
<!-- Grade -->
|
||||
<LinearLayout style="@style/StatsSmallItemContainer" >
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer" >
|
||||
<!-- Grade label -->
|
||||
<TextView
|
||||
android:text="@string/stats_grade"
|
||||
@@ -87,16 +82,15 @@ limitations under the License.
|
||||
<!-- Grade min -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_min"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Grade max -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_max"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<!-- Elevation -->
|
||||
<LinearLayout style="@style/StatsSmallItemContainer" >
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer" >
|
||||
<!-- Elevation label -->
|
||||
<TextView
|
||||
android:text="@string/stats_elevation"
|
||||
@@ -108,27 +102,27 @@ limitations under the License.
|
||||
<!-- Elevation -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation gain -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_gain"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation min -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_min"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation max -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_max"
|
||||
layout="@layout/stats_small_item_1line" />
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- Row 6: horizontal line -->
|
||||
<!-- Horizontal line -->
|
||||
<View
|
||||
android:id="@+id/stats_coordinate_horizontal_line"
|
||||
android:id="@+id/stats_coordinate_separator"
|
||||
style="@style/StatsHorizontalLine" />
|
||||
<!-- Row 6: latitude and longitude -->
|
||||
<!-- Latitude and longitude -->
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_coordinate_container"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -136,7 +130,6 @@ limitations under the License.
|
||||
<include
|
||||
android:id="@+id/stats_latitude"
|
||||
layout="@layout/stats_small_item" />
|
||||
<View style="@style/StatsVerticalSpacer" />
|
||||
<include
|
||||
android:id="@+id/stats_longitude"
|
||||
layout="@layout/stats_small_item" />
|
||||
|
||||
@@ -18,20 +18,22 @@ limitations under the License.
|
||||
<!-- The style for choose activity text -->
|
||||
<style name="StatsSmallLabel" parent="@style/TextSmall">
|
||||
<!-- same as StatsSmallLabel in values/styles.xml except adding textAllCaps -->
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
</style>
|
||||
<style name="StatsLargeLabel" parent="@style/TextSmall">
|
||||
<!-- same as StatsLargeLabel in values/styles.xml except adding textAllCaps -->
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<item name="android:textColor">@color/stats_large_label</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
<style name="TextChooseActivity">
|
||||
</style>
|
||||
<style name="TextChooseActivity">
|
||||
<!-- Same as TextChooseActivity in values/styles.xml except removing textSize and using textAppearance -->
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceListItemSmall</item>
|
||||
</style>
|
||||
|
||||
@@ -132,22 +132,23 @@ limitations under the License.
|
||||
<style name="StatsHorizontalLine">
|
||||
<item name="android:background">@color/stats_separator</item>
|
||||
<item name="android:layout_height">1dp</item>
|
||||
<item name="android:layout_marginLeft">8dp</item>
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
</style>
|
||||
<!-- stats large item container -->
|
||||
<style name="StatsLargeItemContainer">
|
||||
<item name="android:layout_gravity">top</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">10</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:paddingBottom">6dp</item>
|
||||
<item name="android:paddingLeft">8dp</item>
|
||||
<item name="android:paddingRight">8dp</item>
|
||||
<item name="android:paddingTop">6dp</item>
|
||||
</style>
|
||||
<!-- stats large label -->
|
||||
<style name="StatsLargeLabel" parent="@style/TextSmall">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
<item name="android:textColor">@color/stats_large_label</item>
|
||||
@@ -173,12 +174,18 @@ limitations under the License.
|
||||
<style name="StatsScrollView" parent="@style/ScrollView">
|
||||
<item name="android:scrollbarStyle">outsideOverlay</item>
|
||||
</style>
|
||||
<!-- stats small item container -->
|
||||
<!-- stats small group container -->
|
||||
<style name="StatsSmallGroupContainer" parent="@style/StatsLargeItemContainer">
|
||||
<item name="android:layout_gravity">top|center</item>
|
||||
<item name="android:paddingTop">12dp</item>
|
||||
</style>
|
||||
<!-- stats small item container, for placing inside StatsSmallGroupContainer -->
|
||||
<style name="StatsSmallItemContainer" parent="@style/StatsLargeItemContainer">
|
||||
<item name="android:paddingTop">12dp</item>
|
||||
</style>
|
||||
<!-- stats small label -->
|
||||
<style name="StatsSmallLabel" parent="@style/TextSmall">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:layout_gravity">center</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
@@ -199,12 +206,6 @@ limitations under the License.
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
<!-- stats vertical spacer -->
|
||||
<style name="StatsVerticalSpacer">
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
<style name="Text">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
|
||||
Reference in New Issue
Block a user