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

Commit 7660991

Browse files
authored
Update README.md
1 parent 1b5ca60 commit 7660991

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<a name="introduction"></a>
3030
## Introduction
3131
**MaterialNavigationView** library is built upon Google's Material Design library. This API will be useful to create rich, animated, beautiful Navigation View Drawer in Android app easily.
32-
It follows all Material Design Guidelines as stated [here](https://material.io) <br>
32+
It follows all Material Design Guidelines as stated [here](https://material.io). <br>
3333
`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>
3434
So, we can use it as it is.
3535

@@ -52,8 +52,8 @@ dependencies {
5252
}
5353
```
5454
#### Set up Material Theme
55-
Setting Material Theme to app is necessary before implementing Material Navigation View library. To set it up, update [`styles.xml`](app\src\main\res\values\styles.xml) of `values` directory in app.
56-
`colorSecondary` value is important here because this color is applied to menu item of Navigation View.
55+
Setting Material Theme to app is necessary before implementing Material Navigation View library. To set it up, update [`styles.xml`](/app/src/main/res/values/styles.xml) of `values` directory in app.
56+
**`colorSecondary` value is important here because this color is applied to menu item of Navigation View.**
5757
```xml
5858
<resources>
5959
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
@@ -101,8 +101,8 @@ As already mentioned, this class is inherited from `NavigationView`. You can use
101101
New important flag here is.
102102
- `itemStyle` - Points to a style of menu item of Navigation drawer. <br>
103103
There are currently 2 menu styles are defined as below
104-
- `rounded_right`: This flag sets design to menu item of Navigation drawer as **Rounded Corners at right** as you can see below.
105-
![](Images/RoundRightFull.png)
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"/>
106106

107107
Implemented as follows:
108108
```xml
@@ -111,24 +111,27 @@ There are currently 2 menu styles are defined as below
111111
app:itemStyle="rounded_right"/>
112112
```
113113

114-
- `rounded_rectangle`: This flag sets design to menu item of Navigation drawer as **Rounded Rectangular Corners** as you can see below.
115-
![](Images/RoundRectFull.png)
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"/>
116117

117118
Implemented as follows:
118119
```xml
119120
<com.shreyaspatil.material.navigationview.MaterialNavigationView
120121
...
121122
app:itemStyle="rounded_rectangle"/>
122123
```
124+
125+
Thus, we have successfully implemented design styles of Menu items.
123126
<a name="createActivityCode"></a>
124127
### Create Activity Code (Java/Kotlin)
125128
All the programmatic way of implementation of `MaterialNavigationView` is same as `NavigationView`. Just change is the class name only. <br>
126129
Two methods are added in this new class as follows..
127-
- `setItemStyle(int itemStyle)` : This method sets the Item Style of Menu in MaterialNavigationView at runtime. <br>
130+
- ***`setItemStyle(int itemStyle)`*** : This method sets the Item Style of Menu in MaterialNavigationView at runtime.
128131
`itemStyle` should be one of the following constants :
129132
- `MaterialNavigationView.ITEM_STYLE_ROUND_RIGHT`
130133
- `MaterialNavigationView.ITEM_STYLE_ROUND_RECTANGLE`
131-
- `getItemStyle()` : It returns the value of item style of menu.
134+
- ***`getItemStyle()`*** : It returns the value of item style of menu.
132135

133136
Here is a demo of `MaterialNavigationView` in which we will switch item style of NavigationView after selecting menu.
134137

@@ -157,6 +160,7 @@ class MainActivity : AppCompatActivity() {
157160
}
158161

159162
```
163+
Thus, we have implemented `MaterialNavigationView`.
160164

161165
<a name="migrate"></a>
162166
## Migrating from `NavigationView`
@@ -165,7 +169,7 @@ Do following Changes:
165169
- Change in layout file - Just change package of component from `com.google.android.material.navigation.NavigationView` to `com.shreyaspatil.material.navigationview.MaterialNavigationView` wherever you used it.
166170
- Change in Activity Code - Just change `NavigationView` class to `MaterialNavigationView` and import appropriate package.
167171

168-
:confetti_ball: Hurrah! you are done and successfully migrated to `MaterialNavigationView`. Now just run your app and see magic.
172+
:fire: Hurrah! you are done and successfully migrated to `MaterialNavigationView`. Now just *run your app and see magic*.
169173
<a name="credits"></a>
170174

171175
<a name="fastImplementation"></a>
@@ -179,4 +183,4 @@ Then Change just package in layout file and class name in Activity code file and
179183
This library is built using following open-source libraries.
180184
- [Material Components for Android](https://github.com/material-components/material-components-android)
181185

182-
If you like this library, Please start this repo and share with someone who need it. You can contribute if you have any suggestions or ideas to improve it.
186+
If you like this library, Please start this repo and share with someone who need it. You can contribute if you have any suggestions or ideas to improve it.

0 commit comments

Comments
 (0)