I am currently trying to make an AlertDialog in Android Studio.
I have the basic gist of making a basic AlertDialog with a few buttons and a message, but I want to add an additional function that shows a 'dial' on the dialog.
The question is, how do I achieve this dial effect?
I am aware that I am able to simply list down a few choices and move on, but if this is not too complicated, then I would prefer this way.
Does anyone know how to do this?
You can use the system time picker dialog.
Official documentation and Guide.
Related
I develop an assistant app with voice commands. In some cases i want the user say or select from disambiguation dialog. Is there any way to select programmatically an item from disambiguation dialog(not custom dialog).
Thanks in advance
The 'disambiguation dialog' is actually what is called a 'Bottom Sheet' and it is a custom view inside of the support and design lib. You can create whatever you want actually.
Here is a medium post on a nice way to do it.
https://medium.com/android-bits/android-bottom-sheet-30284293f066
Here is a android hive post that is also awesome.
https://www.androidhive.info/2017/12/android-working-with-bottom-sheet/
I am re-pharsing my question to avoid negative points. I am aware of web view, dialogs, popups, notifications. if you have some other ideas please let me know.
I am working on a very big android application, in which I have to add some popup kind of thing, which tells the user what we have updated for this version. Kind of like, what bugs are fixed or whats new things are added.
The window have to be populated once or twice and it have to have user interactions, like click on the link, or contact us, or click on the image to go to some page inside the app. Please let me know any good ideas.
You definitively should give a look to the AlertDialog class
http://developer.android.com/reference/android/app/AlertDialog.html
This is basically the class used to display a message and get the ok/cancel/anything answer from the user. But it's customizable and you can make more or less what you want according to which button is pressed by the user.
Hello im noob Android developer and i want to to make something like this image. It happens when i click the auto localization in gmap
http://imgur.com/Kdj5hiB
Do mean a dialog box like this?
It's an alert dialog. And you will find very useful information about it and implementations of it in these documentation :).
Android dialogs
I am trying to find a way to create a pop up box or a message box on Android using Cocos2d-x that pops ups, receives text or number input from user and do something with the input once the user presses a button to continue or proceed.
Is there a way that I can do it in cocos2d-x?
I am using cocos2d-2.0-x-2.0.4
Currently, there is no built-in support for what you are looking for. You have to write your own implementation and for reference you can have a look at JACModalAlert. (However, its a little outdated and you might have to update few segments to make it work in your project).
I'm afraid you need their own encapsulation, or modify the cocos2d CCMessageBox
Easier way is to design a UI using cocosbuilder, and use it as a message box.. Let me know if you want more details on how to achieve this...
First of all, I know this has been asked before: Button in custom Android Toast?.
This is nearly an exact duplicate, but I think that it warrants a new question based on the fact that it's been used in apps, namely Gmail for ICS (it appears when you delete a message).
The linked question says that it's not possible to include a button in a Toast because Toasts cannot be focused. Is this wrong, outdated, or did Gmail find a way around it?
The Gmail undo bar is't a toast, here is how Google did it
http://code.google.com/p/romannurik-code/source/browse/misc/undobar/src/com/example/android/undobar/UndoBarController.java
I guess this answers your question.
What you're referring to is not a Toast but what Google has dubbed a Snackbar. See the Material Design guidelines.
You can find several implementations of this on GitHub. Some also go by the name of UndoBar
Currently, the most extensive, popular, and active one seems to be Snackbar by nispok, which I also happen to be using.
If you want a button in a toast, its better you quit that idea. But you can use dialogs in place of toast. Using dailogs, you will be able to display whatever you want (same function as a toast would do). Also in the dailog, you could set buttons.
Gmail on iOS does provide a toast and it is a much better solution than interrupting the user flow with a dialog.
![Toast style message in Gmail for iOS][1] [1]: http://i.stack.imgur.com/LWClq.jpg
If you use this option, make sure the toast is displayed long enough for the user to tap undo if needed. So 5 seconds as opposed to 2.5-3 seconds in a info-only toast.
The other example cited by CommonsWare is the inline feedback which is shown after a swipe gesture. This is not a toast- but it is also a great way to provide feedback that an action has been performed.
I have extended the UndoBar mentioned by #Hazem (link) and made it more generic so that it can be used for other actions also. You can have a look here.