Android FAQ
Q:Why specify the language through the API method but it does not take effect?
A:The number of languages that can be configured in different versions is different. Please confirm whether the current version supports the specified language. If your version supports the language, please confirm whether the connected SDK is the latest version obtained from the backend of Geetest and use the local dependency method. The remote dependencies are not supported.
Q:Is it possible to remove or customize the loading bar?
A:Yes, we support it. However, the user experience will be decreased in the poor network environment because there is no loading signal on the page. The custom loading processes are as follows:
Specify the path of the loading resource in setParams.
Map<String, Object> params = new HashMap<>();
params.put("loading", "./loading.gif");
GTCaptcha4Config builder = new GTCaptcha4Config.Builder()
.setParams(params);Turn off sdk loading and implement your custom loading bar
public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
Map<String, Object> params = new HashMap<>();
params.put("loading", ""); //The laoding field passes a null value to close loading bar
params.put("bgColor", "#00000080"); //set the mask of load on the front end, css color value
GTCaptcha4Config config = new GTCaptcha4Config.Builder()
.setParams(params)
.setDialogStyle("demo_dialog_style")//customize the theme of the captcha dialog box, remove the native mask layer and prevent occlusion loading
.build();
gtCaptcha4Client = GTCaptcha4Client.getClient(activity)
.init("your captcha_id", config);
}
public void click() {
showLoading(); // add your custom loading bar
gtCaptcha4Client.addOnSuccessListener(new GTCaptcha4Client.OnSuccessListener {
public void onSuccess(boolean status, String response) {
if (status) {
//TODO turn on the secondary verification
} else {
//TODO user's answer is incorrect
}
}
})
.addOnFailureListener(new GTCaptcha4Client.OnFailureListener {
public void onFailure(String error) {
}
})
.addOnWebViewShowListener(new GTCaptcha4Client.OnWebViewShowListener{
public void onWebViewShow() {
dismissLoading(); // close your custom loading bar
}
})
.verifyWithCaptcha();
}
<style name="demo_dialog_style" parent="android:Theme.Dialog"> |