Skip to content

Commit

Permalink
wip redesign maxspeed form
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Jun 22, 2018
1 parent 832246f commit 70c4d27
Show file tree
Hide file tree
Showing 25 changed files with 423 additions and 248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ else if (maxspeed != null)
{
boolean hasName = tags.containsKey("name");

if(hasName) return R.string.quest_maxspeed_name_title;
else return R.string.quest_maxspeed_title_short;
if(hasName) return R.string.quest_maxspeed_name_title2;
else return R.string.quest_maxspeed_title_short2;
}

@NonNull @Override public Countries getEnabledForCountries()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class AddMaxSpeedForm extends AbstractQuestFormAnswerFragment
}
else
{
setStreetSignLayout(R.layout.quest_maxspeed);
setStreetSignLayout(R.layout.quest_maxspeed_sign);
}

addOtherAnswers();
Expand Down
19 changes: 6 additions & 13 deletions app/src/main/res/drawable/background_maxspeed_sign.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@
<solid android:color="#ffffff"/>
</shape>
</item>
<item android:top="0.5dp" android:left="0.5dp" android:bottom="0.5dp" android:right="0.5dp">
<shape android:shape="oval">
<solid android:color="#c1121c"/>
<stroke
android:color="#ffffff"
android:width="1.5dp"/>
</shape>
</item>
<item android:top="16dp" android:left="16dp" android:bottom="16dp" android:right="16dp">
<shape android:shape="oval">
<solid android:color="#ffffff"/>
</shape>
</item>
<item
android:drawable="@drawable/background_maxspeed_sign_no_frame"
android:top="2dp"
android:left="2dp"
android:bottom="2dp"
android:right="2dp"/>
</layer-list>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/background_maxspeed_sign_no_frame.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<solid android:color="#c1121c"/>
</shape>
</item>
<item android:top="12dp" android:left="12dp" android:bottom="12dp" android:right="12dp">
<shape android:shape="oval">
<solid android:color="#ffffff"/>
</shape>
</item>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<item android:top="0dp" android:left="0dp" android:bottom="0dp" android:right="0dp">
<shape android:shape="rectangle">
<solid android:color="#495aad"/>
<stroke
android:color="#666666"
android:width="0.5dp"/>
<corners android:radius="14dp" />
</shape>
</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<item android:top="0dp" android:left="0dp" android:bottom="0dp" android:right="0dp">
<shape android:shape="rectangle">
<solid android:color="#eecc00"/>
<stroke
android:color="#666666"
android:width="0.5dp"/>
<corners android:radius="14dp" />
</shape>
</item>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/drawable/background_roadname.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<shape android:shape="rectangle">
<solid android:color="#495aad"/>
<corners android:radius="12dp" />
<stroke
android:color="#666666"
android:width="0.5dp"/>
</shape>
</item>
<item android:top="2dp" android:left="52dp" android:bottom="2dp" android:right="38dp">
Expand Down
134 changes: 97 additions & 37 deletions app/src/main/res/drawable/ic_slow_zone.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,99 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="112dp"
android:viewportWidth="26.458332"
android:viewportHeight="29.633333">
<path
android:pathData="M3.177,-0.002L23.281,-0.002A3.177,3.177 0,0 1,26.458 3.175L26.458,26.456A3.177,3.177 0,0 1,23.281 29.633L3.177,29.633A3.177,3.177 0,0 1,0 26.456L0,3.175A3.177,3.177 0,0 1,3.177 -0.002z"
android:fillColor="#fff"/>
<path
android:pathData="M3.44,0.794L23.019,0.794A2.646,2.646 0,0 1,25.665 3.44L25.665,26.194A2.646,2.646 0,0 1,23.019 28.84L3.44,28.84A2.646,2.646 0,0 1,0.794 26.194L0.794,3.44A2.646,2.646 0,0 1,3.44 0.794z"
android:fillColor="#000"/>
<path
android:pathData="M3.732,1.86L22.754,1.86A1.866,1.844 0,0 1,24.62 3.704L24.62,25.946A1.866,1.844 0,0 1,22.754 27.79L3.732,27.79A1.866,1.844 0,0 1,1.866 25.946L1.866,3.704A1.866,1.844 0,0 1,3.732 1.86z"
android:fillColor="#fff"/>
<path
android:pathData="m8.694,25.826h1.447v0.588L7.865,26.414v-0.427l1.432,-2.494L7.85,23.494v-0.591h2.264v0.417z"
android:fillColor="#000"/>
<path
android:pathData="m12.997,24.975q0,0.369 -0.092,0.649 -0.092,0.28 -0.258,0.465 -0.164,0.186 -0.398,0.28 -0.232,0.094 -0.514,0.094 -0.282,0 -0.516,-0.094 -0.234,-0.094 -0.403,-0.28 -0.166,-0.186 -0.26,-0.465 -0.092,-0.28 -0.092,-0.649v-0.584q0,-0.379 0.092,-0.666 0.092,-0.289 0.258,-0.482 0.166,-0.193 0.4,-0.289 0.234,-0.099 0.516,-0.099 0.282,0 0.514,0.099 0.234,0.097 0.4,0.289 0.169,0.193 0.26,0.482 0.092,0.287 0.092,0.666zM12.285,24.386q0,-0.251 -0.036,-0.427 -0.036,-0.178 -0.106,-0.292 -0.07,-0.113 -0.174,-0.166 -0.104,-0.053 -0.239,-0.053 -0.137,0 -0.241,0.053 -0.104,0.053 -0.174,0.166 -0.07,0.113 -0.106,0.292 -0.036,0.176 -0.036,0.427v0.588q0,0.239 0.036,0.41 0.036,0.169 0.106,0.277 0.072,0.109 0.176,0.159 0.106,0.051 0.244,0.051 0.135,0 0.236,-0.051 0.104,-0.051 0.174,-0.159 0.07,-0.109 0.104,-0.277 0.036,-0.171 0.036,-0.41z"
android:fillColor="#000"/>
<path
android:pathData="m15.97,26.414h-0.709l-1.037,-2.303v2.303h-0.709v-3.511h0.709l1.039,2.305v-2.305h0.707z"
android:fillColor="#000"/>
<path
android:pathData="m18.348,24.895h-1.104v0.931h1.307v0.588h-2.016v-3.511h2.011v0.591h-1.302v0.83h1.104z"
android:fillColor="#000"/>
<path
android:pathData="M13.229,12.16m-8.996,0a8.996,8.996 0,1 1,17.992 0a8.996,8.996 0,1 1,-17.992 0"
android:fillColor="#c1121c"/>
<path
android:pathData="M7.408,12.171a5.821,5.821 0,1 0,11.642 0a5.821,5.821 0,1 0,-11.642 0z"
android:fillColor="#fff"/>
<path
android:pathData="m10.756,13.452q0,-0.277 0.025,-0.496 0.025,-0.223 0.083,-0.409 0.062,-0.186 0.161,-0.347 0.103,-0.161 0.252,-0.318 0.112,-0.124 0.207,-0.24 0.095,-0.12 0.161,-0.24 0.07,-0.12 0.107,-0.248 0.041,-0.128 0.041,-0.277 0,-0.69 -0.446,-0.69 -0.079,0 -0.161,0.041 -0.083,0.037 -0.153,0.124 -0.066,0.087 -0.112,0.219 -0.041,0.132 -0.045,0.318L9.706,10.889q0.004,-0.434 0.132,-0.752 0.128,-0.318 0.347,-0.525 0.223,-0.207 0.517,-0.306 0.298,-0.103 0.645,-0.103 0.38,0 0.678,0.107 0.302,0.107 0.508,0.314 0.211,0.207 0.322,0.508 0.112,0.302 0.112,0.695 0,0.269 -0.074,0.488 -0.074,0.219 -0.194,0.413 -0.12,0.19 -0.277,0.372 -0.157,0.178 -0.322,0.364 -0.091,0.107 -0.153,0.215 -0.058,0.107 -0.095,0.227 -0.033,0.116 -0.05,0.252 -0.017,0.132 -0.021,0.294zM10.649,14.717q0,-0.136 0.045,-0.252 0.045,-0.116 0.128,-0.198 0.083,-0.087 0.198,-0.136 0.12,-0.05 0.265,-0.05 0.149,0 0.265,0.05 0.12,0.05 0.203,0.136 0.083,0.083 0.128,0.198 0.045,0.116 0.045,0.252 0,0.136 -0.045,0.252 -0.045,0.116 -0.128,0.203 -0.083,0.087 -0.203,0.132 -0.116,0.05 -0.265,0.05 -0.145,0 -0.265,-0.05 -0.116,-0.045 -0.198,-0.132 -0.083,-0.087 -0.128,-0.203 -0.045,-0.116 -0.045,-0.252z"
android:fillColor="#000"/>
<path
android:pathData="m14.543,13.452q0,-0.277 0.025,-0.496 0.025,-0.223 0.083,-0.409 0.062,-0.186 0.161,-0.347 0.103,-0.161 0.252,-0.318 0.112,-0.124 0.207,-0.24 0.095,-0.12 0.161,-0.24 0.07,-0.12 0.107,-0.248 0.041,-0.128 0.041,-0.277 0,-0.69 -0.446,-0.69 -0.079,0 -0.161,0.041 -0.083,0.037 -0.153,0.124 -0.066,0.087 -0.112,0.219 -0.041,0.132 -0.045,0.318h-1.17q0.004,-0.434 0.132,-0.752 0.128,-0.318 0.347,-0.525 0.223,-0.207 0.517,-0.306 0.298,-0.103 0.645,-0.103 0.38,0 0.678,0.107 0.302,0.107 0.508,0.314 0.211,0.207 0.322,0.508 0.112,0.302 0.112,0.695 0,0.269 -0.074,0.488 -0.074,0.219 -0.194,0.413 -0.12,0.19 -0.277,0.372 -0.157,0.178 -0.322,0.364 -0.091,0.107 -0.153,0.215 -0.058,0.107 -0.095,0.227 -0.033,0.116 -0.05,0.252 -0.017,0.132 -0.021,0.294zM14.436,14.717q0,-0.136 0.045,-0.252 0.045,-0.116 0.128,-0.198 0.083,-0.087 0.198,-0.136 0.12,-0.05 0.265,-0.05 0.149,0 0.265,0.05 0.12,0.05 0.203,0.136 0.083,0.083 0.128,0.198 0.045,0.116 0.045,0.252 0,0.136 -0.045,0.252 -0.045,0.116 -0.128,0.203 -0.083,0.087 -0.203,0.132 -0.116,0.05 -0.265,0.05 -0.145,0 -0.265,-0.05 -0.116,-0.045 -0.198,-0.132 -0.083,-0.087 -0.128,-0.203 -0.045,-0.116 -0.045,-0.252z"
android:fillColor="#000"/>
android:width="100dp"
android:height="112dp"
android:viewportWidth="26.458332"
android:viewportHeight="29.633333">
<path
android:pathData="M3.1774,-0.0023L23.281,-0.0023A3.1774,3.1774 0,0 1,26.4583 3.175L26.4583,26.456A3.1774,3.1774 0,0 1,23.281 29.6333L3.1774,29.6333A3.1774,3.1774 0,0 1,0 26.456L0,3.175A3.1774,3.1774 0,0 1,3.1774 -0.0023z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.89958334"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="M3.4396,0.7938L23.0187,0.7938A2.6458,2.6458 0,0 1,25.6646 3.4396L25.6646,26.1938A2.6458,2.6458 0,0 1,23.0187 28.8396L3.4396,28.8396A2.6458,2.6458 0,0 1,0.7937 26.1938L0.7937,3.4396A2.6458,2.6458 0,0 1,3.4396 0.7938z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.89958334"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="M3.7322,1.8604L22.7542,1.8604A1.8661,1.8437 0,0 1,24.6203 3.7042L24.6203,25.9459A1.8661,1.8437 0,0 1,22.7542 27.7896L3.7322,27.7896A1.8661,1.8437 0,0 1,1.8661 25.9459L1.8661,3.7042A1.8661,1.8437 0,0 1,3.7322 1.8604z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.89958334"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m8.6943,25.8259h1.4469v0.5884L7.8648,26.4143v-0.4268l1.4325,-2.4936L7.8503,23.4939v-0.5908h2.2645v0.4172z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="m12.9966,24.9746q0,0.369 -0.0916,0.6487 -0.0916,0.2797 -0.258,0.4654 -0.164,0.1857 -0.3979,0.2797 -0.2315,0.094 -0.5137,0.094 -0.2822,0 -0.5161,-0.094 -0.2339,-0.0941 -0.4027,-0.2797 -0.1664,-0.1857 -0.2604,-0.4654 -0.0916,-0.2797 -0.0916,-0.6487v-0.5836q0,-0.3786 0.0916,-0.6656 0.0916,-0.2894 0.258,-0.4823 0.1664,-0.1929 0.4003,-0.2894 0.2339,-0.0989 0.5161,-0.0989 0.2822,0 0.5137,0.0989 0.2339,0.0965 0.4003,0.2894 0.1688,0.1929 0.2604,0.4823 0.0916,0.287 0.0916,0.6656zM12.2852,24.3862q0,-0.2508 -0.0362,-0.4268 -0.0362,-0.1785 -0.1061,-0.2918 -0.0699,-0.1133 -0.1736,-0.1664 -0.1037,-0.053 -0.2387,-0.053 -0.1375,0 -0.2412,0.053 -0.1037,0.0531 -0.1736,0.1664 -0.0699,0.1133 -0.1061,0.2918 -0.0362,0.176 -0.0362,0.4268v0.5884q0,0.2387 0.0362,0.41 0.0362,0.1688 0.1061,0.2773 0.0724,0.1085 0.176,0.1592 0.1061,0.0506 0.2436,0.0506 0.135,0 0.2363,-0.0506 0.1037,-0.0506 0.1736,-0.1592 0.0699,-0.1085 0.1037,-0.2773 0.0362,-0.1712 0.0362,-0.41z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="m15.97,26.4143h-0.709l-1.037,-2.3031v2.3031h-0.709v-3.5113h0.709l1.0394,2.3055v-2.3055h0.7066z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="m18.3478,24.8951h-1.1045v0.9309h1.3071v0.5884h-2.0161v-3.5113h2.0112v0.5908h-1.3022v0.8296h1.1045z"
android:strokeAlpha="1"
android:strokeLineJoin="miter"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="butt"/>
<path
android:pathData="M13.2292,12.1601m-8.9958,0a8.9958,8.9958 0,1 1,17.9917 0a8.9958,8.9958 0,1 1,-17.9917 0"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.89958334"
android:fillColor="#c1121c"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="M7.4083,12.1708a5.8208,5.8208 0,1 0,11.6417 0a5.8208,5.8208 0,1 0,-11.6417 0z"
android:strokeAlpha="1"
android:strokeLineJoin="round"
android:strokeWidth="0.89958334"
android:fillColor="#ffffff"
android:strokeColor="#00000000"
android:fillAlpha="1"
android:strokeLineCap="round"/>
<path
android:pathData="m8.7137,14.0338 l1.4211,-1.726 -1.4314,-1.7415 0.5839,-0.6356 1.4056,1.7053 1.4056,-1.7053 0.5788,0.6356 -1.4366,1.7415 1.4263,1.726 -0.5839,0.6356 -1.3953,-1.6898 -1.3901,1.6898z"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"/>
<path
android:pathData="m13.6953,14.0338 l1.4211,-1.726 -1.4314,-1.7415 0.5839,-0.6356 1.4056,1.7053 1.4056,-1.7053 0.5788,0.6356 -1.4366,1.7415 1.4263,1.726 -0.5839,0.6356 -1.3953,-1.6898 -1.3901,1.6898z"
android:strokeWidth="0.26458332"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:fillAlpha="1"/>
</vector>
2 changes: 0 additions & 2 deletions app/src/main/res/layout-mcc302/quest_maxspeed.xml

This file was deleted.

2 changes: 2 additions & 0 deletions app/src/main/res/layout-mcc302/quest_maxspeed_sign.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merge><include layout="@layout/quest_maxspeed_sign_ca"/></merge>
16 changes: 16 additions & 0 deletions app/src/main/res/layout-mcc302/quest_maxspeed_zone_sign.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">

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

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_slow_zone_us"/>

</LinearLayout>
2 changes: 0 additions & 2 deletions app/src/main/res/layout-mcc310/quest_maxspeed.xml

This file was deleted.

2 changes: 2 additions & 0 deletions app/src/main/res/layout-mcc310/quest_maxspeed_sign.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merge><include layout="@layout/quest_maxspeed_sign_us"/></merge>
16 changes: 16 additions & 0 deletions app/src/main/res/layout-mcc310/quest_maxspeed_zone_sign.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">

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

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_slow_zone_us"/>

</LinearLayout>
98 changes: 51 additions & 47 deletions app/src/main/res/layout/quest_maxspeed.xml
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools">
android:layout_height="match_parent">
<View
android:id="@+id/strut"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerHorizontal="true"/>

<LinearLayout
android:id="@+id/zoneContainer"
android:layout_width="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/strut"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_alignParentEnd="true"
>
android:orientation="vertical">

<CheckBox
android:id="@+id/zoneCheckbox"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"/>
android:text="@string/quest_maxspeed_sign_question"/>

<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/quest_maxspeed_answer_sign" />

<ImageView
android:id="@+id/zoneImg"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_slow_zone"
/>
<RadioButton
android:id="@+id/zone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/quest_maxspeed_answer_zone" />

<RadioButton
android:id="@+id/no_sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/quest_maxspeed_answer_noSign2" />
</RadioGroup>

</LinearLayout>

<RelativeLayout
android:layout_width="112dp"
android:layout_height="112dp"
android:gravity="center"
android:layout_centerHorizontal="true"
android:background="@drawable/background_maxspeed_sign"
android:padding="16dp"
<FrameLayout
android:layout_toEndOf="@id/strut"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

<EditText
android:id="@+id/maxSpeedInput"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_centerInParent="true"
android:background="#0fff"
android:inputType="number"
android:gravity="center"
android:textStyle="bold"
android:textSize="38dp"
android:maxLength="3"
tools:text="50"/>

<Spinner
android:id="@+id/speedUnitSelect"
<FrameLayout
android:id="@+id/sign_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/maxSpeedInput"
android:layout_centerHorizontal="true"
android:visibility="gone"
android:layout_marginTop="-2dp"
android:background="#0fff"
/>
android:layout_gravity="center"
tools:ignore="UselessParent">

</FrameLayout>

</RelativeLayout>
</FrameLayout>

</RelativeLayout>
</RelativeLayout>
Loading

0 comments on commit 70c4d27

Please sign in to comment.