Changed colour picker from a single palette dialog to recycler view to gain parity with iOS-version

This commit is contained in:
Deniz Düzgören
2019-10-15 08:29:53 +02:00
parent cad72fb90a
commit 3b239fc22d
20 changed files with 262 additions and 494 deletions
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="oval"
android:thicknessRatio="1.9"
android:useLevel="false">
<solid/>
</shape>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="oval"
android:thicknessRatio="1.9"
android:useLevel="false">
<stroke
android:width="2dp"
android:color="@color/colorHintReversed" />
</shape>
-140
View File
@@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/colorBackground"
android:animateLayoutChanges="true">
<TextView
android:id="@+id/txtWelcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:layout_marginStart="16dp"
android:text="@string/hello"
android:textAlignment="viewStart"
android:textColor="@color/colorAccent"
android:fontFamily="@font/manrope_extrabold"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView android:id="@+id/loginRequiredText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/login_required"
android:textSize="14sp"
android:textColor="@color/colorText"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/txtWelcome"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/usernameTextLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:hint="@string/username"
android:importantForAutofill="no"
android:textColorHint="@color/colorHint"
app:boxStrokeColor="@color/colorAccent"
app:boxStrokeWidth="1dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginRequiredText">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/usernameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:animateLayoutChanges="true"
android:ems="10"
android:gravity="start"
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions"
android:singleLine="true"
android:textColor="@color/colorText"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passwordTextLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxStrokeColor="@color/colorAccent"
app:boxStrokeWidth="1dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:hint="@string/password"
android:textColorHint="@color/colorHint"
android:importantForAutofill="no"
app:layout_constraintTop_toBottomOf="@+id/usernameTextLayout"
app:layout_constraintStart_toStartOf="@+id/usernameTextLayout"
app:layout_constraintEnd_toEndOf="@+id/usernameTextLayout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/passwordText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:animateLayoutChanges="true"
android:ems="10"
android:gravity="start"
android:imeOptions="flagNoExtractUi"
android:inputType="textPassword"
android:singleLine="true"
android:textColor="@color/colorText"
android:textSize="16sp"/>
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/temporary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="substitution plan"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/loginFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:backgroundTint="@color/colorAccent"
android:text="@string/login"
android:textColor="@color/colorBackground"
app:icon="@drawable/ic_tick"
app:iconTint="@color/colorBackground"
android:layout_gravity="bottom|end"
android:translationZ="-1dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/snackBarLayout"/>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/snackBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:clickable="false"
android:focusable="false"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -1,241 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:scrollbars="vertical"
android:background="@color/colorBackgroundLight">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/def"
android:layout_margin="8dp"
android:layout_weight="1"
app:strokeColor="@color/bgGrey"
app:strokeWidth="2dp"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/red"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgRed"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/orange"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgOrange"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/yellow"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgYellow"
app:cornerRadius="16dp"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/green"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgGreen"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/teal"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgTeal"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/cyan"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgCyan"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/blue"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgBlue"
app:cornerRadius="16dp"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/purple"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgPurple"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/pink"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgPink"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/brown"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgBrown"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/grey"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgGrey"
app:cornerRadius="16dp"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/pureWhite"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgPureWhite"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/salmon"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgSalmon"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/tangerine"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgTangerine"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/banana"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgBanana"
app:cornerRadius="16dp"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/flora"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgFlora"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/spindrift"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgSpindrift"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/sky"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgSky"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/orchid"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgOrchid"
app:cornerRadius="16dp"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/lavender"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgLavender"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/carnation"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgCarnation"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/brown2"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgBrown2"
app:cornerRadius="16dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
android:id="@+id/pureBlack"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/bgPureBlack"
app:cornerRadius="16dp"/>
</TableRow>
</TableLayout>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cardView"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/colorBackgroundLight"
app:cardCornerRadius="8dp"
android:clickable="true"
android:focusable="true"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp">
<ImageView
android:id="@+id/item_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="@+id/item_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/item_text"
android:src="@drawable/circle_border"/>
<TextView
android:id="@+id/item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/colorText"/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
@@ -26,10 +26,9 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:tint="@color/colorText"
app:layout_constraintBottom_toBottomOf="@+id/item_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/item_text" />
app:layout_constraintTop_toTopOf="@+id/item_text"/>
<TextView
android:id="@+id/item_text"
-38
View File
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackgroundLight">
<TextView
android:id="@+id/empty_textviewtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="16dp"
android:textSize="22sp"
android:fontFamily="@font/manrope_semibold"
android:layout_gravity="start"
android:textColor="@color/colorText"
android:textAlignment="viewStart"/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dp">
<LinearLayout
android:id="@+id/empty_linearlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:paddingBottom="0dp"
android:orientation="vertical">
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
+1 -1
View File
@@ -12,4 +12,4 @@
android:layoutAnimation="@anim/layout_animation_fall_down"
android:scrollbars="vertical"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
-1
View File
@@ -52,4 +52,3 @@
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+27
View File
@@ -163,4 +163,31 @@
<string name="error_please_try_again">Ein Fehler ist aufgetreten, bitte versuche es erneut</string>
<string name="thanks_for_using">Danke, dass du die App nutzt!</string>
<string name="congratulations_for_nothing">Gratulation! Du hast nichts erreicht.</string>
<string-array name="colour_names">
<item>Standard</item>
<item>Rot</item>
<item>Orange</item>
<item>Gelb</item>
<item>Grün</item>
<item>Cyan</item>
<item>Hellblau</item>
<item>Blau</item>
<item>Violett</item>
<item>Pink</item>
<item>Braun</item>
<item>Grau</item>
<item>Rot (iOS)</item>
<item>Orange (iOS)</item>
<item>Gelb (iOS)</item>
<item>Grün (iOS)</item>
<item>Cyan (iOS)</item>
<item>Hellblau (iOS)</item>
<item>Blau (iOS)</item>
<item>Violett (iOS)</item>
<item>Pink (iOS)</item>
<item>Braun (iOS)</item>
<item>Weiß</item>
<item>Schwarz</item>
</string-array>
</resources>
+1
View File
@@ -5,6 +5,7 @@
<color name="colorAccent">#64b5f6</color>
<color name="colorText">#e0e0e0</color>
<color name="colorHint">#9e9e9e</color>
<color name="colorHintReversed">#757575</color>
<color name="colorHintLight">#313131</color>
<color name="bgRed">#5B2B2A</color>
+1
View File
@@ -6,6 +6,7 @@
<color name="colorAccent">#448aff</color>
<color name="colorText">#212121</color>
<color name="colorHint">#757575</color>
<color name="colorHintReversed">#9e9e9e</color>
<color name="colorHintLight">#bdbdbd</color>
<color name="legacyBlack">#000000</color>
+28
View File
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AvH Plan</string>
<string name="substitution_plan">Substitution Plan</string>
@@ -175,4 +176,31 @@
<string name="error_please_try_again">An error occurred, please try again</string>
<string name="thanks_for_using">Thanks for using the app!</string>
<string name="congratulations_for_nothing">Congratulations! You have achieved nothing.</string>
<string-array name="colour_names">
<item>Default</item>
<item>Red</item>
<item>Orange</item>
<item>Yellow</item>
<item>Green</item>
<item>Cyan</item>
<item>Light blue</item>
<item>Blue</item>
<item>Purple</item>
<item>Pink</item>
<item>Brown</item>
<item>Grey</item>
<item>Red (iOS)</item>
<item>Orange (iOS)</item>
<item>Yellow (iOS)</item>
<item>Green (iOS)</item>
<item>Cyan (iOS)</item>
<item>Light blue (iOS)</item>
<item>Blue (iOS)</item>
<item>Purple (iOS)</item>
<item>Pink (iOS)</item>
<item>Brown (iOS)</item>
<item>White</item>
<item>Black</item>
</string-array>
</resources>