Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //hello everyone this the code used for creating //webview ProgressBar feel free to use it π
- //note that this code will only work in android
- //instructions : just create linear layout and name it //as pl
- //happy coding
- final android.widget.ProgressBar prog = new android.widget.ProgressBar(this,null, android.R.attr.progressBarStyleHorizontal);
- prog.setPadding(0,0,0,0);
- prog.setIndeterminate(false);
- prog.setFitsSystemWindows(true);
- prog.setProgress(0);
- prog.setScrollBarStyle(android.widget.ProgressBar.SCROLLBARS_OUTSIDE_INSET);
- prog.setMax(100);
- ViewGroup.LayoutParams vlp = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
- prog.setLayoutParams(vlp);
- pl.addView(prog);
- webview1.setWebChromeClient(new WebChromeClient() {
- @Override public void onProgressChanged(WebView view, int newProgress) {
- prog.setProgress(newProgress);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement