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
Related
Need help with below case -
Screen has edit text when we enter text display popup dialog and display search result for entered text in background edit text.
Pop-up dialog has title text view and List view which displays search result.
When I enter first letter in edit text, pop-up dialog gets displayed but then background screen which has edit text
becomes non interactive and I am not able to enter any text further in edit text.
Does anyone has solution for this issue? Or do I need to use different approach please suggest.
It is the intended behaviour of a dialog, to block everything in the background, while it is shown (modal dialog), so you probably need to find a different way to achieve what you want.
Have a look at the AutoCompleteTextView, this might be what you want.
https://developer.android.com/reference/android/widget/AutoCompleteTextView
I have a situation where the search box can be anywhere on the screen, once the user select the search box, i want show the Search Suggestion fragment on full screen, i populate the suggestion list as the user types in, on done i want to close the fragment and populate the selected text on the search box, similar to google PlaceAutocompleteFragment. what are the building blocks i need? thank you in advance, this is my first question sorry if there are any formatting issue in my question
Was able to do it by designing transparent screen with EditText on screen. and start activity for results on Parent activity EditText onfocus
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.
What I want
A simple EditText. User should be able to enter text at any point of time.
onClick of this EditText, a popup should appear anchored to the EditText.
onClick of this EditText, if popup is already being shown, then dismiss the popup.
This popup will contain a list of items (that i decide and no filtering) on clicking of which the EditText will be filled with the clicked item.
When I start typing, the popup should go away.
I should be able to set the animation of the drop down list.
What were my options
Obviously, AutoCompleteTextView. Worked great after customizing AutoCompleteTextView. But there were two problems?
I was able to accomplish points 1, 2, 4 and 5. How do I get around this number 3 and number 5?
Since nothing worked...
I thought I can just put a edit text and show a popup window. :)
But that fails utterly...
I just tried to do the simple way. I added a EditText. And then I created a class of PopupWindow and inflated a listview in it. Then I anchored it to my EditText. Now the problem starts again -
I click on the EditText. The popup appears. Takes all the focus and the keyboard goes away. Definitely not what I want. So i made the popup window not focusable.
And now I click on the EditText, the popup appears. Doesn't take the focus. So keyboard stays to take input. Just perfect like I want. But when I click a list item in the ListView, it doesn't do anything. Why? It is not focusable!
So what do i do now? Which way do I go?
For 3. you can create an onFocusChange listener, or and onClickListener and explicitly call _autoCompleteView.dismissDropDown();. You can use isPopupShowing() to see if it is already showing and manually dismiss it in that case.
For 5. you just do the same thing but you do _autoCompleteView.registerDataSetObserver and put that logic in the onChanged() event or possibly in the addTextChangedListeneron your autoCompleteTextView.
I am not entirely sure if this is the functionality you were looking for but this thread is almost a year old now so maybe it will be helpful for someone in the future.
I have an OptionMenu which has single option in it named "Search". When the search option is clicked, it should dynamically add a EditText at the top of Activity window like it has in WebView (browser address bar) so users could search something in my application.
After there would be EditBox, one can write inside it. I also want to have some OnTextChanged like event of that EditBox so do you think it's also available with that View?
I made it myself. I added an EditText on the screen with setting as hidden and on button click made it visible. It worked like a charm.