]> git.ktnx.net Git - mobile-ledger.git/commitdiff
convert the show hidden accounts item to a switch
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 7 Dec 2018 19:06:23 +0000 (19:06 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 7 Dec 2018 19:06:23 +0000 (19:06 +0000)
app/src/main/res/layout/switch_item.xml [new file with mode: 0644]
app/src/main/res/menu/account_summary.xml
app/src/main/res/menu/account_summary_account_menu.xml [new file with mode: 0644]

diff --git a/app/src/main/res/layout/switch_item.xml b/app/src/main/res/layout/switch_item.xml
new file mode 100644 (file)
index 0000000..06b0f24
--- /dev/null
@@ -0,0 +1,10 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <Switch
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true" />
+</RelativeLayout>
index 9c527466dbc3d5ba629eb7d8da848fe62e2d0423..d0d2f137671c1560a14be5bd7ace78e062575aa0 100644 (file)
@@ -10,5 +10,9 @@
         app:showAsAction="ifRoom" />
     <item
         android:id="@+id/menu_acc_summary_show_hidden"
-        android:title="@string/menu_acc_summary_show_hidden_accounts_title" />
+        android:checkable="true"
+        android:checked="false"
+        android:title="@string/menu_acc_summary_show_hidden_accounts_title"
+        app:actionLayout="@layout/switch_item"
+        app:showAsAction="never" />
 </menu>
\ No newline at end of file
diff --git a/app/src/main/res/menu/account_summary_account_menu.xml b/app/src/main/res/menu/account_summary_account_menu.xml
new file mode 100644 (file)
index 0000000..6ff215b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:id="@+id/menu_hide_acc"
+        android:onClick="hideAccountClicked"
+        android:title="@string/menu_hide_acc_title"
+        android:titleCondensed="@string/menu_hide_acc_condensed_title" />
+</menu>
\ No newline at end of file