Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 01f1b91

Browse files
authored
Update README.md
1 parent 1ee5ea5 commit 01f1b91

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

README.md

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Table of Contents:
99
> - [ Introduction ](#introduction)
10+
> - [ Requirements ](#requirements)
1011
> - [ Implementation ](#implementation)
1112
> - [ Prerequisite ](#prerequisite)
1213
> - [ Create `Activity.xml` ](#createActivityXML)
@@ -23,6 +24,12 @@ It follows all Material Design Guidelines as stated [here](https://material.io).
2324
`MaterialNavigationView` class in this library is inherited from [`com.google.android.material.navigation.NavigationView`](https://github.com/material-components/material-components-android/blob/master/docs/components/NavigationView.md) class. Just only difference is added extra design. <br>
2425
So, we can use it as it is.
2526

27+
<a name="requirements"></a>
28+
## Requirements
29+
- AndroidX
30+
- Minimum SDK API 19
31+
- Theme - Material Components
32+
2633
<a name="implementation"></a>
2734
## Implementation
2835
Implementation of Material Navigation View library is so easy. You can check [/app](/app) directory for demo. Let's have look on basic steps of implementation.
@@ -90,37 +97,37 @@ We are creating `activity_main.xml`
9097
As already mentioned, this class is inherited from `NavigationView`. You can use all exisiting flags of that class. <br>
9198
New important flag here is.
9299
- `itemStyle` - Points to a style of menu item of Navigation drawer. <br>
93-
There are currently 2 menu styles are defined as below
94-
- `default_style`: This flag sets default design style to menu item of Navigation drawer as you can see below.<br>
95-
<img src="Images/DefaultStyle.png" height="200"/>
96-
97-
Implemented as follows:
98-
```xml
99-
<com.shreyaspatil.material.navigationview.MaterialNavigationView
100-
...
101-
app:itemStyle="default_style"/>
102-
```
103-
104-
- `rounded_right`: This flag sets design to menu item of Navigation drawer as ***Rounded Corners at right*** as you can see below.<br>
105-
<img src="Images/RoundRightFull.png" height="200"/>
106-
107-
Implemented as follows:
108-
```xml
109-
<com.shreyaspatil.material.navigationview.MaterialNavigationView
110-
...
111-
app:itemStyle="rounded_right"/>
112-
```
113-
114-
- `rounded_rectangle`: This flag sets design to menu item of Navigation drawer as ***Rounded Rectangular Corners*** as you can see below. <br>
115-
116-
<img src="Images/RoundRectFull.png" height="200"/>
117-
118-
Implemented as follows:
119-
```xml
120-
<com.shreyaspatil.material.navigationview.MaterialNavigationView
121-
...
122-
app:itemStyle="rounded_rectangle"/>
123-
```
100+
There are currently 3 menu styles are defined as below
101+
<table style="width:100%">
102+
<tr>
103+
<th>Flag Value</th>
104+
<th>Description</th>
105+
<th>Preview</th>
106+
</tr>
107+
<tr>
108+
<td>default_style</td>
109+
<td>This flag sets design to default style to menu item of Navigation drawer.</td>
110+
<td><img src="Images/DefaultStyle.png"/></td>
111+
</tr>
112+
<tr>
113+
<td>rounded_right</td>
114+
<td>This flag sets design to menu item of Navigation drawer as <b>Rounded Corners at right</b></td>
115+
<td><img src="Images/RoundRightFull.png"/></td>
116+
</tr>
117+
<tr>
118+
<td>rounded_rectangle</td>
119+
<td>This flag sets design to menu item of Navigation drawer as <b>Rounded Rectangular Corners</b></td>
120+
<td><img src="Images/RoundRectFull.png"/></td>
121+
</tr>
122+
</table>
123+
124+
Example as follows:
125+
126+
```xml
127+
<com.shreyaspatil.material.navigationview.MaterialNavigationView
128+
...
129+
app:itemStyle="rounded_right"/>
130+
```
124131
125132
Thus, we have successfully implemented design styles of Menu items.
126133
<a name="createActivityCode"></a>

0 commit comments

Comments
 (0)