Improve stats layout

This commit is contained in:
Jimmy Shih
2013-11-07 16:13:26 -08:00
parent 17428e1e94
commit f4591fa22c
8 changed files with 129 additions and 158 deletions
+46 -55
View File
@@ -15,7 +15,7 @@ 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 speed -->
<!-- Row 1: distance and calorie -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" >
@@ -24,10 +24,10 @@ limitations under the License.
layout="@layout/stats_large_item" />
<View style="@style/StatsVerticalSpacer" />
<include
android:id="@+id/stats_speed"
android:id="@+id/stats_calorie"
layout="@layout/stats_large_item" />
</LinearLayout>
<!-- Row 2: total time and average speed -->
<!-- Row 2: total time and moving time -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" >
@@ -36,32 +36,34 @@ limitations under the License.
layout="@layout/stats_large_item" />
<View style="@style/StatsVerticalSpacer" />
<include
android:id="@+id/stats_average_speed"
android:id="@+id/stats_moving_time"
layout="@layout/stats_large_item" />
</LinearLayout>
<!-- Row 3: horizontal line -->
<View style="@style/StatsHorizontalLine" />
<!-- Row 3: moving time and average moving speed -->
<!-- Row 3: speed and average speed -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" >
<include
android:id="@+id/stats_moving_time"
android:id="@+id/stats_speed"
layout="@layout/stats_small_item" />
<View style="@style/StatsVerticalSpacer" />
<include
android:id="@+id/stats_average_moving_time"
android:id="@+id/stats_average_speed"
layout="@layout/stats_small_item" />
</LinearLayout>
<!-- Row 4: empty and max speed -->
<!-- Row 4: max speed and average moving speed -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" >
<LinearLayout style="@style/StatsSmallItemContainer" />
<View style="@style/StatsVerticalSpacer" />
<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 -->
<View
@@ -78,14 +80,19 @@ limitations under the License.
<TextView
android:text="@string/stats_grade"
style="@style/StatsSmallLabel" />
<!-- Grade min -->
<include
android:id="@+id/stats_grade_min"
layout="@layout/stats_small_item_1line" />
<!-- Grade max -->
<include
android:id="@+id/stats_grade_max"
layout="@layout/stats_small_item_1line" />
<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_item_1line" />
<!-- Grade max -->
<include
android:id="@+id/stats_grade_max"
layout="@layout/stats_small_item_1line" />
</TableLayout>
</LinearLayout>
<View style="@style/StatsVerticalSpacer" />
<!-- Elevation -->
@@ -94,22 +101,27 @@ limitations under the License.
<TextView
android:text="@string/stats_elevation"
style="@style/StatsSmallLabel" />
<!-- Elevation -->
<include
android:id="@+id/stats_elevation"
layout="@layout/stats_small_item_1line" />
<!-- Elevation gain -->
<include
android:id="@+id/stats_elevation_gain"
layout="@layout/stats_small_item_1line" />
<!-- Elevation min -->
<include
android:id="@+id/stats_elevation_min"
layout="@layout/stats_small_item_1line" />
<!-- Elevation max -->
<include
android:id="@+id/stats_elevation_max"
layout="@layout/stats_small_item_1line" />
<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_item_1line" />
<!-- Elevation gain -->
<include
android:id="@+id/stats_elevation_gain"
layout="@layout/stats_small_item_1line" />
<!-- Elevation min -->
<include
android:id="@+id/stats_elevation_min"
layout="@layout/stats_small_item_1line" />
<!-- Elevation max -->
<include
android:id="@+id/stats_elevation_max"
layout="@layout/stats_small_item_1line" />
</TableLayout>
</LinearLayout>
</LinearLayout>
<!-- Row 6: horizontal line -->
@@ -129,25 +141,4 @@ limitations under the License.
android:id="@+id/stats_longitude"
layout="@layout/stats_small_item" />
</LinearLayout>
<!-- Row 7: calorie horizontal line -->
<View
android:id="@+id/stats_calorie_horizontal_line"
style="@style/StatsHorizontalLine" />
<!-- Row 7: calorie -->
<LinearLayout
android:id="@+id/stats_calorie_container"
android:layout_height="wrap_content"
android:layout_width="match_parent" >
<!-- calorie value -->
<include
android:id="@+id/stats_calorie"
layout="@layout/stats_small_item" />
<!-- Setup activity type-->
<Button
android:id="@+id/stats_calorie_setup"
android:layout_gravity="right"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="@string/stats_calorie_setup" />
</LinearLayout>
</merge>
+25 -15
View File
@@ -14,18 +14,28 @@ 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stats_small_1line_id"
style="@style/StatsSmallValueContainer" >
<TextView
android:id="@+id/stats_value"
style="@style/StatsSmallValue" />
<TextView
android:id="@+id/stats_unit"
style="@style/StatsUnit" />
<TextView
android:id="@+id/stats_label"
android:layout_gravity="bottom"
android:paddingLeft="8dp"
style="@style/StatsSmallLabel" />
</LinearLayout>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content" >
<RelativeLayout
android:layout_gravity="right|bottom"
style="@style/StatsSmallValueContainer" >
<TextView
android:id="@+id/stats_value"
android:layout_alignParentBottom="true"
style="@style/StatsSmallValue" />
<TextView
android:id="@+id/stats_unit"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/stats_value"
style="@style/StatsUnit" />
</RelativeLayout>
<LinearLayout
android:layout_gravity="left|bottom"
style="@style/StatsSmallValueContainer" >
<TextView
android:id="@+id/stats_label"
android:paddingLeft="8dp"
style="@style/StatsSmallLabel" />
</LinearLayout>
</TableRow>
+2 -4
View File
@@ -18,16 +18,14 @@ 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">right</item>
<item name="android:layout_gravity">right</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 name="StatsLargeLabel" parent="@style/TextSmall">
<!-- same as StatsLargeLabel in values/styles.xml except adding textAllCaps -->
<item name="android:gravity">right</item>
<item name="android:layout_gravity">right</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>
+3 -5
View File
@@ -149,8 +149,7 @@ limitations under the License.
</style>
<!-- stats large label -->
<style name="StatsLargeLabel" parent="@style/TextSmall">
<item name="android:gravity">right</item>
<item name="android:layout_gravity">right</item>
<item name="android:layout_gravity">center</item>
<item name="android:singleLine">false</item>
<item name="android:textColor">@color/stats_large_label</item>
<item name="android:textStyle">bold</item>
@@ -166,7 +165,7 @@ limitations under the License.
</style>
<!-- stats large value container -->
<style name="StatsLargeValueContainer">
<item name="android:layout_gravity">right</item>
<item name="android:layout_gravity">center</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">-4dp</item>
<item name="android:layout_width">wrap_content</item>
@@ -181,8 +180,7 @@ limitations under the License.
</style>
<!-- stats small label -->
<style name="StatsSmallLabel" parent="@style/TextSmall">
<item name="android:gravity">right</item>
<item name="android:layout_gravity">right</item>
<item name="android:layout_gravity">center</item>
<item name="android:singleLine">false</item>
<item name="android:textStyle">bold</item>
</style>