how to create view that expand & shrink on click? - android

I have to display list of items along with a plus(+) sign , on click of plus sign list should expand & on click again list should shrink

You can do this but would need to do more work
as you want to show
name ,address and plus sign should changed to minus ,
you would require to make a custom list view and what you can do is use
when plus button is clicked in list
nameText.setVisibility(View.VISIBLE);
adress.setVisibility(View.VISIBLE);
btn.setBackgroundResource(R.drawable.minus);
and when minus button is clicked
nameText.setVisibility(View.GONE);
adress.setVisibility(View.GONE);
btn.setBackgroundResource(R.drawable.plus);

If you want to create a tree view like windows, then it is not a UI element that is supported by android. The similar to this is the ExplandableListView element.
Although in one business application I have found this http://code.google.com/p/tree-view-list-android/ project that does exactly what you want.

Related

How to make Scrollable List of new page when I click Drop down Snipper in Kotlin

I want to make List for selecting region when user register on app.
So What I want to implement is if user click drop down menu
I want make it go another new page, not list dropped down below.
New page will have Scrollable list.
And I click this Scrollable list, I need to get this data.
So I guess I need to use RecyclerView to make Scrollable list of new page.
And Each component of RecyclerView should be button. (is that right?)
1) But what I don't know is how to make Dropdown Snipper as Clickable Button.
Snipper can't use setOnClickListener.
Should I make Button to have Text and Arrow manually?
In React Native It had some library for this purpose.
2) Is that correct Kotlin doesn't provide such library?

Customize dropdown (Picker) list in xamarin.forms

I am working on xamarin.forms. I am creating an app for android. In app I have a dropdown list. I am using Picker for it. I customized it to look like dropdown. Now I need to make the first Index item to nonselactable. Means user can not select the first item. If user click on it nothing should happen. But currently when user click on the first index dropdown gets collapsed.
One more thing that I have to add in dropdown is a Cross button at index 1. Means at index 1, on left side there will be Cross button and at center there will be text like Select item. And this whole row should not be selctable. If user click at cross button dropdown should collapsed.
Anyone have idea how I can do this?
You can use listview for dropdown and control its visibility as per need.I faced similar situation where I customized list view to enact dropdown.There is another thing I want to know about Picker.Does your picker accepts or adds string only or you could customize it to accept views or controls?

Create List View Dynamically in Android

I am developing an Android app. In that I want to add List view at run time on Text click.
Here is the image of one demo.
By default there are 3 options in "List". When user clicks on Add new List option then new List should be added into header with Work, Play and buddies option. How can I do that?
Done it...This is the link...Visit http://code4reference.com/2012/09/android-activity-layout/

How to Call Button from List view inside fragment layout

Hello i have problem with button not updating,
I had used sample search , when user search any word ,
I had placed star button in right aligned in
I means to say suppose i search something and list view opens and at right star bookmark is there so on click it must show.
You can't get any useful replies without posting your source code.

android tablerow edit gestures

enter code hereIn my android application , there is a populated tableview with favorite products. There is a delete functionality to delete products from the list. How can i show this to user that he can delete products? like in ios there is a method called commiteditingstyle.
What are the options in pure android way to edit tablerows
longclicklistener and show a delete button on table row
show a checkbox on edit button
any other
That's really just up to your imagination. I think typical android UI would just use the flick to remove, but some like the longpress or a button, some use an "Edit List" option which adds a checkbox next to each item on the list and then gives the user an option to delete selected items(best for managing large list or batch quantities).
Hope that helps! Good Luck!

Categories

Resources