android-keypad

Adding proper keyboard support to RecyclerView

孤街浪徒 提交于 2020-12-01 09:24:22
问题 In one of my previous questions, I asked (and answered by myself following this blog post) how to properly handle key input on a RecyclerView . Now I realized that if I keep an arrow key pressed, let's say down key, the scrolling downwards stops and the RecyclerView loses its focus, probably because the scrolling is faster than the generation of all the children View s. Is there any workaround or better practice to properly handle hardware keyboard inputs on a RecyclerView ? Update: I

Adding proper keyboard support to RecyclerView

六月ゝ 毕业季﹏ 提交于 2020-12-01 09:23:36
问题 In one of my previous questions, I asked (and answered by myself following this blog post) how to properly handle key input on a RecyclerView . Now I realized that if I keep an arrow key pressed, let's say down key, the scrolling downwards stops and the RecyclerView loses its focus, probably because the scrolling is faster than the generation of all the children View s. Is there any workaround or better practice to properly handle hardware keyboard inputs on a RecyclerView ? Update: I

Adding proper keyboard support to RecyclerView

∥☆過路亽.° 提交于 2020-12-01 09:23:19
问题 In one of my previous questions, I asked (and answered by myself following this blog post) how to properly handle key input on a RecyclerView . Now I realized that if I keep an arrow key pressed, let's say down key, the scrolling downwards stops and the RecyclerView loses its focus, probably because the scrolling is faster than the generation of all the children View s. Is there any workaround or better practice to properly handle hardware keyboard inputs on a RecyclerView ? Update: I

Overriding the physical menu button on android

混江龙づ霸主 提交于 2020-03-14 07:42:11
问题 I would like the menu key on my Android device to open a dialog instead of opening the menu while my app is running. I tried to code that into onCreateOptionsMenu(Menu menu) but it worked only for the first time I pressed the menu button. Can I do it in some other way? 回答1: You can override the default behavior of system key presses by intercepting them in your Activity. This is done by overriding the onKeyDown event, and returning true if you want to prevent the key from being handled by the

Android keyboard not appearing, even when explicitly requested

笑着哭i 提交于 2020-02-25 04:27:06
问题 I have an app with two activities, and sometimes, I need to switch activity and at the same time open up the search input in the actionbar of the activity that's just been resumed. Everything works fine, except that I can't get the keyboard to come up. The relevant bits of my code are below (NB: the boolean startsearch is set true as a result of switching activities if the search input is required): public class MyActivity extends Activity { private InputMethodManager imm; public boolean

Custom keyboard - Android

假装没事ソ 提交于 2019-12-31 04:12:38
问题 Is there any known combinations of inputTypes on an inputText that would give a Num-pad keyboard with special characters such as $ , * , # and & . I am trying to allow the user to input a number and that field could take the mentioned characters as well. I have tried many but none seem to be giving the required output. Would I have to create my own custom keyboard for this? Since my request is very specific to certain special characters please do not mark this as a duplicate question. Thanks

Prevent the keyboard from displaying on activity start

怎甘沉沦 提交于 2019-12-28 04:39:06
问题 I have an activity with an Edit Text input. When the activity is initialized, the Android keyboard is shown. How can the keyboard remain hidden until the user focuses the input? 回答1: I think the following may work getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); I've used it for this sort of thing before. 回答2: Try this also - this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); Otherwise, declare in your manifest file's

Best settings for HTML <input type=“number”>, for mobile devices

落花浮王杯 提交于 2019-12-23 07:57:19
问题 I've been reading many other questions, like these[1][2][3] for example, but the problem still persists. I need to find the "cleanest" way to have a HTML input for mobile devices and which respects all these three rules: suitable mainly for numbers , integer or float shows the numeric keypad on mobile devices , on Chrome for Android and Safari for iOS, with no strange extra keys fully respects the HTML5 rules (tested by W3 validator) What have I tried? I've been across these solutions, which

How to check if the native/hardware keyboard is used?

一世执手 提交于 2019-12-21 02:43:11
问题 I want to check if the native/hardware keyboard is used, and also if possible I want to disable the third party keyboards. My goal is simple I use just the native android soft keyboard for entering values in my edit boxes and no other keyboard should be able to this Thanks EDIT I know it is not good idea to do what I am trying to do, I know that the basic idea of android is to have intents and activities and services who know to handle some types of intent according intent-filter. But this in

Open a numeric keyboard without forcing the EditText to be numeric only

断了今生、忘了曾经 提交于 2019-12-19 06:33:15
问题 I've come across this while doing work on creating my own Keyboard but can't for the life of me remember where I ran across it. I want top open the Numeric keyboard. However, I want my EditText to only accept an IP address. Adding a filter to my EditText wasn't too hard thanks to this answer. However, now I want to make the Numeric keyboard to open rather than the standard text keyboard. Unfortunately search results are saturated with the same "How do you limit EditText to numeric input?"