swipe-button icon indicating copy to clipboard operation
swipe-button copied to clipboard

Add font to text

Open DianitaCAH opened this issue 7 years ago • 6 comments

Is there a way to set font style to the text shown on the button??

DianitaCAH avatar Jan 05 '18 14:01 DianitaCAH

Is there any way to set font style to the text shown on the button?? I really need it...please help me

fatemehalizadeh avatar Jan 22 '18 08:01 fatemehalizadeh

I haven't found a way yet

DianitaCAH avatar Jan 22 '18 19:01 DianitaCAH

Just add a style to your SwipeButton:

styles.xml:

<style name="AppTheme.SwipeButton">
    <item name="android:fontFamily">@font/nunito_bold</item>
</style>

your layout:

<com.ebanx.swipebtn.SwipeButton
        android:id="@+id/swipeBTN"
        style="@style/SwipeButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:button_background="@drawable/shape_button"
        ... />

I'm compiling with buildToolsVersion '27.0.3' on Android Studio 3.1.2.

Hope it helps!

romaomb avatar May 12 '18 03:05 romaomb

above method doesnt work. any clue? thanks in advance!

Testator avatar Jun 03 '19 08:06 Testator

Above method wouldn't work as the textview is created dynamically and the style attribute is not linked to it. @Testator as of know there's no method to do it, but u can fork & create a custom attribute and then assign the font to the textview.

nidhinprathap avatar May 12 '20 07:05 nidhinprathap

@Testator You can see the implementation here https://github.com/ebanx/swipe-button/pull/66

nidhinprathap avatar May 12 '20 08:05 nidhinprathap