I am looking for a way to have a modal bottom drawer that behaves like an AlertDialog (poviding mainly text input and two buttons for ok and cancel and disabled gestures).
The current approach is to use BottomDrawer with disabled gestures. But this way it will not close when touching the scrim (scrim = surface behind drawer, -> onDismiss is explicitly disabled when checking source code of BottomDrawer).
But: According to the documentation interaction with the drawer background should be possible when Color.unspecified is provided for argument scrimColor. What actually happens: it blocks all interaction: even to button clicks in drawerContent. So disabled gestures and unspecified ScrimColor turns BottomDrawer in a really useless state.
When using ModalBottomSheetLayout I have no possibility to disable gestures. Filtering out swipe gestures manually is a PITA.
Input is Welcome!
Related
I tried and understood what could be the purpose of the accessibilityActivationPoint but in vain.
When a focused accessible element is activated, that property should indicate VoiceOver the specific area it's going to activate when a user double-taps the element (Apple reference) : for me, it's always the selected element itself.
I understood the selected element is considered as a block by VoiceOver, whatever the other elements inside. Once a double tap occurs to activate this block, VoiceOver calls accessibilityActivate to know what to perform (Apple reference).
1/. I've written many tests by creating a custom view including a switch control. Whatever the value of accessibilityActivationPoint inside (or outside on another switch control), the value of the switch control never changes. Is it a proper use case or am I totally wrong ?
2/. When we gather many elements inside one accessible element, how is VoiceOver able to activate one of them while they aren't accessible by definition ? Pointing one of them thanks to the accessibilityActivationPoint should work ?
Personally, I couldn't make it work and think that I'm really confusing accessibilityActivationPoint and accessibilityActivate.
Any help would be appreciated, thanks in advance.
Yes, you have the right idea with accessibilityActivate and accessibilityActivationPoint. Note that, in order for it to work, the accessibilityActivationPoint needs to be a point within the Control that you are trying to activate in on-screen coordinates (use the convert function!).
I think the short answer is "yes" to answer your second question, but, just to clear up confusion about when Accessibility Activation Point is useful, I'll go into more detail about it.
By default (aka, the default behavior for AcessibilityActivate()), when any view is activated by VoiceOver, VoiceOver will send a "tap gesture" to the center of the view. The position of this "tap gesture" can be changed by updating the accessibilityActivationPoint attribute on a view. Below, I have an example for how this property can be used.
Let's say you have a blank button (in the image below, the button is the gray box) next to some text:
For the purpose of accessibility, you may want to make the entire view that holds the button and text an Accessibility Element (so that VoiceOver users can easily understand that the button is associated with the text "Worldspace Attest"). In the image below, I am using Accessibility Inspector to show that the view holding both of these elements is an Accessibility Element.
Notice in these images that the button is not in the center of the view, but rather, it is to the right. When you activate this view using VoiceOver, the view will not select the button; instead, it will send a "tap" to the center of the view (which is the same as tapping the text, which does not do anything). In order to select the button, you have to set the view's accessibilityActivationPoint to be the on-screen coordinates of the button:
view.accessibilityActivationPoint = self.convert(button.center, to: UIApplication.shared.windows.first)
This should make it so that this button is usable by a VoiceOver user.
I hope this information clears up any confusion about the Accessibility Activation Point property. The example I used above can be found in this repository in the "Active Control Name" demo.
I'm working on an App with Objective-C but I have a problem with my form.
I have several inputs view (UITextField) on it, and one with a particularly behavior.
When I select the checkbox, I prevent the user typing on the view and looks the view as disable( grayed out and without the blue bar flashing blue bar ) and keep the keyboard open.
When I set the UITextField as disable, the keyboard is automatically hidden.
Someone knows how to keep the keyboard open?
I need to something like the image attached, but without the blue bar flashing blue bar.
I did the logic to prevent the the user enter data on the input , but the keyboard is automatically hidden.
If the text field is disabled, the user cannot type into it and the dismissal of the keyboard is correct. You should not try to fight against that. (It sounds like you're trying to disable the keyboard for the wrong reasons anyway.)
In this case, it sounds like your timing is just off. When the user clicks the checkbox, your code responds. What you are doing there is just wrong. You should respond by moving the first responder to the next enabled text field yourself, and then disabling the first text field. That way, you are not disabling the text field while it is first responder; that's your whole mistake right there.
I have derived a TFramedScrollBox to implement in my component a class which constructs me on a given dimension (x and y) buttons onto the FramedScrollBox. This works fine. Touchscrolling on this object works fine, if the property Touch.Pan is set to true. Then i even can scroll over the buttons and by "touching" or "tapping" the buttons the click event happens right after the touch. This derived component, my component, is used all over the application, because it need to be.
The Problem(s)
The given app is running in fullscreen mode on win 8 systems which is currently necessary for our business. In the above explained situation is not possible to tap the buttons fast after the others, because some click events don't rises. And the logic behind is not necessary. That is one problem... If I switch the form to none fullscreenmode then a touch on different buttons rises the click event immediatly as wished. Now i have discovered that if the above mentioned property Pan is set to false, then even on fullsceenmode every touch click rises the event but now the scrollbox don't scrolls by touch gesture...
Now comes my question in the title...
Ps. if wished i can send a simple sample...
The bug is described in detail here https://bugs.webkit.org/show_bug.cgi?id=134596
Relevant part is this:
Without Scrolling you should be able to click any of the radio buttons
Now scroll down the page
Trying to click any of the radio buttons on the left results in an
offset click. One of the radio buttons below your click will receive
the event.
Expected: The radio button I clicked on gets focus
Actual: The click event is offset the amount the iframe was scrolled.
Main difference is im not using an iframe, just a div, but the same problem.
If I remove either overflow:auto (but it wont let me scroll then) or -webkit-overflow-scrolling property the correct clicks happen. It looks like it was fixed in a nightly, but this has to work now and for backwards compatibility. Is there a hack to get this to work? My best idea so far is to just not have that -webkit-overflow-scrolling prop for iOS until it works, but that kinda sucks because momentum scrolling is what makes it feel much more like an app.
I'm building an iOS app that uses a webview in one place. When the user taps on an textarea and the keyboard appears the textarea get a shadowing highlight effect and then goes back to normal. Please note that I'm not talking about webkit-appearance och outline, but the shadow that covers the whole textarea being tapped.
I'm guessing this is some kind of accessibility feature. Still, it mess up my animation and makes the whole view look like crap.
Does anyone know if it's possible to remove this highlight shadow?
You can disable it by setting the css attribute -webkit-tap-highlight-color to rgba(0,0,0,0);
But as you mentioned it is a usability feature, so you should not turn it off. ;)
See:
http://www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/