1

I have a navigation drawer. I have changed the text appearance with adding style but how about adding a margin to the icons:

<resources>

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:textViewStyle">@style/IranSansTextViewStyle</item>
</style>
<style name="IranSansTextViewStyle" parent="android:Widget.TextView">
    <item name="android:fontFamily">@font/iransansmobile</item>
    <item name="android:textSize">18sp</item>
    <item name="android:textColor">#FF383838</item>
</style>
</resources>

and my NavigationView:

  <com.google.android.material.navigation.NavigationView
    android:layoutDirection="rtl"
    android:id="@+id/nav_view"
    android:layout_width="@dimen/drawer_width"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:headerLayout="@layout/nav_header_main"
    app:menu="@menu/activity_main_drawer"
    app:itemTextAppearance="@style/IranSansTextViewStyle"
    >
Amirhosein
  • 4,266
  • 4
  • 22
  • 35

1 Answers1

0

You can add this line to the NavigationView:

 android:paddingRight="8dp"

Note: this will pad your icons and text to the right.

private static
  • 745
  • 8
  • 17