I am developing an android app, in which I need a loading screen like the one given below. In this screen I want a custom progress bar and a loading text in the centre of the screen, and the background effect should be blurred. When the loading starts, the user should not be able to perform any action.
How can I create this type of loading screen?
#Ganpat Kaliya
Please check Transparent progress dialog on Android
Just set
setTitle(Loading...);
I would suggest you to use the custom Progress dialog. The purpose of using progress dialog is that as you wanted the screen to be blur, so when ever you would bring Progress dialog to front the activity would get blur , additionally it is highly customize able , you can do what you want.
A very useful explanation is here and here. please check them out and apply.
Related
I looked through forums and SO and find many examples on how to display a dialog with a blurred and dim background which I put in place in my app. The issue I have now is when I want to display a second dialog on top of the previous one but still keeping both on the screen. The effect I would like is to dim and blur the background a second time when the second pop-up shows up. But what it does at the moment is blurring the activity again and not blurring the dialog that is still showing in the background.
So my question would be, is it possible to blur a dialog, when opening another dialog? If yes how could I do this? (Make sure you read the question well... I know how to blur the activity, the question is how to blur the dialog already shown on screen when I open a new dialog on top of it....)
Thanks very much
you can create fullscreen dialog with custom layout which consist from
real dialog content and blurred transparent part outside which would blur and overlay all background views.
Currently, when I am uploading an Image in Android, the entire screen goes blank and the image loads after some time. I would like to change that and make sure that there is just a progress bar inside the ImageView which shows how much of the image upload has been done(Something similar to Whats'app) and then display the image once the upload is done. How do I do that?
Edit:
I do know how to use progress bar, but the problem I face here is that my ImageActivity is a separate activity and I am calling it from a different activity to upload the image. The activity from where I am calling from is the one that should display the progress bar. Thus, not able to do that. Not able to get the progress from the other activity.
try below link for upload the files to show the progress bar!
Upload progress bar in android?
Thanks...!
Hi,
I need to create a UI such that an image view appears at the edge of an alert dialog. Please find below the steps in detail.
I click on a button in activity.
Alert dialog windows should slide from the right to the center.
In the edge of the dialog window, i have an image.
I am done till step 2. I don't know how to place an UI such that half of that appears on the dialog view. Please refer to the image i have provided.
Please provide me with the code samples or pointers for implementing the same. Thanks.
Try using frame layout
A dialog is usually a small window that appears in front of the current Activity. The underlying Activity loses focus and the dialog accepts all user interaction.
So, I doubt if such an effect can be obtained in a dialog.
However, I tried using absolute layout as dialog's content view to create a custom dialog and moved the imageview to an edge by altering the layout parameter. That showed only the portion of the imageview that could fit into the dialog and the rest was not visible.
If I open a progress dialog the current activity visually goes to background (it gets darker). I also want to use this visual feedback (style) if I am working on longer running background tasks but without using a progress dialog. Does anybody know how to do that?
I think if you are doing something time consuming then you should indicate this with an indeterminate dialog (the one with a spinning wheel) along with a message explaining what you are doing. Otherwise the user will be confused about what is going on.
If you absolutely refuse to show the dialog, you could re-create the dark background by having a transparent view that covers the entire activity and then setting its background colour to a translucent black to make what is behind it appear darker.
What's the best way to create a reusable loading screen in Android? The loading screen should have a background image and a loading indicator.
Should I use a separate activity?
The best way is using a separate activity with a SurfaceView that shows the image. Then, you can create an overlay that contains the ProgressBar.
You just could define your own dialog with custom layout. You would handle what happens if your progress screen gets cancelled (pressing back button). You could also prevent it from happening too.
By using an standard dialog you take adavantage of nice efects (background activity darkening with upgrades) and prevents user from interacting with background activity while it is on.