did one of you ever run into that problem ?
With some high resolutions screen it displays correctly :
but the low resolutions it's not displaying correctly are not so low, for example, in galaxy spica (320x480px). I would like the keyboard to be brought behind the suggestions list when this one gets the focus from the user who's trying to scroll on it with one long click..
I' ve tried : android:windowSoftInputMode="stateHidden|adjustPan" in the activity manifest.xml and all other combinations. still, it's not working...
I tried to change the text size, the items size, the padding, the max height of the whole autocompletetextview, the max height of dropdownlist, tried a MultiAutoCompleteTextView, even tried to nest it in a scrollview, nothing.
it occurs because of the keyboard which "pushes" the list items above the textview so without the keyboard everything would be nice..
any help would be much appreciated...
Just add android:dropDownHeight="100dp" to the AutoCompleteTextView tag in your layout file,
#Override
public void onFilterComplete(int count) {
setDropDownHeight((count > DROPDOWN_LIST_COUNT ? DROPDOWN_LIST_COUNT : count) * getHeight()
+ DROPDOWN_LIST_BORDER);
super.onFilterComplete(count);
}
I've encountered the same problem and tried the code above. It makes sure dropdownlist shows DROPDOWN_LIST_COUNT items.
You can try this method:
autoCompleteTextView.setDropDownVerticalOffset();
There was more screen space above the AutocompleteTextView than below, so the list opened upwards. You may adjust your layout to make sure there's more screen space(exclude the pop up keyboard)below the AutocompleteTextView. This issue seems has been fixed from ICS.
Related
I have an ExpandableListView which contains a RecyclerView of a custom layout. This layout contains some views including my EditText.
My behavior is : When I click in my number EditText, the keyboard appears for about 0.5s, the whole layout is cleared with default values, then the keyboard disappears, a text EditText appears, and finally I loose focus. When I click on it one more time, the keyboard stays, but in text type. Strange thing : the problem seems to be only on devices where the whole layout overflows the screen because on 10" tablet, everything is ok (layout not cleared, and keyboard not disappearing).
According to me, when I get the focus in the EditText, the layout is re-creates , making it to be cleared.
I tried a long time to figure out what was going on, but I didn't find anything. Here is the things I tried, but didn't change anything :
android:descendantFocusability="beforeDescendants" // on all parent of the EditText
focusable="true" // On the EditText
android:windowSoftInputMode="adjustPan" // In the activity in the manifest
making all the ViewHolder attributes final
As the code is very huge for all that amount of things, I don't know what I should post to help. So don't hesitate to ask anything if it can help
Thanks!
EDIT : A Gif showing the issue https://imgur.com/a/BPue4
Try adding this line to your activity on manifest.xml:
android:configChanges="keyboardHidden|screenSize"
Opening keyboard or screen size changes may trigger to re-create your content.
I have a AutocompleteTextView. Suggests List will appear on typing 3 characters.Suggest list size to be be fixed i.e. 8 . Every thing is working fine except the suggest list getting overlapped with soft keyboard.
I am attaching the screen shots for the same
What should be done, suggestions please.
Thanks in advance.
Try setting android:dropDownHeight
I have a main activity which has RelativeLaoyout # root and many other views including a GridView with 2 columns.
Now, clicking on one of the buttons opens a dialog which has an EditText in it.
When user taps in the EditText the whole RelativeLayout of the main activity is pushed upwards.
I have tried almost all of the solutions I could find on stackoverflow and various other forums but none has worked for me!
Things I have tried so far
Set android:windowSoftInputMode="adjustResize"
I also tried adjustNothing and adjustPan but nothing worked
Set android:isScrollContainer="false" for the GridView
I also tried setting it to true. But that didn't help either.
This issue is really bugging me very bad. Please someone help!
EDIT
Found a duplicate but that too is un-answered!
background layout moving when soft keyboard displayed - android
how adjust pan will work it just push ur edit text not ur whole background if ur edit text is in b/w the height of keyboard that comes up to the screen, the adjust pan just lift the edit text not the whole background screen and if ur edit text is above from the height of keyboard then no change will occur.
Do you have Fullscreen theme?
#android:style/Theme.Holo.NoActionBar.FullScreen
If so, try changing it to:
#android:style/Theme.Holo.NoActionBar
It seems that in HoneyComb version and above the full screen theme setting overrides the windowSoftInputMode adjustResize or adjustPan settings.
I have 3 autocompletetextview's in which i set its adapter to be an ArrayAdapter<String> with a very simple textview layout.
The autocompletextview hint results are showing, but are under the onscreen keyboard(i can see part of it). how can i make the results show above the autocompletetextview rather than below?
airline = (AutoCompleteTextView)findViewById(R.id.airline);
airline.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, AIRLINES_AUTOCOMPLETE_ARRAY));
departLocation = (AutoCompleteTextView)findViewById(R.id.departLocation);
departLocation.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));
arriveLocation = (AutoCompleteTextView)findViewById(R.id.arriveLocation);
arriveLocation.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));
Simply limit the drop-down height.
android:dropDownHeight="200dp"
Then results don't hide by the soft keyboard.
Or else do this
The theory says that android:windowSoftInputMode="adjustPan|adjustResize" should do this but for some reason, it doesn't, so you have to do the same programmatically:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Use a ScrollView for the layout where your Autocomplete resides and Voila!
Does your Activity adjustResize?
android:windowSoftInputMode="adjustPan|adjustResize"
reference: Move layouts up when soft keyboard is shown?
you should look here : Creating an input method
Composing text before committing
If your IME does text prediction or requires multiple steps to compose a glyph or word, you can show the progress in the text field until the user commits the word, and then you can replace the partial composition with the completed text. You may give special treatment to the text by adding a "span" to it when you pass it to InputConnection#setComposingText().
this way, suggestions will apears on soft keyboard prediction like auto-correction. An other way of doing it will be a fullScreen IME... with ExctractEditText : See this link...
This is what i usualy have seen in other apps... i don't think the autocompletetextview can be inverted and appears on top of the view, but what's strange is that it usually shows on top of the keyboard not bellow...
I had the same problem with this a little while ago. You Can try manipulating the z-index of the elements that are being hidden to force it to the top which would be your views in this case. Hope it works for you !
another quick solution is by using the attribute "android:dropDownAnchor"
to anchor the dropdown to some other view on top of screen
Add an attribute in your AndroidManifest.xml
android:windowSoftInputMode="adjustPan|adjustResize"
Which will auto resize and adjust the soft keyboard.
Use
android:windowSoftInputMode="adjustPan|adjustResize"
If none of the above solutions worked. try this
android:dropDownHeight="match_parent"
If we didn't mention the dropdown height, it would be considered wrap_content. Therefore the item will show behind the soft keyboard.
Take the autocomplete textviews in respective layouts then you see they opens their values in it only (ABOVE), set autocomplete texview (bottom) of each layouts, as per your question you required three child layouts.
it is really working
I have a dialog window that covers 1/3 of the entire screen height and is displayed on top of my activity. The dialog holds two AutoCompleteTextView fields.
The problem I'm facing is that when the user starts typing something into the AutoCompleteTextView, the list with all suggestions only shows up to the bottom end of the dialog, but doesn't go beyond that even the list is longer. It looks like it's cut off. (screenshot left)
Only after I long-press an item from the suggestion list, the list will be shown in full length. (screenshot right)
Screenhot is at: http://img704.imageshack.us/i/dialogdropdown.png/
screenshot http://img704.imageshack.us/img704/1893/dialogdropdown.png
How to fix this behaviour so that the list shows in full length right from the beginning, when the user starts typing something?
Code-wise there's nothing special, all I do is:
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getContext(), R.layout.nav_route_autocomplete_row, locStrings);
AutoCompleteTextView txtStartPos = (AutoCompleteTextView) findViewById(R.id.txtStartPos);
txtStartPos.setAdapter(adapter);
...
One workaround idea is to somehow dispatch a motion event to simulate a touch (but then not selecting though) one of the list items. Any concrete idea in code for a solution, anybody?
Right now I'm assuming it's a bug, which I already filed here: http://code.google.com/p/android/issues/detail?id=9917
But if anybody knows a solution to this, I'd greatly appreciate it and would be glad to trade it for some bounty points.
Edit:
One workaround that came to my mind is now to extend the dialog to the very bottom of the screen but leave the background transparent, so it looks the same as now, but actually has a height that wouldn't cut off the list. I will give that a try...
Not long ago i faced this problem. I had small dialog with AutoCompleteTextView, which had more than 10 items in Drop Down list. This list was cutted. My solution was:
Place some empty View in my Dialog layout file with parameters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--
Some Views placed here
-->
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
</LinearLayout>
It made my little dialog like a full screen dialog, but actualy that "tail" wasn't showed, and my DropDown wasn't cutted at all, cause it had enough place to show list items from DropDown.
if (yourlist.size() > 5) {
yourtextview.setDropDownHeight(562);
} else {
yourtextview.setDropDownHeight(anytextview.getHeight() * yourlist.size());
}
//Workaround -> Write this condition under on click and on focus change of your autocomplete text view
Just a shot in the dark, but have you tried setting android:clipChildren to false on the view for the dialog atop your Activity?
I have successfully achieved this, but it isn't pretty.
I ended up overriding my SimpleCursorAdapter.newView() method, walking up the ViewParent hierarchy until I reached the root View, and then modifying its WindowManager.LayoutParams by ORing in the FLAG_LAYOUT_NO_LIMITS flag.
This needs to be redone every time the drop down is displayed.
As seen here: Scrolling drop-down-menu over the keyboard in autocompletetextview
You can use the property android:dropDownHeight of the AutoCompleteTextView to force it to be of a certain height. This is not really solving the problem, but is the best I could find.
Note: This problem only happens when using AutoCompleteTextView inside a Dialog. When it is used on the layout of an activity or a fragment it just works fine.
This issue is present all the way from Gingerbread to Jelly Bean.