1

I'm implementing a facebook login in my app and I've tried to modify the button so that it can fit well in my established design. I'm currently trying to modify the text color to black. To do this I've used the following XML snippet :

    android:textColor="#000"

My issue is that this snippet only changes the "continue with facebook" text but not the white facebook logo which then becomes invisible since my background is white. (Cf. screenshot)

app screenshot

I'm looking for a way to fix this issue, statically through XML or programmatically through Java.

Thank you.

EDIT: Suggested duplicate assumes I can act directly on the drawable while the facebook login button is drawable + text combined and unsplittable.

Rayan Hatout
  • 640
  • 5
  • 22
  • 1
    I'm not an android programmer so this advice might not be valid, but have you tried setting `android:background`? – Andrew Fan Aug 03 '18 at 18:00
  • @AndrewFan the background is actually the rounded rectangle (which is a drawable asset) so I can't rely on that to fix my issue. – Rayan Hatout Aug 03 '18 at 18:02
  • 3
    Possible duplicate of [Modifying the color of an android drawable](https://stackoverflow.com/questions/9643603/modifying-the-color-of-an-android-drawable) – Bö macht Blau Aug 03 '18 at 18:20

1 Answers1

1

I've found that it's a lot better to just build a button manually then call the relevant Facebook SDK code on a button click.

//Put this in an on click in your fragment or activity, 
// with the second parameter as the requested permissions
LoginManager.getInstance()
    .logInWithPublishPermissions(this, new LinkedList<String>());