On Android 2.1, just as on most graphical computer OSes, pressing the mouse while in a button, then dragging away, then dragging back, then releasing (while within the button rectangle) would result in a button press. It would also highlight while the mouse pointer was within (or actually near) the button, going off as the pointer left the zone, then back on when the pointer returned.
This behavior allows the user to cancel, mid-press, by dragging away from the button until its highlight is off and releasing; it also allows the user to change her mind about cancelling, so long as the mouse is still down, and go back into the button to "rescue" the click.
In 2.2, it appears that Android no longer allows a return to the button. Dragging away cancels the highlight, but returning with the mouse still held down does not re-highlight the button, nor does an away-and-return click generate a click event.
So, my questions: Is this change real (has anyone else seen it)? and: Is it intentional? What is the rationale for this change, if it is intentional?
Since I tested in an Android 4.0.4, I can guess this was intentional.
My guess is that they made the change to prevent some problems with people who are not used to touchable screens. It can also be to improve usability for people with disabilities. However, I'm not Google nor know the real reason of the change. Those were just my guesses.
Related
I have a very simple UI that has one entry control to enter phone number and a button. The entry control has a handler for removing border around it. When the entry control got focus, keyboard pops up. But when I try to tap outside the entry control such as on the screen empty area, the keyboard does not dismiss and the entry control does not lose focus. Also since the button is at the bottom of the screen, therefore, the soft keyboard hides it and there is no way to tap the button. The button can only be tapped if I press the Android device back button.
At present, I have not checked this behavior on an iOS device.
This was not a problem in Xamarin Forms though. I searched a lot on Internet and found that it is currently a bug in MAUI.
I tried to attach a tap gesture on the parent layout control and invoked platform-specific code to hide the keyboard but it seems the entry does not lose focus and in turn the tap gesture event is never called.
However, the entry control should lose focus automatically when I tap outside the entry control (such as on the screen) and the soft keyboard should automatically dismiss.
Please provide a workaround if there is any.
Known bug. Removing the focus sometimes helps. Sometimes you need to do Disable/Enable in sequence. (I go with the second).
If you want, you can read this for example:
https://github.com/dotnet/maui/issues/12002
(Most disturbing part, considering this is know bug for half year+)
We can leave the behavior how this is for now in NET7 and provide an
API in NET8 that lets users toggle this behavior on/off for iOS and
Android
I'm looking at the Support4Demos from the Android SDK and I'm not sure if this is working as intended. Specifically, I'm referring to accessibility focus when using the Widget > Explore by Touch Helper demo. If I tap on one of the blue regions to give it accessibility focus then tap on the on-screen home button focus will switch to the home button. But if I tap on the same blue region as before nothing happens (but if I tap on the other blue region focus transfers from the home button). I'm testing this on a Kindle with on-screen navigation buttons.
Am I correct in assuming that focus should transfer back to the blue region? If so, what is the proper way to handle this? Presumably there would be a way to know that the user tapped on something outside of the app and in response to this I could clear state in the ExploreByTouchHelper but I'm not sure how I would go about that.
Hi there is thery any way to invoke a method that enables or disables the Touch Screen of Android?
I want this, because I have several buttons on my activity. When the user clicks on a button, it takes a few seconds to start the following activity, and because of that, while waiting that time, I don't want the user to be able to press anything.
I used a boolean that is True at start, then It changes to false when I click on the first button. And to every click on a button I check if the boolean is true...
But the problem is that Visually the user can click the button, it gets that look of being pressed..
So is there any good method that disables the entire touch screen ? And another that enables the entire touch screen ?
Thanks alot in advance ;)
But the problem is that Visually the user can click the button, it gets that look of being pressed
Disable the buttons, using setEnabled(false). This will not only prevent the user from clicking on them, but they will visually appear disabled, to let the user know that the user cannot click on them. It is important for the user to get the proper visual feedback about the buttons being disabled (and later enabled).
is thery any way to invoke a method that enables or disables the Touch Screen of Android?
Not really.
Recently I was able to create a tablet software for my Cerebral Palsy girl to "talk" to me, since she can't speak.
Well, a friend of mine has Amyothrophic Lateral Sclerosis (ALS). He can move just one finger and he is willing to use my daughter's software to be able to "talk" again.
Since he can move just a finger, I created a version where each item "blinks" (in yellow) for some time (just one second) and if he presses a mouse button, the item focused (in yellow) is activated.
See below:
It works if you leave the mouse over the black portion of the screen. If mouse is over the buttons, it won't work, it will click the button where the mouse is over.
Also, if he uses a keyboard and he presses the ENTER key, it will activate the first button, then, if he clicks the left arrow and then presses the ENTER again, it will activate the second button and so on.
So, I wish I could create an generic event that if he would press the ENTER key, just the selected (in yellow) item would be activated.
Any ideas?
Well you could make two different modes. One where there are click listeners for each picture,and another where simply a click anywhere on the screen is recognized ( ex. find the largest layout id and set a listener). Then in the second mode, use
http://developer.android.com/reference/android/view/KeyEvent.html
to detect KeyEvents such as Enter, and handle them depending on the highlighted View.
I'm working on an app which presents users with four buttons and a timer. The users then tap as fast as they can, each user on his own button, and the one with the most taps at the end wins.
I can't use onClick here, because it locks up the UI thread until the button is released, effectively blocking other button presses. I have searched around for a bit and found that I could use onTouch, but it doesn't work the way I want it to. If a user has touched and is still holding a button, any subsequent touches on other buttons will behave as though this first button was pressed.
Someone suggested the use of an image, transparent and stretched across the entire visible UI. One could then read any touches on this imageview and assign a touch to a particular button based on the coordinates of the press. (I guess I would take a screenshot of my UI with the four buttons visible, open it in paint and write down the coordinates of the borders for each button, then use those coordinates in the code to figure out which button the user was trying to press.)
Can anyone help me with this method of work, give me a quick example, or link to where I can learn how to do it and implement it in my app? It would be much appreciated.
TL;DR: How to use an image, transparent and stretched across the entire visible UI and read the coordinates of each press (even if multiple at once)?