Android: presenting a custom layout for text input - android

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

Related

Keeping the soft keyboard open while the user transitions from one view to another

I'm new to Android, and I want to create a user account registration wizard. The wizard will have several steps. At each step, there is an input field where the user has to enter in their information. What I'd like to do is to keep the soft keyboard open while the user transitions from one step to another step. What kind of UI widget can I use to achieve this? Ideally, I'd like to avoid creating separate Activity or Fragment instances.
Basically I have the following requirements:
The wizard contains multiple steps.
Each step has an EditText.
As the user transitions back and forth between steps, the soft keyboard must stay open.
The keyboard will stay up as long as a view that takes keyboard input (where getInputConnection returns non-null) has focus. So make the root view focusable and take a input. Focus it before you transition. Transition. Then focus the new edit text. That should work. (Note: have not tried, but by the rules of keyboards it ought to work).

saving activity state between screen navigations

I would like to save state of an activity when you navigate away from it. For example, you have Activity A with filled in text on it and you navigate to Activity B using an intent. Well when you go back to Activity A using an Intent you lose all the text you had on that screen.
When I use the soft key back button on most android phones, the screens text stays on there, I would like to mimic that method of keeping the text on screen between navigation.
The last thing I want to do is pass parameters between all my screens, there are a lot of forms and the users dont have to follow a specific nav order.

How to put a button on the default keyboard? I want a button that when is pressed, it chance to another activity

I have a EditText in my activity. I want that when the user finish the text, he can move to the next activity without press back button to hide the keyboard. I was wondering if there a way to put a button on softkeyboard to move to next activity.
(Sorry for bad english, its not my native language)
You can't add buttons to an existing keyboard. However, you can suggest a label and id for the custom IME action. See TextView.setImeActionLabel:
Change the custom IME action associated with the text view, which will be reported to an IME with actionLabel and actionId when it has focus.
You'll then have to call TextView.setOnEditorActionListener to provide a custom listener to listen for that IME event where you can then move to your next activity.

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.

Android Floating EditBox

I have an OptionMenu which has single option in it named "Search". When the search option is clicked, it should dynamically add a EditText at the top of Activity window like it has in WebView (browser address bar) so users could search something in my application.
After there would be EditBox, one can write inside it. I also want to have some OnTextChanged like event of that EditBox so do you think it's also available with that View?
I made it myself. I added an EditText on the screen with setting as hidden and on button click made it visible. It worked like a charm.

Categories

Resources