JoanZapata / android-iconify

Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...

Home Page:http://joanzapata.com/android-iconify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cut off part of the icon - fa_taxi

ViTVetal opened this issue · comments

layout

<android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:menu="@menu/drawer_view"
        app:headerLayout="@layout/nav_header"/>

drawer_view

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
        <item
            android:id="@+id/cars"
            android:title="@string/cars" />
        <item
            android:id="@+id/history"
            android:title="@string/trips_history" />
</menu>

activity

Menu menu = navigationView.getMenu();

MenuItem carsItem = menu.findItem(R.id.cars);
carsItem.setIcon(new IconDrawable(this, FontAwesomeIcons.fa_taxi)
                .color(ContextCompat.getColor(this, R.color.gray)));

screenshot_2018-10-04-19-53-56-046_com vitvetal_taxi taxidriver