Skip to content

Commit

Permalink
Merge pull request #436 from johnjohndoe/design-time-layout-attributes
Browse files Browse the repository at this point in the history
Preview layouts with values by using design-time layout attributes.
  • Loading branch information
rcgroot committed Jan 11, 2016
2 parents f63e352 + 1d2d03d commit b794614
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 37 deletions.
37 changes: 28 additions & 9 deletions studio/app/src/main/res/layout-land/statistics.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
Expand All @@ -24,7 +25,9 @@
android:paddingRight="10dp"
android:text="@string/stat_distance" />

<TextView android:id="@+id/stat_distance" />
<TextView
android:id="@+id/stat_distance"
tools:text="2.72 km" />
</TableRow>

<TableRow
Expand All @@ -35,7 +38,9 @@
android:paddingRight="10dp"
android:text="@string/stat_overallaveragespeed" />

<TextView android:id="@+id/stat_overallaveragespeed" />
<TextView
android:id="@+id/stat_overallaveragespeed"
tools:text="3.27 km/h" />
</TableRow>

<TableRow
Expand All @@ -46,7 +51,9 @@
android:paddingRight="10dp"
android:text="@string/stat_averagespeed" />

<TextView android:id="@+id/stat_averagespeed" />
<TextView
android:id="@+id/stat_averagespeed"
tools:text="3.27 km/h" />
</TableRow>

<TableRow
Expand All @@ -57,7 +64,9 @@
android:paddingRight="10dp"
android:text="@string/stat_maximumspeed" />

<TextView android:id="@+id/stat_maximumspeed" />
<TextView
android:id="@+id/stat_maximumspeed"
tools:text="22.50 km/h" />
</TableRow>

<TableRow
Expand All @@ -68,7 +77,9 @@
android:paddingRight="10dp"
android:text="@string/stat_waypoints" />

<TextView android:id="@+id/stat_waypoints" />
<TextView
android:id="@+id/stat_waypoints"
tools:text="269" />
</TableRow>
</TableLayout>

Expand All @@ -86,7 +97,9 @@
android:paddingRight="10dp"
android:text="@string/stat_starttime" />

<nl.sogeti.android.gpstracker.util.DateView android:id="@+id/stat_starttime" />
<nl.sogeti.android.gpstracker.util.DateView
android:id="@+id/stat_starttime"
tools:text="15:10 February 29, 2016" />
</TableRow>

<TableRow
Expand All @@ -97,7 +110,9 @@
android:paddingRight="10dp"
android:text="@string/stat_endtime" />

<nl.sogeti.android.gpstracker.util.DateView android:id="@+id/stat_endtime" />
<nl.sogeti.android.gpstracker.util.DateView
android:id="@+id/stat_endtime"
tools:text="16:00 February 29, 2016" />
</TableRow>
<!-- <TableRow -->
<!-- android:layout_width="wrap_content" -->
Expand Down Expand Up @@ -127,7 +142,9 @@
android:paddingRight="10dp"
android:text="@string/stat_elapsedtime" />

<TextView android:id="@+id/stat_elapsedtime" />
<TextView
android:id="@+id/stat_elapsedtime"
tools:text="0h:49m:54s" />
</TableRow>

<TableRow
Expand All @@ -138,7 +155,9 @@
android:paddingRight="10dp"
android:text="@string/stat_ascension" />

<TextView android:id="@+id/stat_ascension" />
<TextView
android:id="@+id/stat_ascension"
tools:text="20 meter" />
</TableRow>

</TableLayout>
Expand Down
5 changes: 4 additions & 1 deletion studio/app/src/main/res/layout/contrib.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

Expand All @@ -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" />

</ScrollView>
4 changes: 3 additions & 1 deletion studio/app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -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"/>

<WebView
android:id="@+id/fragment_about_webview"
Expand Down
28 changes: 21 additions & 7 deletions studio/app/src/main/res/layout/map.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mapScreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
Expand Down Expand Up @@ -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" />

<TextView
android:id="@+id/speedview01"
Expand All @@ -71,7 +74,9 @@
android:layout_marginTop="45dp"
android:background="#80aaaaaa"
android:textColor="#000000"
android:visibility="invisible" />
android:visibility="invisible"
tools:text="17 km/h"
tools:visibility="visible" />

<TextView
android:id="@+id/speedview02"
Expand All @@ -83,7 +88,9 @@
android:layout_marginTop="100dp"
android:background="#80aaaaaa"
android:textColor="#ff000000"
android:visibility="invisible" />
android:visibility="invisible"
tools:text="13 km/h"
tools:visibility="visible" />

<TextView
android:id="@+id/speedview03"
Expand All @@ -95,7 +102,9 @@
android:layout_marginTop="150dp"
android:background="#80aaaaaa"
android:textColor="#ff000000"
android:visibility="invisible" />
android:visibility="invisible"
tools:text="9 km/h"
tools:visibility="visible" />

<TextView
android:id="@+id/speedview04"
Expand All @@ -107,7 +116,9 @@
android:layout_marginTop="200dp"
android:background="#80aaaaaa"
android:textColor="#ff000000"
android:visibility="invisible" />
android:visibility="invisible"
tools:text="4 km/h"
tools:visibility="visible" />

<TextView
android:id="@+id/speedview05"
Expand All @@ -119,7 +130,9 @@
android:layout_marginTop="250dp"
android:background="#80aaaaaa"
android:textColor="#ff000000"
android:visibility="invisible" />
android:visibility="invisible"
tools:text="0 km/h"
tools:visibility="visible" />

<ImageView
android:id="@+id/speedbar"
Expand All @@ -130,7 +143,8 @@
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/speedindexbar"
android:visibility="invisible" />
android:visibility="invisible"
tools:visibility="visible" />

<include layout="@layout/toolbar" />

Expand Down
4 changes: 3 additions & 1 deletion studio/app/src/main/res/layout/section_header.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/listitem_name"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Local" />
6 changes: 4 additions & 2 deletions studio/app/src/main/res/layout/sharedialog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
Expand Down Expand Up @@ -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" />

<ProgressBar
android:id="@+id/tweet_progress"
Expand All @@ -91,7 +93,7 @@
android:inputType="textAutoCorrect"
android:maxLength="140"
android:maxLines="3"
android:text="" />
tools:text="@string/tweettext" />

<ImageView
android:id="@+id/imageView"
Expand Down
37 changes: 28 additions & 9 deletions studio/app/src/main/res/layout/statistics.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -19,7 +20,9 @@
android:paddingRight="15dp"
android:text="@string/stat_distance" />

<TextView android:id="@+id/stat_distance" />
<TextView
android:id="@+id/stat_distance"
tools:text="2.72 km" />
</TableRow>

<TableRow
Expand All @@ -30,7 +33,9 @@
android:paddingRight="15dp"
android:text="@string/stat_overallaveragespeed" />

<TextView android:id="@+id/stat_overallaveragespeed" />
<TextView
android:id="@+id/stat_overallaveragespeed"
tools:text="3.27 km/h" />
</TableRow>

<TableRow
Expand All @@ -41,7 +46,9 @@
android:paddingRight="15dp"
android:text="@string/stat_averagespeed" />

<TextView android:id="@+id/stat_averagespeed" />
<TextView
android:id="@+id/stat_averagespeed"
tools:text="3.27 km/h" />
</TableRow>

<TableRow
Expand All @@ -52,7 +59,9 @@
android:paddingRight="15dp"
android:text="@string/stat_maximumspeed" />

<TextView android:id="@+id/stat_maximumspeed" />
<TextView
android:id="@+id/stat_maximumspeed"
tools:text="22.50 km/h" />
</TableRow>

<TableRow
Expand All @@ -63,7 +72,9 @@
android:paddingRight="15dp"
android:text="@string/stat_waypoints" />

<TextView android:id="@+id/stat_waypoints" />
<TextView
android:id="@+id/stat_waypoints"
tools:text="269" />
</TableRow>

<TableRow
Expand All @@ -74,7 +85,9 @@
android:paddingRight="15dp"
android:text="@string/stat_starttime" />

<nl.sogeti.android.gpstracker.util.DateView android:id="@+id/stat_starttime" />
<nl.sogeti.android.gpstracker.util.DateView
android:id="@+id/stat_starttime"
tools:text="15:10 February 29, 2016" />
</TableRow>

<TableRow
Expand All @@ -85,7 +98,9 @@
android:paddingRight="15dp"
android:text="@string/stat_endtime" />

<nl.sogeti.android.gpstracker.util.DateView android:id="@+id/stat_endtime" />
<nl.sogeti.android.gpstracker.util.DateView
android:id="@+id/stat_endtime"
tools:text="16:00 February 29, 2016" />
</TableRow>

<TableRow
Expand All @@ -96,7 +111,9 @@
android:paddingRight="15dp"
android:text="@string/stat_elapsedtime" />

<TextView android:id="@+id/stat_elapsedtime" />
<TextView
android:id="@+id/stat_elapsedtime"
tools:text="0h:49m:54s" />
</TableRow>

<TableRow
Expand All @@ -107,7 +124,9 @@
android:paddingRight="15dp"
android:text="@string/stat_ascension" />

<TextView android:id="@+id/stat_ascension" />
<TextView
android:id="@+id/stat_ascension"
tools:text="20 meter" />
</TableRow>

<nl.sogeti.android.gpstracker.actions.utils.ViewFlipper
Expand Down
Loading

0 comments on commit b794614

Please sign in to comment.