0

Have added a Google Sign in and Facebook button as shown below

<com.google.android.gms.common.SignInButton
    android:id="@+id/loginWithGPlusBtn"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintHeight_percent="0.1"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginBottom="8dp"
    android:scaleType="centerCrop"
    app:layout_constraintBottom_toTopOf="@+id/loginWithFacebookBtn"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/raylImage"
    app:srcCompat="@mipmap/ic_gp_login" />

<com.facebook.login.widget.LoginButton
    android:id="@+id/loginWithFacebookBtn"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_marginStart="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginBottom="8dp"
    android:scaleType="centerCrop"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHeight_percent="0.1"
    app:layout_constraintStart_toStartOf="parent" />

Now, although the G+ button shows up properly, with the text in the middle of the box, I have no such luck with FB. I can manually add a fixed padding like this: android:paddingTop="10dp" but this will take away the flexibility of positioning for different sized screens. Tried different settings, but no luck yet. Any ideas ?

Gradle dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:percent:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.facebook.android:facebook-core:[4,5)'
    implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'
user1300830
  • 83
  • 1
  • 10
  • Kindly show desired and current output. as well as xml code with parent layout also. – Rumit Patel Dec 25 '18 at 12:09
  • Maybe you can change with style as what you want https://stackoverflow.com/questions/16314651/customize-android-facebook-login-button][1] – DevEloper Dec 25 '18 at 12:13
  • Uploaded image here: https://drive.google.com/drive/u/0/folders/1giN6agA0rANe4M6hd0-GXYVjTi5mQJza. You will notice that the "Continue with Facebook" appears on top of the Facebook button. – user1300830 Dec 25 '18 at 16:06

0 Answers0