box / box/box-android-apptoapp-sdk
BoxAuthentication progress bar
- Dominant language
- Java
- Stars
- 57
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
The current implementation of BoxAuthentication activity gives a bad user experience. A user sees a white screen until the login form is loaded. Show a progress bur during the loading process:
``` java
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mApiKey = getIntent().getStringExtra("API_KEY").trim();
if (mApiKey == null || mApiKey.length() == 0) {
setResult(AUTH_RESULT_FAIL);
finish();
return;
}
FrameLayout layout = new FrameLayout(this);
layout.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mLoginWebView = new WebView(this);
mLoginWebView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mLoginWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
if (progress == 100) {
mLoginWebView.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.GONE);
}
}
});
mLoginWebView.setVisibility(View.INVISIBLE);
layout.addView(mLoginWebView);
mProgressBar = new ProgressBar(this);
mProgressBar.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER));
layout.addView(mProgressBar);
setContentView(layout);
...
}
```
Contributor guide
Research direction
Start in the BoxAuthentication activity, particularly onCreate and the WebView loading callback shown in the issue. Add a visible progress indicator while the login form loads and hide it when loading completes; verify the activity no longer shows a blank white screen before the form appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- authentication, mobile
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100