Show and hide multiple textviews - android

I need to show/hide four textviews on pressing four buttons. The functionality is visible in pictures. In iOS I used button. But for android,can I use some sort of list view or something else suitable to thisenter image description here?
!First and second buttons are pressed here while third and fourth are not yet. Again pressing the button that is already pressed,text hides]1

You can use ExpandableListView.
Using ExpandableListView, you can have groups and childs, and you can expand and collapse any groups you want.
For example:
mExpandableListView.expandGroup(groupPosition);
mExpandableListView.collapseGroup(groupPosition);

These is a very good example on Custom ExpandibleList in Github.
https://github.com/tjerkw/Android-SlideExpandableListView
Hope this will help you to achieve smooth animation and collapse.
You need to change the layout as your requirement.
Hope this will help you.

Related

How to connect the Buttons UI?

I struck in Materiel Design and need to connect those two button like the image mentioned below and when i clicked the any one button only the layout should change not the activity, so I googled for this solution but i didn't found any.Could anyone suggest me some possible solutions to achieve this UI.
You want to keep the 2 buttons and a line in buttons as well if that is the case.
Use 2 buttons widgets and keep a view between them as for lining purpose. And fro your question one button only the layout should change not the activity
You can try fragments. On clicking any of the buttons change fragment
you are suppose to use Fragment with viewpager!
you just disable viewpager swipe by this mViewPager.setPagingEnabled(false);
and setSelection when clicked on item
here is a cool library to implement this.Step view

Show/hide a layout on scroll up/down android

I am working on an android application and want to implement a functionality in which I want to show a layout which will contain Like/Comment of that content at the bottom of the page.
I want this layout to be shown when I scroll up the page and hide when I scroll down the page.
I have scene many applications that have implemented this feature, but I have no idea how to implement this feature in my app.
Please check this link of the app which is giving the same functionality which I want to implenment https://play.google.com/store/apps/details?id=com.midsizemango.materialapps
Please help if anyone have idea here, Thanks a lot in advanced.
You need to do the same thing which happens with fab, first create a class extendingCoordinatorLayout.Behavior<View> and implement it like other fab examples. just remember that it won't work on simple listView and gridView.
Also here's a good detailed tutorial for you.
You Just have to set Scroll-Up & Scroll-Down listener of your Recycler view or Scroll View check Reference link.
Now base on Scroll-Up & Scroll-Down listener set VISIBLE / GONEof your footer view either it is LinearLayout or Toolbar with animation.

Swipe and change layout of an element of a listview

I am trying to achieve the following effect on my custom list-view: When the user swipes the list element to right the layout of the swiped list item would change its layout. I have tried the SwipeListView approach from GitHub but i didn't manage to implement that through.
Can you give me any ideas on how to achieve the desired effect?
Also please note that i used a merge adapter for a list-view with multiple headers and sections.
Thanks!
Maybe take a look at this question and the links that it provides to give you some ideas.

List menu that open hidden views in it

I need to create a list menu where each item, when selected, will open a sub area with others controls (see the example image):
I have two possible solutions in my mind:
Have all the item's controls in RelativeLayout with "gone" visibility, and list them in a LinearLayout.
Use the ExpandableListView, but I have no experience with that and I don't know if this might be a proper solution in my case.
What do you think would be more elegant? Do you have other/better solutions?
You can use ListView as well as ExpandableListView to achive your requirent.
I have done some thing by using ListView and slide animation that suits your requirement.
For Complete reference go through my Android blog
http://amitandroid.blogspot.in/2013/03/android-listview-with-animation.html
Thanks,
Both approach would work but ExpandableListView should be better performance-wise.
You must provide a ExpandableListAdpater, with a layout for your group item and another for the subitems.

Android ExpandedListView animation to expand slow and smooth

When the ordinary ExpandableListView expands we usually see just the result that it is expanded. I want to add animation to see clearly that it expands itself a little bit slowly and smooth in order to clerify for user that he clicked on listitem and it opened.
this can be achieve by Accordion component .
have a look on to this link
May be it will helpfull to you.
Thanks
If you want something like the accordion, but only want to have one item expanded at once, and you want to keep using your normal ListView, I would recommend this project: https://github.com/tjerkw/Android-SlideExpandableListView
Yes I am the Author!

Categories

Resources