Android - Control Keyboard show inside ChromeWebView - android

Having a APP that loads inside an Activity a ChromeWebClient loads a webpage. This web page have's multiples forms / applications inside it. The funcionality that I want to control is to avoid the keyboard to show unless a variable is set up to be showed. (This variable only changes given a certain user actions). This is what I have test with no luck:
Set up Listener to ChromeWebClient
Set up listener to mainLayout
Set up listener onConfigurationChanged
Tryed this SoftKeyboard open and close listener in an activity in Android?

Related

How to prevent Android's back gesture from selecting text inside of nested webview?

We have an app that uses a Webview to render a text editor (contentEditable) inside of a React Native application. This works well overall, except that the Android back gesture can lead to changes in the selection of text inside the Webview and similar strange behaviors.
We've tried things like having an element along the screen edge that pops out to overlay the Webview when a user begins a back gesture, tried with both onPress and onPressIn.
But by that time, it's already too late to evt.preventDefault() - and the text selection takes place even though the Webview is now covered by another element, I guess because it's technically still the same event that triggered the overlay. (Also tried evt.stopPropagation in desperation.)
Is there any way to prevent text selection within our Webview when a user uses the back gesture?

Android: presenting a custom layout for text input

I have a task, the task is to modify one of the Android stock applications (Settings app) and change the behavior of text input, meaning that each time the user presses an EditText what I would like to obtain is:
Another Activity/Fragment is started
The new Activity/Fragment has a custom layout including an EditText
When the user is done entering text he can press the Done button on the keyboard and go back to the previous activity, the changes to the EdiText in the custom activity are reflected into the original EditText
Now, I know how to do this, but the point of this is to be able to create something reusable and easy to apply to all the activities/fragments inside the Settings app.
If I had to do it only for one activity I would just use startActivityForResult() when an EditText is pressed or focused.
Any idea how to implement something more generic and reusable?
Thanks

Application level floating views with navigation in Android

I have to show a floating button that will be added in WindowManager so it remain on the top of all Activities. (I have done this part using https://github.com/marshallino16/FloatingView)
When that button is tapped I have to open screen and show detail view and navigate between other views. To achieve this thing I can do following things either adding
1 - PopUpWindow
2 - Dialog
But I cannot provide navigation using either of them. So my questions is.
What is the best way to add multiple views and providing navigation between them while keeping everything above the application that is running it.
How can we add Activity so that it won't pause user application?
You should open Activity and implement all navigation inside it.
Android may pause activities behind, so make your Activity only for part of the screen.
Inside Activity hide floating button and show it again on exit.

Detecting whether Android input Widget changes were made by the user and not by the framework

I have a form consisting of some EditText, Spinner and DatePicker widgets.
I have a Confirm and a Save button. I want the Save button to be initially hidden. When the user modifies one of the form items, I want to hide the Confirm button and then show the Save button.
I tried:
setOnClickListener(). The listener is not called. I believe the widgets trap it to implement the higher-level functions.
The widget-specific listeners like TextWatcher and OnItemSelectedListener. But they are called when the widget as part of the widget initialization. I would like to know if they are called by user activity.
My target is Android 3.2/SDK 13.

How to hide activity GUI in android 2.2

I have an activity here.
I want to click a button and then hide the activity GUI.
That is, GUI is needed and you can hide it by clicking a "Hide App" button. How can i
implement this "Hide App"?
Somebody help! Thanks in advance!
To do what you want within the organizational model of android, your "program" should be written as a service, not an activity. You would then have a gui that is an activity and a client of your service, which can be started (made visible) and paused/stopped (hidden) as desired.
Presumably when your user clicks the hide application button, you're going to want to show something - at the very least a show button, so the user isn't stuck without input options!
So what you really have then is two views, one with the GUI hidden.
Two approaches I can see:
Hide app calls another activity with only the UI shown that you want. When the activity is finished, use Activity.finish() to return to the original activity with the GUI
Look at ViewAnimator and its subclasses (ViewFlipper and ViewSwitcher)
You could also just enable the screen lock. ;-)
That would automatically lock the screen (hide your app). And when the user unlocked the screen (using the UI and a gesture the user is already very familiar with) he would automatically get back into your app without you needing to do any extra coding.
The additional advantage of the screen lock is that it can be be password-protected, so if the user has his screen-lock already set to a password, instead of a slide bar -- he would just get the slide password thingy.

Categories

Resources