Android: how to hide progress bar in facebook login

After click of the Facebook login button, a progress bar appears with transparent background and then the Facebook activity opens.  How to disable/hide the progress circle at start of the facebook login.
I used the facebook sdk gradle version as below
implementation 'com.facebook.android:facebook-login:[4,5)'

and defined the Facebook activity in AndroidManifest.xml as suggested in the article Edit Your Resources and Manifest

 <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"

        android:label="@string/app_name" />

To remove indeterminate progress bar I followed link Android: How to hide progress circle in Facebook login

Define a new custom style in your /res/values/styles.xml as below

    <style name="Translucent" parent="Translucent.Base"/>

    <style name="Translucent.Base" parent="android:Theme.Translucent.NoTitleBar">
        <item name="android:progressBarStyle">@style/InvisibleProgress</item>
    </style>

Add above custom style to Facebook activity deceleration in AndroidManifest.xml
<activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@style/Translucent"
          />
Then try to run the Project
Gives error as below:
Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@style/Translucent) from AndroidManifest.xml:294:13-47
is also present at [com.facebook.android:facebook-common:4.36.0] AndroidManifest.xml:32:13-63 value=(@style/com_facebook_activity_theme).
Suggestion: add 'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:290:9-295:15 to override.


tools:replace="android:theme"




No comments:

Post a Comment

Popular Posts