Creating such an Android UI [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am attempting to create an Android UI similar to the one shown above.
This type of layout is fairly common in websites and I want to recreate this for my Android app.
It is a list of names and when you click on a name it expands and displays some customized UI.
Can someone please guide me on how this can be achieved ?
To be specific, the expansion when clicking a name so that a new View is displayed.

Have a look at the ExpandableListItemAdapter class in the ListViewAnimations library.
You can seperately specify a header View and a content View. The content view smoothly animates in to sight when clicked.

I have done something very similar, you can use the code provided here (check src/com/udinic/expand_animation_example/ExpandAnimation.java) to achieve exactly what you are looking for.
Sample code:
final int animationTime=250;
ExpandAnimation expandAni = new ExpandAnimation(expandingView, animationTime);
expandingView.startAnimation(expandAni);
Note that the code would call requestLayout() to perform the animation which is computationally expensive. So if you are trying to apply this animation to a complex LinearLayout encapsulated in a ScrollView, the result would be choppy. In this case try to use ListView to populate the screen instead.

Related

Android: How to add TextView Dynamically? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm building a surveying app. On the creation of survey activity, I am having trouble how to implement the number of options to a particular survey?
For example let's say I want to ask:
What is your favourite Programming language?
1. C++
2. Java
3. C#
4. Python
5. I hate programming!!
Then in the next survey, I want to ask a Yes or No question:
Do you like ice cream?
1. Yes
2. No
See, options vary depending on the survey question; therefore, I am thinking of first asking the user how many options they would like to have then show them. However, I am unsure of going about doing so.
Can anyone please help me? I'll greatly appreciate it.
You can add TextView dynamically with this code
TextView textView = new TextView(<context intance here>);
textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
textView.setText("Sample Text");
Then add created TextView instance to your view container:
viewContainer.addView(textView);
You can change your view's layouting by its LayoutParams.
if you have radio buttons to chose from your answers you can try to only show as many radio buttons as many answers you have with a if clause

Android Multiple radiobuttons get selected after scrolling list. Changes its state [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
have listview with each item contains one textview & one radiogroup. Radiogroup contain two radio buttons. My question is when i scroll the listview multiple contact get selected(i.e. as I scroll after selecting some radio buttons, state of radio button changes means checked becomes unchecked) so how should i overcome this. Please do help. I need it.
Try this link.
It has very nicely explained about this issue.
Hope this may helps you... :)

Highlight items in ListView [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In my App I have a ListView, which is fed by a LinkedList.
Some of the Elements in the List are "kind of special". which is why I want to highlight them in some kind.
E.g. underline their names or have them differently colored.
Does anyone know how i can achieve somthing like that?
One thing that you could do is to make your own adapter by extending BaseAdapter.
Then, in getView(), you can check the contents of your LinkedList and based on that you can return an appropriate view with underlined text, different colors and so on.
here is a tutorial: http://www.javacodegeeks.com/2012/10/android-listview-example-with-image-and.html

using breadcrumb in Swing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am working on a project where user faces 5 frames . Each frame contains the data to be filled . so when he completes the one frame and goes to next frame it has to confirm that the data is filled for that I want to use BreadCrumb(or progressbar).
so how to create a BreadCrumb(or progressbar) in java swings
I want to make similar to below image in java swings
I suggest that you
create 5 images to use as your breadcrumb images. Any basic image editing program can help you with this.
Put the 5 images in ImageIcons, and put the ImageIcons in either an array or an ArrayList<ImageIcon>.
Display the current Icon in a JLabel that is part of your GUI. You can easily set the JLabel's Icon via its setIcon(Icon icon) method.
I would strongly urge you not to use "5 frames" since that is an irksome user experience and is not what the user experiences when using a professional application.
Instead create 5 JPanels that handle each part of the process.
Swap these JPanels in and out of your GUI via a CardLayout-using JPanel, one that I assume will sit on top of the JLabel that displays your breadcrumb ImageIcons.
When you swap a JPanel view, you also swap an ImageIcon. This swapping will likely be done in the same method.
Remember that it is Java "Swing", not "swings". Good luck.

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