How to create material action bar icons in Android Studio

When I right-click on the drop-down folder => Create => Image Attribute => Action Bar and Tabs Icons => Theme I can select only HOLO_LIGHT, HOLO_DARK and CUSTOM. Even when I use custom C # FFFFFF, the icons are a bit transparent.

Android Asset Studio website https://romannurik.imtqy.com/AndroidAssetStudio/icons-generic.html creates icons without transparency, but they are too small

Is there a quick way to create material icons?

+4
source share
1 answer

, tint,

<ImageView
    android:layout_width="16dp"
    android:layout_height="16dp"
    android:src="@drawable/ic_icon_next"
    android:tint="#FFDE2F"
    tools:ignore="ContentDescription" />

, - drawable_icon_next.xml

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
   android:src="@drawable/ic_action_settings"
   android:tint="#FFDE2F"/>

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="#FFDE2F" android:state_checked="true" />
    <item android:color="#FFDE2F" android:state_checked="false" />
</selector>

.

<item android:id="@+id/menu_item_next"
   android:icon="@drawable/drawable_icon_next"
   android:title="Menu title"
   app:showAsAction="always"/>
+1

Source: https://habr.com/ru/post/1684315/


All Articles