Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with Firebase Android Button Size

enter image description here

It's working good and everything else is good but the size of Facebook button is not good. I tried to edit it from xml in several ways but button size remains the same Can anyone please Help?

            <EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_password"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/action_sign_in_short"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1" />

            <Button
                android:id="@+id/forgot_password"
                android:layout_marginTop="8dp"
                android:text="@string/forgot_password"
                android:layout_gravity="end"
                android:typeface="normal"
                android:textSize="14sp"
                style="@style/Widget.AppCompat.Button.Borderless"
                android:background="@drawable/tw__transparent"
                android:layout_height="38dp"
                android:layout_width="130dp" />

            <Button
                android:id="@+id/email_sign_in_button"
                style="?android:textAppearanceSmall"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="@string/action_sign_in"
                android:background="@drawable/rounded_corners"
                android:textSize="18sp" />
        </LinearLayout>
        <LinearLayout
            android:id="@+id/facebook_login"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="bottom"
            android:orientation="horizontal">

            <com.facebook.login.widget.LoginButton
                android:id="@+id/facebook_login_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        </LinearLayout>
    </LinearLayout>
</ScrollView>
<ProgressBar
    android:id="@+id/login_progress"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone" />

like image 581
Navjot Kamboj Avatar asked Jul 04 '26 17:07

Navjot Kamboj


1 Answers

        if You can Use Padding Like this so increase size but this in use worst case

        <com.facebook.login.widget.LoginButton
                android:id="@+id/facebook_login_button"
                android:layout_width="match_parent"
                android:paddingTop="10dp"
                android:paddingBottom="10dp"
                android:layout_height="wrap_content"/>

  <!--  in reguler case customise button with xml
    in Drawable  ic_facebook_button-->
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
        <corners android:radius="32dp" />
        <solid android:color="#5476b8" />
        <padding
            android:bottom="5dp"
            android:left="5dp"
            android:right="5dp"
            android:top="5dp" />
    </shape>

//Use in Layout xml
              <Button
                    android:id="@+id/buttonFacebook"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:layout_alignParentBottom="true"
                    android:layout_marginTop="9dp"
                    android:background="@drawable/facebookbutton"
                    android:text="@string/facebook_connect"
                    android:textAllCaps="true"
                    android:drawableLeft="@drawable/ic_facebook"
                    android:textColor="@color/colorWhite"
                    android:textSize="18sp" />
like image 123
vasupujy Avatar answered Jul 07 '26 06:07

vasupujy