简体   繁体   English

Android上的Facebook SDK:我登录时覆盖或隐藏进度对话框

[英]Facebook SDK on Android : override or hide the progress dialog when I log in

I'm using the Facebook SDK 3.0 for Android with the uiHelper and the loginButton. 我正在使用带有uiHelper和loginButton的Facebook SDK 3.0 for Android。 When I press the login button a progress dialog is displayed. 当我按下登录按钮时,会显示一个进度对话框。 Is it possible to custom it or replace it with another dialog ? 可以自定义它还是用另一个对话框替换它? How ? 怎么样 ? I'm pretty sure that's possible, Candy crush do it ... Moreover, I try to log user without the uiHelper but with the traditionnal method : session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback)); 我很确定这是可能的,Candy crush做到了......而且,我尝试在没有uiHelper但使用传统方法的情况下登录用户:session.openForRead(new Session.OpenRequest(this).setCallback(statusCallback)); I've the same issue, I don't understand how this progress dialog is displayed. 我有同样的问题,我不明白这个进度对话框是如何显示的。

Thank you all ! 谢谢你们 !

you can go directly to the Facebook Library project added to your Project , Go inside the code and change it . 您可以直接进入添加到项目中的Facebook库项目,进入代码并更改它。

this is an example from WebDialog Class , i simply removed the show method of the ProgressDialog: 这是WebDialog类的一个例子,我只是删除了ProgressDialog的show方法:

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        Utility.logd(LOG_TAG, "Webview loading URL: " + url);
        super.onPageStarted(view, url, favicon);
        if (!isDetached) {
            //spinner.show();
        }
    }

For facebook-android-sdk-4.4.1 对于facebook-android-sdk-4.4.1

It can be changed in com/facebook/login/loginFragment look for com_facebook_login_activity_progress_bar and set the visibility to GONE like this 它可以在com / facebook / login / loginFragment中更改,查找com_facebook_login_activity_progress_bar,并将可见性设置为GONE,如下所示

R.id.com_facebook_login_activity_progress_bar).setVisibility(View.GONE);

您可以使用此答案隐藏Facebook进程对话框,然后在按下Facebook登录时实现自己的对话框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM