]> git.ktnx.net Git - mobile-ledger.git/commitdiff
update drawer menu with clipart icons and common style
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 25 Nov 2018 06:20:41 +0000 (06:20 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 25 Nov 2018 06:20:41 +0000 (06:20 +0000)
app/build.gradle
app/src/main/res/drawable/ic_assignment_black_24dp.xml [new file with mode: 0644]
app/src/main/res/drawable/ic_exit_to_app_black_24dp.xml [new file with mode: 0644]
app/src/main/res/drawable/ic_home_black_24dp.xml [new file with mode: 0644]
app/src/main/res/drawable/ic_settings_black_24dp.xml [new file with mode: 0644]
app/src/main/res/layout/drawer.xml [new file with mode: 0644]
app/src/main/res/menu/activity_latest_transactions_drawer.xml
app/src/main/res/values/strings.xml
app/src/main/res/values/styles.xml

index 054c76f1e4d569563c324223b5d6c056fa998d0d..3397bcd561f4e6a32a098748d5e9696103905ded 100644 (file)
@@ -16,6 +16,7 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
+    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
 }
 
 dependencies {
diff --git a/app/src/main/res/drawable/ic_assignment_black_24dp.xml b/app/src/main/res/drawable/ic_assignment_black_24dp.xml
new file mode 100644 (file)
index 0000000..2e85575
--- /dev/null
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="#313131"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M19,3h-4.18C14.4,1.84 13.3,1 12,1c-1.3,0 -2.4,0.84 -2.82,2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM12,3c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_exit_to_app_black_24dp.xml b/app/src/main/res/drawable/ic_exit_to_app_black_24dp.xml
new file mode 100644 (file)
index 0000000..5e09879
--- /dev/null
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="#313131"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M10.09,15.59L11.5,17l5,-5 -5,-5 -1.41,1.41L12.67,11H3v2h9.67l-2.58,2.59zM19,3H5c-1.11,0 -2,0.9 -2,2v4h2V5h14v14H5v-4H3v4c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml
new file mode 100644 (file)
index 0000000..8a9ef1d
--- /dev/null
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="#313131"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_settings_black_24dp.xml b/app/src/main/res/drawable/ic_settings_black_24dp.xml
new file mode 100644 (file)
index 0000000..d6f85a3
--- /dev/null
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="#313131"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z" />
+</vector>
diff --git a/app/src/main/res/layout/drawer.xml b/app/src/main/res/layout/drawer.xml
new file mode 100644 (file)
index 0000000..92bac44
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="96dp"
+        android:layout_alignParentEnd="true"
+        android:layout_alignParentBottom="true"
+        android:layout_marginEnd="0dp"
+        android:orientation="vertical">
+
+        <TextView
+            android:id="@+id/textView2"
+            style="@style/nav_button"
+            android:layout_weight="1"
+            android:drawableStart="@drawable/ic_settings_black_24dp"
+            android:text="@string/action_settings" />
+
+        <TextView
+            android:id="@+id/textView3"
+            style="@style/nav_button"
+            android:layout_weight="1"
+            android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
+            android:text="@string/nav_exit_title" />
+
+    </LinearLayout>
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/textView4"
+                style="@style/nav_button"
+                android:drawableStart="@drawable/ic_home_black_24dp"
+                android:text="@string/nav_latest_transactions_title" />
+
+            <TextView
+                android:id="@+id/textView5"
+                style="@style/nav_button"
+                android:drawableStart="@drawable/ic_assignment_black_24dp"
+                android:text="@string/nav_reports_title" />
+        </LinearLayout>
+    </ScrollView>
+
+</RelativeLayout>
index c81ecc5d359076f2b2a130972b48a579ccc0834d..f1f459eeba564638a6e21860228b91f84009786c 100644 (file)
@@ -3,10 +3,12 @@
     xmlns:tools="http://schemas.android.com/tools"
     tools:showIn="navigation_view">
 
-    <group android:checkableBehavior="single">
+    <group
+        android:checkableBehavior="single"
+        android:menuCategory="container">
         <item
             android:id="@+id/nav_latest_transactions"
-            android:icon="@android:drawable/ic_menu_agenda"
+            android:icon="@android:drawable/ic_menu_sort_by_size"
             android:title="@string/nav_latest_transactions_title" />
         <item
             android:id="@+id/nav_reports"
             android:title="@string/nav_reports_title" />
     </group>
 
-    <item android:title="Communicate">
-        <menu>
-            <item
-                android:id="@+id/nav_settings"
-                android:icon="@drawable/ic_menu_manage"
-                android:title="@string/action_settings" />
-            <item
-                android:id="@+id/nav_exit"
-                android:icon="@drawable/ic_menu_send"
-                android:title="@string/nav_exit_title" />
-        </menu>
+    <item
+        android:menuCategory="secondary"
+        android:title="@string/nav_drawer_system_menu"
+        android:titleCondensed="@string/nav_drawer_system_title_condensed">
+        <menu></menu>
     </item>
+    <group android:menuCategory="system">
+        <item
+            android:id="@+id/nav_settings"
+            android:icon="@android:drawable/ic_menu_preferences"
+            android:title="@string/action_settings" />
+        <item
+            android:id="@+id/nav_exit"
+            android:icon="@android:drawable/ic_lock_power_off"
+            android:title="@string/nav_exit_title" />
+    </group>
 
 </menu>
index 5ed7eec259eb7e27009aa9f048f65e8227cf160d..188b6301700197215dbd3534d178f7aa5e7de59e 100644 (file)
@@ -9,4 +9,6 @@
     <string name="nav_latest_transactions_title">Latest transactions</string>
     <string name="nav_reports_title">Reports</string>
     <string name="nav_exit_title">Exit</string>
+    <string name="nav_drawer_system_menu">System</string>
+    <string name="nav_drawer_system_title_condensed">Sys</string>
 </resources>
index 545b9c6d2c45df7938f8ffd5ac2d806dec36f122..2ed9b11029451526ac37408e4589e56f0cc727c5 100644 (file)
 
     <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
 
+    <style name="nav_button">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">48dp</item>
+        <item name="android:clickable">true</item>
+        <item name="android:drawablePadding">32dp</item>
+        <item name="android:focusable">auto</item>
+        <item name="android:gravity">center_vertical|start</item>
+        <item name="android:textAppearance">@style/TextAppearance.AppCompat.Body1</item>
+    </style>
+
 </resources>