0

I am using facebook login. I am trying to change the button, but it dont now work: I want to make the height 100dp.

Login Page xml:

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFF">



        <ImageView android:layout_width="fill_parent"
                   android:layout_height="fill_parent"
                   android:src="@drawable/splash_screen"
                   android:scaleType="centerCrop"/>


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:text=""
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/label"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:textColor="#FFF"/>


            <com.gc.materialdesign.views.ButtonFlat
                android:id="@+id/bt_skip_login"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Skip Login"
                android:onClick="autoLogin"
                android:layout_above="@+id/login_button"
                android:layout_centerHorizontal="true"
                android:te

xtColor="#FFF"/>

        <com.facebook.login.widget.LoginButton
            xmlns:fb="http://schemas.android.com/apk/res-auto"
            android:id="@+id/login_button"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:scaleType="centerInside"
            style="@style/FacebookLoginButton"/>
    </RelativeLayout>

</RelativeLayout>

Style :

 <style name="FacebookLoginButton">
        <item name="android:layout_marginTop">10dp</item>
        <item name="android:layout_marginBottom">0dp</item>
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">90dp</item>
    </style>

I want to look like this, but just to fill the width.

enter image description here

I have update my code, Still no change to the login bt

Thiago
  • 12,778
  • 14
  • 93
  • 110

1 Answers1

0

If you want to put custom Facebook button as per your requirement, best option is that you hide the Facebook Login button and Customize the native Android button and put it above the orignal Facebook Login button. Now on click of newly customized button call loginbtn.performClick();. By this way you can change the text of Button also.

Arth Tilva
  • 2,496
  • 22
  • 40