PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, June 29, 2022

[FIXED] How to remove the ProgressBar from Facebook login sdk

 June 29, 2022     android, android-progressbar, facebook-sdk-4.0, progress-bar     No comments   

Issue

By implementing the Facebook Login with android I need to send the token tom my back-end server, so I was wondering if I could remove the Progress bar and create my own progress, dispose after getting the Facebook Token and sending to my server. It appears when I call :

LoginManager.getInstance().logInWithReadPermissions(Login.this,Arrays.asList("email"));

Solution

You can remove the Facebook login ProgressBar like this:

In values/styles.xml add the following style:

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

<style name="InvisibleProgress">
    <item name="android:visibility">gone</item>
</style>

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

In values-v21/styles.xml add the following style:

<style name="Translucent" parent="Translucent.Base">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

Then, in your AndroidManifest.xml override the theme of the FacebookActivity:

<manifest
  ...
  xmlns:tools="http://schemas.android.com/tools"
>

...

<activity
    android:name="com.facebook.FacebookActivity"
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name"
    android:theme="@style/Translucent"
    tools:replace="android:theme"
/>

Now you will not see the Facebook progress bar and you can draw your own :)



Answered By - HedeH
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing