There is a custom listview in my activity. Each item of list has image button at the left hand side. I want to show popup window when button is clicked. And popup window has some image buttons like chat message.
I want a popup window like when QuickContactBadge is clicked.
How can I do this?
and can I use QuickContactBadge (In list my own contacts not phone's contact)?
Any help....?
You can create a custom dialog by extend a Dialog and putting your own custom View inside it with any buttons that you like.
Update:
I just checked (visually) the QuickContactBadge. The problem in your case will be how to properly position it so that it will so that it will point to the correct listview item that user clicked. Possible solutions:
Put your existing listview layout inside a FrameLayout and put an empty AbsoluteLayout over it. When listview item is clicked, calculate the coordinates and draw
QuickContactBadge in the AbsoluteLayout at the right coordinates so that it would point to the clicked item. Never tried this so I don't know how well this would work:
Use ExpandableListView which expands the item when clicked. In this expaned item you could show the QuickContactBadge or just some buttons that you wish.
Personally, I'd go with 2nd approach.
Related
i have a list view with 3 buttons it. the functionality of those button would be that when clicked that single view should expand in height to show a text box. i havent done any code in the CustomAdapter of that listview to provide any reference to it.
What you just described is an ExpandableListView.
EDIT: Also, you can have the TextView's visibility set to "gone" and just become visible when the button is clicked.
this pop up should bottom aligned and comes when I tap on any grid item and in the form of columns... like for 5 images first row should show 3 images and second row should show two..
I have tried with alert dialog, but it is coming in list view ...
i am trying with split action bar but it may contain only system images..
I have tried all possible things. but i am unable to get solution..
please help me...
Does any one know how to do that??????
You can set a touch listener to the grid view - setOnTouchListener.
Override method onTouch and implement your logic to show/hide the popup.
Remember a popup could also be a layout in your view for which you change the visibility from GONE to VISIBLE and viceversa. To have a better result do that with an animation (maybe fade + translate).
I am working in android application which is using listview to populate its data,In the design firstly list is shown with some of items, and on clicking on the cell it expands to show another part of the cell layout whose visiblity is "gone" on the creation of the cell.
Now if user clickes on the last cell of the listview it expands to show its invisible layout but that goes below the visible window of the screen.Now what i want to do is if on expanding the list cell its content goes below the visible window scroll listview up automatically to show complete cell.
Please suggest a best way how can i achieve it?
Try this, not sure if it will work, but give it a shot:
listView.scrollTo(0, listView.getHeight());
Let me know.
I have a listview with custom listitem. I have bunch of textviews in Relative layout. And when I click on listitem it goes to different screen. Now I have added 3 buttons and toggle button to list item and I CAN NOT CLICK THE LIST ITEM. What am I missing :(
set focusable property of all the buttons to false and so that you can click on list and also touch event for all buttons will work
When the user clicks the row, the ListView will look for a widget implementing the Checkable interface. The RelativeLayout does not. An easy way to do that is simply to create your own CheckableRelativeLayout class. See http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/ for a full tutorial with code.
Also, the buttons and other items in your row layout should not be focusable. You can see other SO questions: Android Row becomes Unclickable with Button
I want to show a ListFragment when user click a button on the top right corner.
When user select a item in this ListFragment or just touch the screen outside the ListFragment, the ListFragment should be disappeared.
Just like below
screen shot image
(i don't have rights to post an image, so I have uploaded it to my blog)
I tried to use DialogFragment to wrap the ListFragment, but I find no way to set the dialog's position, it always shows in the center, I need to display the ListFragment on the top right of screen.
And I also tried to use PopupWindow, but I don't know how to set a ListFragment as popupwindows' contentview.
So, my questions are:
how to show a ListFragment when user click a button, this
ListFragment should be shown at top right corner.
how to hide this ListFragment when user select a item of this ListFragment or touch
the screen outside the ListFragment.
Sorry for my poor English :)
Place all your view in a RelativeLayout and set these attributes to your ListView:
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
Also change the size of your ListView programmatically on any event you like.