Addable edit text android material d [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I was looking for an answer how to let user add more text field depending on his request... As i guess it comes from some kind of list but how to earn similary to this below efect ? addable edit text
My target is to create some kind of a formula where user adds his ingredients and their amount, everything has it's own Type like chicken is a meat, potatoe is a vegetable etc.
I want to make it a part of a material design project so it should fits to it.
I dont request for a full code answer(what would be great anyway, i try to learn it in the best way), even a tip is significant for me.
Thx for help :)!

Depending on how many items can be added, a ListView or probably better a RecyclerView (better/easier for animations than ListView) might be ideal. However, if you only see a user having between 1 - 20ish ingredients an easy approach might be just to dynamically inflate items.
When the "Add" button is pressed, use LayoutInflater to inflate a new view which represents the ingredient and then add it to the parent. In your layout xml, add android:animateLayoutChanges="true" to your parent layout. Now, when the new ingredient is added it will do a nice insert animation. It will also create a nice animation when you remove a child from the parent.
This Android Developer Article might be helpful too.

Related

Is it possible to put a button in a NatTable? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
enter image description here
Is it possible to put a button in the table like the attached image?
NatTable is a custom painted table control. Putting real buttons in the table is possible, but actually does not really make sense and could even lead to resource issues in larger tables.
You can actually render anything if you have a corresponding painter. And for a button you of course also need the action binding. NatTable has the ButtonCellPainter to render a cell as a button. But actually the implementation to mimik the button press is a bit outdated IMHO. The corresponding example should give you an idea what you can do and how to do it.
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/tree/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/Rendering_cells_as_a_link_and_button.java

Redesigning a Java Radio button [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a student and still learning a lot about Java, but I have a pretty good grasp on the basics. Right now I am trying to figure out a way to recreate a radio button to mesh with the UI design for an application I have been commissioned to build.
The entire application is meant to be designed around the Star Trek LCARS interface (Bold bars, distinct color changes, no check boxes or radio buttons). I need to incorporate radio buttons into the design, but I have been unable to find any resource that will allow me to design a radio button without that distinctive filled/empty circle.
I already have a good idea of how I need to work the design. The selected item will change to a different display color with the mouse click or touchscreen tap. Selecting another item in the same group would deselect the original and select the new option, while trying to select the same item would unselect all choices (Select an undisplayed, "default option").
The problem is pure aesthetics, but it is important to the customer.
Is it possible to create a label (or other component) and have the ActionListener "transfer" the user interaction with the object to a radio button? In other words, the user clicks on the selection label and it fires off the same commands (change item/text color, play sound) and also fires off a command to set a designated radio button to either on or off?
well first of all... Everything is possible..its just a matter of how much time/effort you want to put in.
If I read that right..You have suggested creating a hidden radio button that gets information passed to it. This would work but is probably not the best way to design it.
I would personally just make an integer and call it mostRecentLabel or something to that effect and if you have 4 labels you would just keep track of which label was "turned on" with your mostRecentLabel variable. Then just put a function in that responds whenever a label is clicked to update your mostRecentLabel and this would update the display accordingly

Animated drag and drop in JTable [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Do you know some way to make drag and drop in table more user-friendly? For example: row stick to mouse on drag, and other rows swap places when dragging. Can you recommend me some library for this ?
I'd suggest you take a little time to have a read through The Rabbit Hole which has some excellent articles on the topic of drag'n'drop.
These are most of the articles of interest
Smooth JList Drop Target Animation
Smooth Tree Drop Animation
My Drag Image is Better than Yours
Dead Simple Drags
Fancy Drops
Drag Images for Everyone
Drop Target Navigation, or you drag your bags, let the doorman get the door
Swing Drag Images (Improved)
Well, Java libraries are usually not good really at the "animation" thing. There is a way to do this using the D and D libraries Java comes with but it would require swapping the values of the rows, rather than swapping the rows themselves.
Java is very limited at this kind of stuff. Either you hard code your own library, or use some other language that has libraries for tasks like these.

Should I make several views or pass parameters to a single view? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am unsure whether I should:
Make one view where I use view-parameters
Or make one view (seperate xhtml page) for each action
The list I have now displays all the questions that I have in the database, and I have added three buttons that currently toggle between 'All', 'With image' or 'Without'.
Now I also want to toggle between 'Submitted', 'Approved' and 'Rejected', and possible still have the option to toggle between showing all questions, only with images or without images.
I can make one backing bean and one view for each, or I could do something like this:
www.someurl.com/path/questionlist.xhtml?toggle=all&status=approved
It's a matter of taste but i like to think of path parameters as distinguishing between different resources and of request params as of options.
So if your 'submitted', 'approved' and 'rejected' questions are separate entities do separate views for them.
You can experiment with path variables and friendly urls and use
www.someurl.com/path/questions
to list all questions and
www.someurl.com/path/questions/submitted
www.someurl.com/path/questions/approved
www.someurl.com/path/questions/rejected
and use 'all', 'with image' and 'without' as parameters (as they don't esentially change what you're viewing just how you view it).
If not, use them all as parameters.

How to create a helpful tooltip in Android [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to create a tooltip like thing in Android to help show my users what something is, as people have told me they don't know what it is. For an idea of what i'm after here is a drawing:
This is the QuickAction UI pattern. Take a look at:
GreenDroid, a collection of Android widgets - namely the QuickAction... widgets such as QuickActionBar, QuickActionGrid etc
How to create a QuickAction dialog in Android
another alternative would be "super-tooltips":
https://github.com/nhaarman/supertooltips
here's a demo of it:
https://play.google.com/store/apps/details?id=com.haarman.supertooltips
There are several libraries available that will assist you in implementing tooltips in Android.
I recommend the Android Tooltip library which you can find on Github
Example usage:
Tooltip.make(this,
new Builder(101)
.anchor(aView, Gravity.BOTTOM)
.closePolicy(new ClosePolicy()
.insidePolicy(true, false)
.outsidePolicy(true, false), 3000)
.activateDelay(800)
.showDelay(300)
.text(R.string.hello_world)
.maxWidth(500)
.withArrow(true)
.withOverlay(true)
floatingAnimation(AnimationBuilder.DEFAULT)
.build()
).show();
For anyone just joining us from searching this.
This is a better Holo solution https://gist.github.com/romannurik/3982005
You could use android-formidable-validation's .betterSetError() feature, customising the ErrorPopup balloon's background drawable and the error exclamation mark icon that gets set as the drawableRight in the EditText. To fine tune to your requirements you'd need to play with the code that lays out the ErrorPopup.

Categories