Skip to content

Commit

Permalink
[FEAT] Add outline/filled menu icons to bottom nav menu
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkrauz committed Sep 28, 2020
1 parent 96d038c commit a96c44b
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 43 deletions.
9 changes: 7 additions & 2 deletions app/src/main/res/menu/bottom_nav_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
<item
android:id="@+id/charactersFragment"
android:title="@string/characters"
android:icon="@drawable/ic_characters_menu" />
android:icon="@drawable/selector_characters_menu" />

<item
android:id="@+id/notesFragment"
android:title="@string/notes"
android:icon="@drawable/ic_notes_menu" />
android:icon="@drawable/selector_notes_menu" />

<item
android:id="@+id/tagsFragment"
android:title="@string/tags"
android:icon="@drawable/selector_tags_menu" />

</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<string name="arcs">Arcs</string>
<string name="characters">Characters</string>
<string name="notes">Notes</string>
<string name="tags">Tags</string>
</resources>
10 changes: 10 additions & 0 deletions common/src/main/res/drawable/ic_characters_selected_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
</vector>
10 changes: 10 additions & 0 deletions common/src/main/res/drawable/ic_notes_selected_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M17,10L7,10v2h10v-2zM19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,8h14v11zM14,14L7,14v2h7v-2z"/>
</vector>
10 changes: 10 additions & 0 deletions common/src/main/res/drawable/ic_tags_selected_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M17.63,5.84C17.27,5.33 16.67,5 16,5L5,5.01C3.9,5.01 3,5.9 3,7v10c0,1.1 0.9,1.99 2,1.99L16,19c0.67,0 1.27,-0.33 1.63,-0.84L22,12l-4.37,-6.16z"/>
</vector>
10 changes: 10 additions & 0 deletions common/src/main/res/drawable/ic_tags_unselected_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M17.63,5.84C17.27,5.33 16.67,5 16,5L5,5.01C3.9,5.01 3,5.9 3,7v10c0,1.1 0.9,1.99 2,1.99L16,19c0.67,0 1.27,-0.33 1.63,-0.84L22,12l-4.37,-6.16zM16,17H5V7h11l3.55,5L16,17z"/>
</vector>
11 changes: 11 additions & 0 deletions common/src/main/res/drawable/selector_characters_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="true"
android:state_selected="true"
android:drawable="@drawable/ic_characters_selected_menu"/>

<item
android:drawable="@drawable/ic_characters_unselected_menu"/>

</selector>
11 changes: 11 additions & 0 deletions common/src/main/res/drawable/selector_notes_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="true"
android:state_selected="true"
android:drawable="@drawable/ic_notes_selected_menu"/>

<item
android:drawable="@drawable/ic_notes_unselected_menu"/>

</selector>
11 changes: 11 additions & 0 deletions common/src/main/res/drawable/selector_tags_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="true"
android:state_selected="true"
android:drawable="@drawable/ic_tags_selected_menu"/>

<item
android:drawable="@drawable/ic_tags_unselected_menu"/>

</selector>
4 changes: 4 additions & 0 deletions common/src/main/res/navigation/app_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
android:id="@+id/notesFragment"
android:name="com.peterkrauz.grimoire.presentation.notes.NotesFragment" />

<fragment
android:id="@+id/tagsFragment"
android:name="com.peterkrauz.grimoire.presentation.tags.TagsFragment" />

</navigation>
1 change: 1 addition & 0 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<string name="arcs_empty_state_msg">It seems you haven\'t\ncreated any Arc.\n\n\nClick the button below\nto add one!</string>
<string name="characters_empty_state_msg">It seems you haven\'t\ncreated any Character.\n\n\nClick the button below\nto add one!</string>
<string name="notes_empty_state_msg">It seems you haven\'t\ncreated any Note.\n\n\nClick the button below\nto add one!</string>
<string name="tags_empty_state_msg">It seems you haven\'t\ncreated any Tag.\n\n\nClick the button below\nto add one!</string>
</resources>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.peterkrauz.grimoire.presentation.tags

import androidx.fragment.app.Fragment

class TagsFragment : Fragment(R.layout.fragment_tags)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions presentation/tags/src/main/res/layout/fragment_tags.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent">

<LinearLayout
android:id="@+id/linearLayoutEmptyState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
app:layout_constraintVertical_bias="0.35"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">

<ImageView
android:layout_width="190dp"
android:layout_height="190dp"
android:src="@drawable/candle" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tags_empty_state_msg"
android:textAppearance="@style/TextAppearance.Grimoire.H2"
android:gravity="center"
android:layout_marginTop="64dp" />

</LinearLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:src="@drawable/ic_add"
android:tint="@color/colorBackground"
android:clickable="true"
android:focusable="true"
app:fabSize="normal"
app:rippleColor="@color/colorBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

This file was deleted.

0 comments on commit a96c44b

Please sign in to comment.