From 1d2d03dfc7506ae23b9a8f47f286fec8187e3d6f Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Sun, 10 Jan 2016 16:48:17 +0100 Subject: [PATCH] Preview layouts with values by using design-time layout attributes. --- .../src/main/res/layout-land/statistics.xml | 37 ++++++++++++++----- studio/app/src/main/res/layout/contrib.xml | 5 ++- .../src/main/res/layout/fragment_about.xml | 4 +- studio/app/src/main/res/layout/map.xml | 28 ++++++++++---- .../src/main/res/layout/section_header.xml | 4 +- .../app/src/main/res/layout/sharedialog.xml | 6 ++- studio/app/src/main/res/layout/statistics.xml | 37 ++++++++++++++----- studio/app/src/main/res/layout/trackitem.xml | 13 +++++-- studio/app/src/main/res/layout/tracklist.xml | 4 +- studio/app/src/main/res/values/strings.xml | 9 ++++- 10 files changed, 110 insertions(+), 37 deletions(-) diff --git a/studio/app/src/main/res/layout-land/statistics.xml b/studio/app/src/main/res/layout-land/statistics.xml index 62743cd8..4e03a64e 100644 --- a/studio/app/src/main/res/layout-land/statistics.xml +++ b/studio/app/src/main/res/layout-land/statistics.xml @@ -1,5 +1,6 @@ @@ -24,7 +25,9 @@ android:paddingRight="10dp" android:text="@string/stat_distance" /> - + - + - + - + - + @@ -86,7 +97,9 @@ android:paddingRight="10dp" android:text="@string/stat_starttime" /> - + - + @@ -127,7 +142,9 @@ android:paddingRight="10dp" android:text="@string/stat_elapsedtime" /> - + - + diff --git a/studio/app/src/main/res/layout/contrib.xml b/studio/app/src/main/res/layout/contrib.xml index 8114d058..540e7de8 100644 --- a/studio/app/src/main/res/layout/contrib.xml +++ b/studio/app/src/main/res/layout/contrib.xml @@ -1,5 +1,6 @@ @@ -8,5 +9,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:autoLink="web|email" - android:linksClickable="true" /> + android:linksClickable="true" + tools:text="@string/dialog_contrib_message" /> + diff --git a/studio/app/src/main/res/layout/fragment_about.xml b/studio/app/src/main/res/layout/fragment_about.xml index c34d3c79..6571fdf6 100644 --- a/studio/app/src/main/res/layout/fragment_about.xml +++ b/studio/app/src/main/res/layout/fragment_about.xml @@ -1,5 +1,6 @@ @@ -9,7 +10,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" - android:layout_weight="0" /> + android:layout_weight="0" + tools:text="Version 1.3.5 build 123"/> @@ -59,7 +60,9 @@ android:layout_marginTop="5dp" android:background="#80aaaaaa" android:textColor="#000000" - android:visibility="invisible" /> + android:visibility="invisible" + tools:text="22km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:text="17 km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:text="13 km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:text="9 km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:text="4 km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:text="0 km/h" + tools:visibility="visible" /> + android:visibility="invisible" + tools:visibility="visible" /> diff --git a/studio/app/src/main/res/layout/section_header.xml b/studio/app/src/main/res/layout/section_header.xml index 8ae79f57..07b053b0 100644 --- a/studio/app/src/main/res/layout/section_header.xml +++ b/studio/app/src/main/res/layout/section_header.xml @@ -1,6 +1,7 @@ \ No newline at end of file + android:textAppearance="?android:attr/textAppearanceMedium" + tools:text="Local" /> \ No newline at end of file diff --git a/studio/app/src/main/res/layout/sharedialog.xml b/studio/app/src/main/res/layout/sharedialog.xml index 152ee19d..378471b6 100644 --- a/studio/app/src/main/res/layout/sharedialog.xml +++ b/studio/app/src/main/res/layout/sharedialog.xml @@ -1,4 +1,5 @@ @@ -71,7 +72,8 @@ android:layout_below="@+id/TextView4" android:clickable="true" android:inputType="textAutoCorrect" - android:singleLine="true" /> + android:singleLine="true" + tools:text="Track 2016-02-29 15:10" /> + tools:text="@string/tweettext" /> @@ -19,7 +20,9 @@ android:paddingRight="15dp" android:text="@string/stat_distance" /> - + - + - + - + - + - + - + - + - + @@ -10,7 +11,8 @@ android:layout_alignParentTop="true" android:paddingLeft="6dip" android:paddingRight="6dip" - android:textAppearance="?android:attr/textAppearanceLarge" /> + android:textAppearance="?android:attr/textAppearanceLarge" + tools:text="Track 2016-02-29 15:10" /> + android:paddingTop="3dip" + tools:text="15:10 February 29, 2016" /> + android:visibility="invisible" + tools:visibility="visible" /> + android:visibility="invisible" + tools:visibility="visible" /> \ No newline at end of file diff --git a/studio/app/src/main/res/layout/tracklist.xml b/studio/app/src/main/res/layout/tracklist.xml index d4a27360..127bc9a6 100644 --- a/studio/app/src/main/res/layout/tracklist.xml +++ b/studio/app/src/main/res/layout/tracklist.xml @@ -1,5 +1,6 @@ @@ -11,7 +12,8 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:choiceMode="singleChoice" - android:drawSelectorOnTop="true" /> + android:drawSelectorOnTop="true" + tools:listitem="@layout/trackitem" /> - + Open GPS Tracker @@ -70,7 +70,12 @@ reason: Incorrect filename reason: Error building XML reason: Error writing to SD card - %1$s: Traveled %2$s with an average speed of %3$s during %4$s #opengpstracker + + %1$s: Traveled + %2$s with an average speed of + %3$s during + %4$s #opengpstracker + Failed reading the XML during import. Failed reading the file during import. At %1$s going %2$s