1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Custom Font on "OK" Button with MsgboxAsync

Discussion in 'Android Questions' started by DawningTruth, Jul 26, 2019.

Tags:
  1. DawningTruth

    DawningTruth Active Member Licensed User

  2. Brandsum

    Brandsum Active Member Licensed User

    Follow this https://www.b4x.com/android/forum/t...-whole-application-without-any-library.99933/

    Then add this to your theme.xml manifest:
    Button style:
    Code:
    <style name="ButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
            <item name=
    "android:textColor">#ff0aaa92</item>
            <item name=
    "android:textSize">14dp</item>
            <item name=
    "android:textStyle">bold</item>
            <item name=
    "android:textAllCaps">true</item>
    </style>
    Title style:
    Code:
    <style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
            <item name=
    "android:textSize">18dp</item>
            <item name=
    "android:textStyle">bold</item>
            <item name=
    "android:textAllCaps">true</item>
            <item name=
    "android:gravity">center_vertical</item>
            <item name=
    "android:fontFamily">@font/CustomFontStyle</item>
            <item name=
    "fontFamily">@font/CustomFontStyle</item>
    </style>
    Alert dialog style:
    Code:
    <style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
            <item name=
    "android:buttonBarNegativeButtonStyle">@style/ButtonStyle</item>
            <item name=
    "android:buttonBarPositiveButtonStyle">@style/ButtonStyle</item>
            <item name=
    "android:buttonBarNeutralButtonStyle">@style/ButtonStyle</item>
            <item name=
    "android:windowTitleStyle">@style/Toolbar.TitleText</item>
            <item name=
    "android:textSize">14dp</item>
            <item name=
    "android:textAllCaps">false</item>
            <item name=
    "android:fontFamily">@font/CustomFontStyle</item>
            <item name=
    "fontFamily">@font/CustomFontStyle</item>
    </style>
    Then add this line to your custom theme,
    Code:
    <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
            ....
            <item name=
    "android:alertDialogTheme">@style/AlertDialogTheme</item>
            ....
    </style>
     
    DonManfred and DawningTruth like this.
  3. DawningTruth

    DawningTruth Active Member Licensed User

    Thx Brandsum :)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    DawningTruth likes this.
  5. DawningTruth

    DawningTruth Active Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice