Android: EditText with progress bar?

I am creating a browser and I have an address bar (like EditText) on top of the WebView. What I would like to do is present a graphical page load on the background of an EditText, as in the iphone browser. Is it possible?

thanks


UPDATE

So far I have tried the ClipDrawable approach. What I did was take a backup file android.R.drawable.editbox_background and create 2 versions - on a white background and blue (to show progress). Then I would create a LayerDrawable as follows:

barDrawable = addressBar.getBackground(); Drawable progress = getResources().getDrawable(R.drawable.editbox_progress); cbarDrawable = new ClipDrawable(progress, Gravity.LEFT, ClipDrawable.HORIZONTAL); cbarDrawable.setLevel(0); layerlist = new LayerDrawable(new Drawable[] { barDrawable, cbarDrawable }); addressBar.setBackgroundDrawable(layerlist); 

and then I will call setLevel as the download progresses. The problem is that there are such strange problems as: the white drawable is too big or it moves to the beginning.

What do you think?

+7
source share
3 answers

Check out this link for overriding the ProgressBar onDraw () method and drawing text over it. That should make you start at least.

+4
source

Perhaps you can do this using 2 images / shapes set as EditText Drawable background and changing their width programmatically

+3
source

Perhaps you can use ClipDrawable as a background for text.

0
source

All Articles