You can easily to add an icon by TextView with google material icons:
<TextView
...
android:text="@string/gmd_help_outline"
app:fontFamily="@font/google_material"
/>
That's it.
It's quiet lightweight and better performance without JVM reflection.
If you want to do inline text, you can use Resources.getString()
or just using 3rd string template engine such as square/phrase
ref. https://medium.com/square-corner-blog/android-string-formatting-with-phrase-33b7c8707e18
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.yongjhih:google-material-font:-SNAPSHOT'
}
apache-2.0