Enable toolbar button only during live card display - android

In my Glass application, I display a button on the toolbar. This button shows the on/off state of the camera and lets the user toggle the state.
The problem I am running into is that Glass occasionally moves the focus to the button. As a result, a tap keeps activating the button.
It seems Glass automatically converts toolbar menu items to live cards when top-to-bottom swing is used. This is nice. It gives the users the ability to select a menu item.
I am thinking if I could set the default state of the button to "disabled," it could solve my problem. However, this also results in disabling the button in the live cards. I would like to enable the button only during live cards.
Is there a way to achieve this? Or, is there a better way to remove focus out of the toolbar? Regards.

Related

How to prevent user from clicking Navigation buttons in Android

I have encountered a problem where user will exit my application accidentally. I know Android is preventing to block use of these buttons, because you should always be able to exit your app somehow but I am creating an app for blind and visually impaired people and I will implement a special exit the app so they won't close it when they will be using it.
Here are some things I gathered:
I can block the onBackPressed() function and prevent going back.
I can't use onKeyEvent() since it won't grab the home click
Good example is MX Player where you can "lock" your screen but it just draws over the whole screen, thus preventing user to click on anything.
Ok, so I would like to grab the same thing as MX Player, except, I would like for user, to still have interaction with the screen.
I tried using Immersive full screen that Google has introduced for full screen apps, but whenever user slides his finger on the screen, Navigation Menu popus up. Can I keep this hidden at all times? Also, can I prevent the slide from Status Bar to display the buttons? I would like to have full control of how the user is moving their finger over the screen.
So if I go back to the MX Player solution - drawing over the screen. Can I create like a Canvas that doesn't have focus and it's just there to prevent the clicks on the buttons?
Any help is very much appreciated. Thanks.

How to detect loss of accessibility focus with on-screen navigation buttons?

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.

How to change the onscreen button

I looked for the question everywhere on the Internet but can't find the answer. What I found is to hide the whole button tray all together.
When the keyboard is down, the button is shown as in the picture.
But when the keyboard is showing the icon changes to -
My problem is to change the button (as in the second image), when my emoticons are showing. So, is there any way by which I can programatically change the button on an event and change it back on another event?
I'm afraid this is not possible yet. Perhaps this will be implemented in later versions of Android.
Not all devices have an onscreen navigation bar, a lot of devices still have hardware buttons.
Nevertheless, you'll might find this article interesting: http://arpitonline.com/blog/2014/07/27/improving-androids-navigationbar/

Android "Tooltip"

The current Android YouTube application provides helpful hints for navigating the user interface. For example: the first time the user switches between tabs while a video is playing, a small "tooltip" with an arrow pops up and says "You can also switch between tabs by swiping left and right." or something to that effect. Is there a way to mimic the look and functionality of this tooltip?
The best way I could think of doing that is having something in a preferences file and when the user triggers a certain event (pressing a tab in Youtube rather than swiping) it brings up a custom view or even a Toast message. Then, after the tooltip is triggered, set the specific tag in the preferences file as triggered.

Losing screen object auto-focus

I have a GridView displaying buttons to different screens of my app. When this grid screen, the first cell is selected. Is there a way to programmatically have no cells selected when the screen launches? Or do I have to hide the selector?
When this grid screen, the first cell is selected.
That should only be true if the user was using the navigator (D-pad, trackball, etc.) in the previous activity.
Is there a way to programmatically have no cells selected when the screen launches?
Generally, the user determines this based on whether they are in touch mode or not. You could try setSelection(-1) or something, but I would not be surprised if this fails to work.
Or do I have to hide the selector?
I would recommend just following the platform conventions. If the user is using the D-pad or trackball, they probably want to use the D-pad or trackball, and disabling the selector will simply make them frustrated with you and your app. Please see the article I linked to above for more details on touch mode and why it works the way it does.

Categories

Resources