Android - how to change text on facebook login button

I am trying to change the text on the facebook login button on Android.

I went through several stackoverflow answers, but none of them worked. Is there any way to change it?

I tried the answers in these links: 1 , 2 , 3 .

If I use the com.facebook.login.widget.LoginButton button, I cannot change the text on the button. (I can come in though)

 <com.facebook.login.widget.LoginButton android:id="@+id/fragment_login_fb_login_button" android:layout_width="@dimen/fragment_login_fb_button_width" android:layout_height="@dimen/fragment_login_fb_button_height" android:layout_gravity="center" android:layout_marginTop="@dimen/fragment_login_fb_button_top_margin" android:background="@drawable/fragment_login_fb_login_button_background" android:drawableLeft="@drawable/facebook_icon" android:gravity="center" android:text="@string/label_fragment_login_sign_in_with_facebook" android:textColor="@android:color/white" android:textStyle="bold"/> 

If I use Button , I was able to change the text, but I can not log in.

 <Button android:id="@+id/fragment_login_fb_login_button" android:layout_width="@dimen/fragment_login_fb_button_width" android:layout_height="@dimen/fragment_login_fb_button_height" android:layout_gravity="center" android:layout_marginTop="@dimen/fragment_login_fb_button_top_margin" android:background="@drawable/fragment_login_fb_login_button_background" android:drawableLeft="@drawable/facebook_icon" android:gravity="center" android:text="@string/label_fragment_login_sign_in_with_facebook" android:textColor="@android:color/white" android:textStyle="bold"/> 

I am using android facebook sdk version 4.5.0

+5
source share
3 answers

You can try using the facebook namespace and set the com_facebook_login_text attribute for it

 <com.facebook.login.widget.LoginButton xmlns:facebook="http://schemas.android.com/apk/res-auto" facebook:com_facebook_login_text="YourText"/> 
+35
source

Please check the license agreement and you will see that you are not allowed to modify it. Also, you are not allowed to change the "f". The only thing allowed by the license is to use different standard colors. See 7.3 in fb , and brand assets are allowed

0
source

His trick is not the right method.

  • Create a relative layout.
  • Define your facebook_botton.
  • Also define your custom design button.
  • Overlap them.
 <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="30dp"> <com.facebook.login.widget.LoginButton xmlns:facebook="http://schemas.android.com/apk/res-auto" android:id="@+id/login_button" android:layout_width="300dp" android:layout_height="100dp" android:paddingTop="15dp" android:paddingBottom="15dp" /> <LinearLayout android:id="@+id/llfbSignup" android:layout_width="300dp" android:layout_height="50dp" android:background="@drawable/facebook" android:layout_gravity="center_horizontal" android:orientation="horizontal"> <ImageView android:layout_width="30dp" android:layout_height="30dp" android:src="@drawable/facbk" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp" /> <View android:layout_width="1dp" android:layout_height="match_parent" android:background="@color/fullGray" android:layout_marginLeft="10dp"/> <com.yadav.bookedup.fonts.GoutamBold android:layout_width="240dp" android:layout_height="50dp" android:text="Sign Up via Facebook" android:gravity="center" android:textColor="@color/white" android:textSize="18dp" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp"/> </LinearLayout> </RelativeLayout> 
0
source

All Articles