leandroBorgesFerreira / LoadingButtonAndroid

A button to substitute the ProgressDialog
MIT License
1.94k stars 214 forks source link

Can't seem to set text on the button in 2.0.6 #107

Closed aphexcx closed 5 years ago

aphexcx commented 5 years ago

android:text="foo" from XML doesn't work (button shows up blank) and I can't seem to call button.setText either (this method doesn't exist). Kind of a silly question, but how do I make text show up on the button?

leandroBorgesFerreira commented 5 years ago

I just tested and the text seams to work fine in the 2.0.6 version.

Can you provide more details? Could you paste the XML and the code to reproduce the problem?

aphexcx commented 5 years ago

Here you go!

<br.com.simplepass.loadingbutton.customViews.CircularProgressImageButton
        android:id="@+id/btn_pick_up"
        style="@style/pin_details_button_blue"
        android:layout_height="60dp"
        android:layout_marginBottom="14dp"
        android:layout_marginEnd="16dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="24dp"
        android:text="Button Text!"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/card"
        app:spinning_bar_color="@color/white"/>

And here's the style:

<style name="pin_details_button_blue">
        <item name="android:foreground">?selectableItemBackground</item>
        <item name="android:elevation">8dp</item>
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">60dp</item>
        <item name="android:background">#ff1c73ff</item>
        <item name="android:padding">16dp</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:textSize">14sp</item>
        <item name="android:textStyle">bold</item>
    </style>

The result is: screen shot 2019-01-14 at 11 37 20 am

leandroBorgesFerreira commented 5 years ago

Hey, try CircularProgressButton instead of CircularProgressImageButton if you need text instead of images =)

leandroBorgesFerreira commented 5 years ago

I'm closing this issue as it doesn't seam to be a problem with the library. Fell free to reopen it if you think there's still a problem