I have a Toast that shows up while the user is typing in an EditText widget however it hides under the SoftKeyboard and cannot be seen unless the user hits backbutton to remove the keyboard.
Is there a way to make the Toast show anyways?.
Well overriding that behavior would take some hacking and I think not a preferred solution to take over the placement of the toast. Some phones will toast over the keyboard and others toast above. I hate when they toast over the keyboard as it blocks my typing personally.
However, if you want full control of your toast you can use a custom library like: https://android-arsenal.com/details/1/6209
But I prefer to use Snackbar as it looks nicer, and stays at the bottom for you and can handle a single button if desired.
Related
I have an in app keyboard that tries to behave like a system keyboard. So far it pops up from the bottom using Bottom Sheet, which is great.
However, unlike a system keyboard, it does not push the entire layout up when you select an EditText that might otherwise get hidden. So far all the solutions I saw on StackOverFlow seem to be about Soft/System Keyboard not an in-app implementation like mine.
Here is my activity with 3 Edit Texts
This is what happens if I click on the last Edit Text. It gets covered by the keyboard in blue
This is how I want it to be. Everything getting pushed up.
How can I achieve this?
I try to find a Android snackbar typ of widget that will enter not from top or bottom but from right or left. Further demands is custom message, icon, stacking, dismiss button, callback handlers. The thing is when snackbar is popping up from the bottom it can block keyboard or EditText. The eyecatcher is also more natural if snackbar message come from right and is centered vertically on device screen
btw, Windows 10 have this notifications popping out from the right behaving in general exactly like Android Toast
Another behavior on this snack is that when snackbar(if we now can still call it a snackbar) is that when it pops out from the right it can have a graphical progress bar under message text counting down from like 3 sec or 5 sec or whatever duration was chosen before snackbar pop back and disappear. This is simply in respect for the user who is attacked by the snack, to let him know when snack go away..
Any ide?
You can read answers to similar question here: How can you adjust Android SnackBar to a specific position on screen
I hope you will find helpful advice on how to solve this problem.
I think you want your snackbar to come from right side, If your version is more than lollipop then use Slide function and set the view in slide function it will come from right only
What im wondering is, should i hide "continue" button while EditText is empty? Is there a principle not recommending that? Alternative solution is popping up error dialog warning user to enter text. Thanks.
It would be better to use Text Validator, so that user will click continue, then popup will appear near the text and show what is going wrong with certain field.
It may be similar to something like this:
EditTextValidator
I know this should not be a big challenge but it really drives me insane.
I am developing a simple soft keyboard input method and basically I have added a button to my softkeyboard, by pressing which, a dialog should pop up to prompt user to do some choices.
By far everything is ok about creating and opening the dialog. Since normally a dialog is created and displayed from outside an activity, so a flick solution could be to create a transparent activity which embedded the dialog in it. By doing so, I could easily start a dialog when user click the button on my softkeyboard.
But one tricky problem is: every time user click the button and the dialog (actually a dialog in a transparent activity) displays, it will always make my softkeyboard hide. I just need to start the dialog without any changes to the status of my softkeyboard -- I want my softkeyboard keeps showing when the dialog starts.
Here is a snapshot of Google Keyboard, it has the similar button which display a dialog and the dialog did not hide the keyboard, this is exactly what I want. So please anyone suggest me how to achieve this. Thanks so much.
THey aren't launching an Activity. They're launching a dialog. Which is tricky from an input method because its a service (you have to specify the dialog's window token to make it show) but doable.
I want to show the Android version of a Model Dialog with text input however I think the keyboard will be behind the actual activity since dialogs weren't made to have inputs. Is there any way I can get the keyboard to show in an actual dialog.
I did see this SO question -- however I'd rather not use an Theme.Dialog'ed activity because I feel like an activity would be too heavy for my purposes. How can I show this Model Dialog with the keyboard input in the foreground?
This is what I am talking about:
Who said dialogs aren't made to have inputs?! A dialog can contain anything - text, buttons, progress bars, input fields. Did you try it out? A keyboard resizes your canvas, so there's no "behind"/"front" going on. (Besides, you can always summon the IME on a phone without a QWERTY
keyboard by holding the menu button - even there's a modAl dialog.)
EDIT: If you need proof, just look at the API Demos (App -> Dialog). There's an example for a dialog with text entry. Source code here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.html (DIALOG_TEXT_ENTRY)