I changed the font in my application to a custom font, but I don't know how to change the font in Android Studio in the design view, where you can drag n drop buttons, textviews, etc.... Any ideas? Because of this I can't position correctly the buttons on my layout, because it's different in emulator, and different in design view. Thanks for help!
If you want to use the custom font in android you have to add that font in assets and use it from there. Use these links 1 & 2 hope this can help
You can't set custom font at design view. you set custom font using only java code.
Related
Im currently developing an app which has a Settings menu. My App uses a dark theme as default theme, and i need to change Title and Summary text color. I also want to use icons like the Android 10 Settings menu:
How can i replicate this menu and with what component?
Is PreferencesMenu a valuable component to do this?
To do this you can use RecyclerView and adapt a designed row.Design the row with a ImageView and two TextViews.Design as you wish for Text colors.In adapter just pass text and drawables as android 10.
You can use SVG drawables.
Set color at layout like this,
android:textColor="#color/colorlightblue"
Well, I'm making one Android app which can display Time and Date in App Widget(in HomeScreen).
I Loaded my Font under Assets -> Fonts.
Even after trying with FontFamily it doesn't work.
I'm sure font family doesn't work in widgets. I don't have any idea about this.
Thanks for your Help :)
Setting fontFamily in a homescreen widget layout file, like this
android:fontFamily="#font/cherry_swash"
does correctly display a custom font in homescreen widget TextViews with Android O and P, but not with earlier versions.
I am trying to create app which provide text formatting (like font style , font size , font color). So I want default fonts provided by android as a list to be shown in drop-down. Selecting font from drop-down will change the Text dynamically.
Can anyone help , how can I achieve this either via XML or programmatically ?
See the image how it must look like
font list is saved in Typeface class as a static field Map<Stirng, Typeface> sSystemFontMap. you just need to get this field. See my answer here.
There are only three system wide fonts in Android SDK.
normal
serif
monospace
More info : click here
I am developing an android application and I strongly need to use Justify text alignment and also I should use custom font for texts. my application is in Persian language.
If I use TextView for showing texts I cant set text alignment to Justify.
If I use WebView and load html to it I cant use font for it (I know that I can set font using html and css but it does not work for some languages like Persian and Arabic , I tested it, only on android 4.4.2 i see my custom font but on other versions of android webview show android default font)
I tried converting font to SVG but nothings changed.
also I searched in github for a custom webview or textview , I fount one custom textView , both font and text alignment was ok but the direction was left to right but i need it be right to left (I tried changing gravity and other things but cant fix problem).
So what is your suggestion ?
Thank you so much for helping.
Regards.
Take a look at this forum.I used this library with the following attrs and everything works perfectly:
ext:documentView_reverse="true"
ext:documentView_textAlignment="justified"
ext:documentView_textFormat="formatted"
Ok my first question is:
Is there a way to change the font on everything in my app? I mean to put for ex the font x.ttf to be the default font for all the buttons,listviews,for everything that is in my app? And if yes,how?
And my second question:
If that is not possible,then please tell me how to change the font on the Tab widget...
Thanks
Still There is no way to change the font for a complete application. All You can do is for Text Views create custom Text View and override the font method. Then you can use the customized text view rather than using the default text view.
This is the way I used the font Helvetica for My app.