]> git.ktnx.net Git - mobile-ledger.git/commitdiff
remove the "Cancel" button from the hue selection dialog
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Mar 2019 09:12:22 +0000 (11:12 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 25 Mar 2019 06:17:36 +0000 (06:17 +0000)
it is a common feature to cancel the dialog by tapping outside and
the button only takes valuable space

app/src/main/java/net/ktnx/mobileledger/ui/HueRingDialog.java
app/src/main/res/layout/hue_dialog.xml

index f53c0429c5c31278ffb0661e729c1554eb574c0b..d02284169ff2f97e5580747507aaeb82c436b3a0 100644 (file)
@@ -49,8 +49,6 @@ public class HueRingDialog extends Dialog {
             dismiss();
         });
 
-        findViewById(R.id.btn_cancel).setOnClickListener(v -> dismiss());
-
         findViewById(R.id.btn_default)
                 .setOnClickListener(v -> hueRing.setHue(Colors.DEFAULT_HUE_DEG));
     }
index 41e79a2df23e4928b5de1a451242b0405e3e4947..758809e133e9d4f70dd5ed19d2710d9724b88118 100644 (file)
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/ring">
 
-        <TextView
-            android:id="@+id/btn_cancel"
-            style="@style/Base.TextAppearance.AppCompat.Button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/btn_cancel"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toStartOf="@id/btn_default"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
         <TextView
             android:id="@+id/btn_default"
             style="@style/Base.TextAppearance.AppCompat.Button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:paddingStart="@dimen/fab_margin"
+            android:paddingEnd="@dimen/fab_margin"
             android:text="@string/default_color_btn"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toStartOf="@id/btn_ok"
-            app:layout_constraintStart_toEndOf="@id/btn_cancel"
+            app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
@@ -70,6 +61,8 @@
             style="@style/Base.TextAppearance.AppCompat.Button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:paddingStart="@dimen/fab_margin"
+            android:paddingEnd="@dimen/fab_margin"
             android:text="@string/btn_select_label"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"