popup layout in android? - android

I was trying to make my UI as neat as possible,
The user should enter some values into a circuit diagram,so I was trying to make the user click the resistor for example, then, a pop-up window appear with an EditText field in it for the user to enter the value of the resistor.
So far I was able to do that by using two separate setContentView()s, one for the circuit diagram and the other holds the EditText field, but I want the layout with the circuit Diagram to be visible in the background while the pop-up is the one in focus.
something like this (random example from the web):
http://blog.itechtalk.com/wp-content/2010/10/SMS-Popup-1.png

You are looking for a dialog. See creating dialogs.

Actually smsmpopup uses an activity with theme dialog in it's manifest. Check the src code.

yes.. u want something as a Dialog... but if its an activity.. u can set this paramenter in the androidmanifest file..
android:name=".Pick_Color"
android:label="Pick a Color !"
android:theme="#android:style/Theme.Dialog">
this will make the screen as neat and Dialogish as possible

Related

Android Create Custom Keyboard

Board
I want to create a custom keyboard like below, where the icon will be there in suggestions, on clicking that will open a separate view in the key I attached screens, I don't know how to start
And also there should be a edit text in it.
I should be able to enter text in both places
Here
is custom keyboard sample, You can get the idea about how to start

Android: Can I put text data in a 'textView' of another app

I have a service that shows an always-on-top clickable floating button on screen irrespective of the context. (User can switch apps and the floating button will always show)(already implemented)
I want to implement such that, whenever user clicks on an EditText, in ANY app, and click the floating button, it should put some text in that EditText.
First I want to know if this is possible atleast? If yes, How!
Let me know if the above para is not enough to make sense what I meant.
Any help will be appreciated.
The only way to do this is create a service that works as an input service, say a custom keyboard.
You need to take permission android.permission.BIND_INPUT_METHOD to do so.
Actually, you do not have rights to do so. But there is a way of doing which is by creating an input service. InputMethodService | Android Developers

Android : Editing values using alert dialog

In my application I currently have an xml layout that is re-used to enter information 6 times (these are turns in a game). This works fine. At the end of the round I present a screen that has a summary of each turn. I want to implement a button beside each turn to "edit" that turn. There are 3 possible things that can be edited. Ideally an alert dialog or something like a "popup" would be idea for this.
Would I be best off to have 3 buttons per "turn" for editing or is there a way to do this with a popup?
Thanks for your input on this matter.
You could list each turn and it's information with a single edit button next to each. When the edit button is pressed, create a new activity (intent) that prompts for all three pieces of data.
You have several options (and probably more I'm not thinking about). If these are in a ListView (or even if not) you could use a ContextMenu. You could have options in here to change the selected item or others. This would show a popup when the user long clicks the item
A PopupMenu can give you a similar effect that can pop up a list of options when the user clicks on a Button. Note that this requires API >= 11
You also could use an AlertDialog, as you mentioned. But just from what little I know about what you are trying to do I'm not sure this is what you would want.
Again, I don't know enough details about what you have or want but I would say that one of the first two options would suit you best. As far as one Button or multiple Buttons, that depends on the layout that will work best for your app, I suppose. You certainly could have one "Edit" Button which uses something like a PopupMenu and allows the user to choose what to edit. I hope this helped a little.

Android : How to put a (Hint) link that pops up a window

I am developing an Android application and I need to put a link beside a Text Edit in a form.
The link will pop up a window that holds a tool tip for the user.
EDIT : I want to put some sort of a link beside the text field and, when the user clicks on this link, a pop up window appears and tells him how to fill this text field.
How can I do this in Android ?
Can anyone help me please ?
The "link" can easyly be created by puting a TextView and adding an OnClickListener.
About the "popup":
Have you had a look at Toast-messages? They seem to be doing exactly what you want to do.
Toast toast = Toast.makeText(Context context, String yourMessage, Toast.LENGTH_LONG/SHORT);
toast.show();
If you had, here are some other solutions that could do what you want:
What about a solution with some kind of Dialog? Eg. an AltertDialog could open up, showing the tip, but the User would have to press "OK" to close the "popup".
Another solution, which is also quite ugly would be playing with visibilities. the "popup" would be present allt he time, but only visible if the link is clicked.
How to change visibility of layout programaticly
use android:hint="Your hint" for your EditText to show hint.

popup windows in android?

Pretty new to android so excuse me if this is a really obvious question.
Say my application has a bunch of TextViews, each one showing the attributes of a certain product (name, price, etc). I have a button next to each of these TextViews labeled "modify".
How do I make it so that when I press the modify button next to a certain attribute, a popup window with a space to enter text into comes up so that the user can enter text into this box and then have the actual attribute listing on the original page change? Actually I just need a push in the right direction with creating this popup text field... not sure if there is already some built in functionality for this or if not, what would be the best way to create this kind of thing.
Thanks.
Why not have the modify button set TextEdit.setEnabled(true); and then change focus with TextEdit.setFocus? Note that both of these are inherited from view
If you really want a dialog you might want to looking into the AlertDialog.Builder. I know you can use it with buttons and radio buttons, but I'm not sure you can get it to work with a TextView.
Use a code like this for the input popup: Android dialog input text
In the positive button handler, set your edittext content programmatically like this:
myEditText.setText(value).
As simple as that. The only difference with a standard GUI framework is that you don't retrieve the value as a result of the popup function. Instead, you must provide an action handler.

Categories

Resources