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 f53c042..d022841 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 41e79a2..758809e 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"