WebChromeClient adding a progressbar -android - android

Chrome has a very thin progress bar that runs while a url in loading. Does webview have anything like that as default i can turn it on instead of making my own progress bar ?
similar to what is asked in this question: ProgressBar under Action Bar
But i need the progress bar for a webViewfragment not an activity.

Does webview have anything like that as default i can turn it on instead of making my own progress bar ?
No.
similar to what is asked in this question: ProgressBar under Action Bar But i need the progress bar for a webViewfragment not an activity.
That answer has nothing much to do with an activity. It is referencing the indefinite progress bar offered by the action bar. If you are using the action bar in your app, and your WebViewFragment extends all the way up to the action bar, you are probably best served using the action bar's indefinite progress bar.
If, however, your WebViewFragment is far removed from the action bar, and you want your progress indicator to be closer to the fragment, you will need to use your own ProgressBar widget.

Related

Show Window Progress but not ActionBar Progress (using v7 compat library)

I have seen a few people trying to get an indeterminate progress bar to show and that is kind of the opposite problem than I am having.
What I want is when the app starts to do work the user sees an indeterminate progress bar at the top of the Window. Then goes away when the work is complete.
I am using the app compat v7 library. My Activity extends android.support.v7.app.ActionBarActivity.
The code I have in my Activity.onCreate() is:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.main);
...
}
Then when work starts (in a Fragment, not on the main thread):
((ActionBarActivity) getActivity()).setSupportProgressBarIndeterminateVisibility(true);
Then when work completes:
((ActionBarActivity) getActivity()).setSupportProgressBarIndeterminateVisibility(false);
Two curious behaviors I can't really explain. First, on setSupportProgressBarIndeterminateVisibility(true) Both the Window progress shows (that I want) and the Action Bar's circular progress bar shows.
Second, on setSupportProgressBarIndeterminateVisibility(false) the Window progress hides (hurray) and that's it... the circular progress bar stays visible...
So I don't know why any of the Action Bar's progress stuff happens, nor do I know how to make it stop. If I knew the id of the progress view in the Action Bar I could look that up in the menu and make sure it stays hidden, but I don't know that id (also seems like the wrong way to go about that).
Any help explaining this behavior would be great. Thank you!!
For the first issue:
It's not obvious from the code given, but the calls to setSupportProgressBarIndeterminateVisibility were being called from a background thread. If I move that code to the UI Thread, everything works without UI glitches.
For the second issue:
It does seem that the default behavior should be to show the circular progress bar on the ActionBar. Not entirely sure why the progress on the top of the activity shows as well. You can hide the ActionBar's progress with a style, but I moved away from that before I tested it on older Android platforms.

Android, Progress Bar under ActionBar, and remove circle progress

I am using ActionBarSherlock, and using custom view for the action bar and i want to make progress bar, using this code
requestWindowFeature(Window.FEATURE_PROGRESS);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_main);
setSupportProgressBarIndeterminateVisibility(true);
setProgressBarIndeterminate(true);
but somehow the progress bar is appear above the action bar and also it put a circle progress indication at left most of action bar,
how to put the progress bar under the action bar and remove the circle indicator?
thank you
The reason for the circle, is this line of code.
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
And as for the progressbar this should enable it.
requestWindowFeature(Window.FEATURE_PROGRESS);
As you've already done, what you need now is to alter it.
look here for an example.
For a similar question with a good answer look here.

How to show a webview progress bar at the bottom of the app?

Is there a way to show, only while loading, a webview's progress bar, at the bottom of the app ?
Currently, my progress bar is showed in the title bar. But I don't want it there. I want it at the botton of the app.
Is there a way to do it ?
Thanks!
A solution is to hide the title bar (not necessary but it will save screen space), and add your own progress bar at the bottom of your layout.
But it goes against the normal user interface standards and could be confusing to users so I wouldn't recommend to change the progress bar location.

Progress Bar on Title Bar

I want to draw an spinning wheel on the title bar of the activity when another activity is loading in background. But I don't know how to do that. Please Help me regarding that. Listen I don't want Progress Bar, I want some thing like progress bar on the title bar of the screen, which is running till another activity is loaded or not?...........
I believe the only way to do it is to use your own custom title bar. The best thing to do is to make a title bar layout and just it in all the other layouts and maybe have a helper class to show and hide the progress bar.

Android.....progress bar

How to put ProgressBar between screens in Android?
First call progress bar logic when calling second screen and then load second screen.
Find progress bar examples here

Categories

Resources