Back icon state change - android

When keyboard is open, the icon of the back button is changed to indicate that clicking it will close the keyboard instead of going back.
Back button:
Close button:
Is there a way how to switch from the back icon to close icon programmatically without actually opening the keyboard? We are using a custom keyboard implementation and would like to have the similar behaviour to the native one.

Related

react native picker - doesn't hide when android back button pressed

I have a listener on the whole app for the back button press event in android to override the default behaviour of back button(exit the app).
Also in some component i have override it too if i want the back button to be disabled or do something else.
The problem is when i open a react-native-picker, the picker stays on the screen ignoring the back button press.
I want it to first close (on the first back button press) and only then do what the higher component ordered to do when back button is pressed.
so i can't override the the higher component back button handling
i thought maybe to add the picker as a screen in the navigator and instead of planting it as a component, navigate to it, so it will be added to the stack navigator.
then by default it will first pop it of the stack when pressing back.
how can i add the picker component as a screen to navigate to, or is there a better way to do that?
By default the back behavior collapses or closes the picker on Android (depending on the mode you have chosen). You can see a working example here.

Why does TalkBack announce "Back"?

I am working on Android accessibility, and the phone has TalkBack enabled.
I have a screen with a toggle switch, and clicking on it will show a dialog.
Once the dialog is dismissed, the focus is supposed to go back to the toggle button and announce the content description for the button. But TalkBack is announcing, "Back. Toggle button is on."
I don't see the focus moving to the back navigation but somehow, it gets announced. And when the focus is in the navigation button, it always announces "Back button", but in the previous case, it's just "Back."
Things I already tried:
Force-focus the the toggle using request focus, sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED.
Interrupt - AccessibilityManager.interrupt()
Nothing worked!
Any clue why this would happen?
Toggle switch is on

Clicking on soft home button in navigation bar also triggers underlying click listener for a view

Some newer Android devices have removed the hard Home Button and replaced it with a soft pop up navigation bar at the bottom of the screen that appears when the user swipes up. I've found that the Home Button can also be accessed by hard pressing (not just long clicking, kind of like iOS force touch) the area where the Home Button would appear if navigation bar is visible. This action triggers an onClick event within the current application before navigating to the device home screen. How can I prevent the onClick event within the application?
You can see in the image below how the navigation bar Home Button overlays the app button. Thanks for any help, I feel like i'm missing something really obvious.

Disable home and back buttons in android

I'm doing an appication under phonegap (more specific in android). How can I disable the home, menu and back buttons in the screen, the idea is when i press any of the buttons, show a verification dialog, if the answer is correct, close the app. When i assign the function button doesn't show the dialog
For the home menu remove the onCreateOptionsMenu() function and also you wouldn't need the onOptionsItemSelected() function, so to hide the menu remove these two.
For the back buttons there are two of them:
The hard button in device that navigates in the app until it hits the main activity then pops out of the app, can be controlled by overriding this method onBackPressed()
And the one in the action bar that navigates all inside the app itself but never pops the user out of the app, can be set by setDisplayHomeAsUpEnabled() which takes a Boolean true to make it working, false to disable it.

Android 4.0+ software back button style

I have handled back button to close activity instead of hiding keyboard. It works just fine.
But if device has no hardware buttons software button will show hide keyboard (arrow down instead of back) image when keyboard is open. Of course clicking that down ("back") does close my activity.
This is what i have:
This is what i would like to have instead:
Is it possible to force software back button look like back button (instead of close keyboard) when keyboard is opened?

Categories

Resources