android-softkeyboard

Android SearchView Hide Keyboard on Start up

牧云@^-^@ 提交于 2019-12-10 14:49:28
问题 I'm having a minor issue I'm trying to solve. When I open my application, the keyboard shows to enter a query for the search view. However I just want the keyboard to appear when I click on the search view. How do I fix this? Thanks! 回答1: This worked for me. /* Code used to hide focus */ searchView =(SearchView)view.findViewById(R.id.searchView); searchView.setFocusable(false); 回答2: Use this attributes in your layout tag in XML file: android:focusable="true" android:focusableInTouchMode="true

TextWatcher onTextChanged not working with soft keyboard auto-complete / suggested words

半世苍凉 提交于 2019-12-10 13:35:25
问题 I'm Implementing a TextWatcher on an EditText to find and underline a series of keywords within the text whenever a new character is entered by the user. However when a suggested / auto-complete word on the soft keyboard is selected, instead of adding the suggested word to the Edittext and then calling the onTextChanged function the half complete word is deleted. I found this rather strange as entering individual characters activates the onTextChanged function just fine. Any help would be

Adjust the layout when the Android soft keyboard is shown or hidden

别说谁变了你拦得住时间么 提交于 2019-12-10 13:33:17
问题 My goal is to achieve what most messaging apps like Facebook messenger, Viber, What's up do when displaying an attachment sheet. If the Soft keyboard is visible and the user wants to attach something, the keyboard is hidden and the attachment sheet is presented in its place. In order to make this work, the layout changes should happen when the root view size changes. Otherwise, a graphical glitch occurs where my layout changes are applied shortly before keyboard is shown/hidden. If I could

Hide soft keyboard on pressing back

这一生的挚爱 提交于 2019-12-10 13:03:23
问题 I have an EditText in an Activity and I want it to be active and soft-keyboard be open when I open that Activity . Here is my xml for EditText : <EditText android:background="@null" android:cursorVisible="true" android:elegantTextHeight="true" android:enabled="true" android:focusable="true" android:hint="Search" android:id="@+id/editText11" android:inputType="textNoSuggestions|textCapSentences" android:layout_centerVertical="true" android:layout_height="wrap_content" android:layout_width=

Output one character per two keys in Android Keyboard

扶醉桌前 提交于 2019-12-10 12:42:14
问题 I am designing a custom keyboard for Amharic language in Android, but the following is applicable to many other non-English languages. Two or more combination of keys translate to one character. So, if the user types 'S', the keyboard will output 'ሰ'... and if they follow it with the letter 'A', the 'ሰ' is replaced with 'ሳ'. I managed to get a solution, as below, working by looking at the character before the cursor and checking it against a Map. However, I was wondering whether there is a

Add Button to Android Soft Keyboard

旧时模样 提交于 2019-12-10 12:18:08
问题 i m able to add a next button to soft keyboard but i also want to add a previous Button is this possible if yes please tell me how ? i m trying this Android - add next and prev button to softkeyboard which appears on click of an edit text in my activity Thanks 回答1: Please see the first answer of your own reference. It has a comment saying You cannot have both next and prev. You can have next and done but not next and prev. Just check this url. developer.android.com/resources/articles/on

customize soft keyboard key preview

丶灬走出姿态 提交于 2019-12-10 11:39:18
问题 I am working on soft keyboard . I had done with all of my functionality. But now i just need to change view of key preview when key is pressed. Currently my key preview is shown(default sample keyboard key preview) like shown in below image, As we can see character 'd' is popped up when key is pressed. But now i need customize it. As currently key preview background is white, i need it to set green color just like shown below, I have the sample keyboard code, but couldn't find the place where

Replicate keyboard like layout upward push in bottom sheet

筅森魡賤 提交于 2019-12-10 10:58:42
问题 Is there any way to manually push up layout (scrollview or recyclerview or whole activity) when bottom sheet opens just like android keyboard does? Or you can say that i want to make a minimal keyboard in form of a bottom sheet(which isn't using any editable view) 回答1: 100% working formula Use this in onCreateDialog in BottomSheetFragment KeyboardUtil(getActivity(), view); or For fragment use new KeyboardUtil(this, findViewById(R.id.fragment_container)); by using this Util class https:/

Android soft keyboard - disable certain keys

旧巷老猫 提交于 2019-12-10 10:53:14
问题 I am looking for a way to use the built-in soft keyboard and disable certain key. For example, if the User is not supposed to use the letter 'f' (because in the list, that letter is not present), the key should be grayed out. Imagine that a User can type a text into a textbox for choosing from a list. The list contains: Abc Bcd Bed If the User inputs: -A Then he will only be able to click on 'B' and then only to 'C'. If the User inputs: -B At first he will be able to choose 'C' or 'E' and

Closing keyboard in ViewPager

允我心安 提交于 2019-12-10 09:48:29
问题 I have implemented three tabs using ViewPager. In the right tab layout i have one edit text widget, when users click on it keyboard comes up. If the user don't close the keyboard manually and swipe to the middle or left tab the keyboard remains on screen. So how to avoid the keyboard in other two tabs where i don't need it. Edit: Here's my code. class ViewPagerActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState