I need to makean animation on dialog like when user clicks on any item of list view , a pop up should open from that list position and should expand to full screen and similarly when user closes the dialog it should shrink down to the position it was clicked !
i have tried many examples but none worked for me !!
Please refer this link for creating Custom Dialog with animation effect. Also you can make use of android transition refer here.
For each list view item click you can open up this dialog from the adapter click event
Related
I've created a context menu for my recycler view items. In the menu I have Watch (like favourites), Share and Hide. Now what I want to do is get the specific position of the Recycler View and check if the Watch or Hide button has been pressed. How can I go about doing this? I've used a flag but that just checks the whole Recycler View so that doesn't work.
I can show source code on request too. I know it needs to go in my Adapter but can't figure out the position of it
Thanks in advance.
just add a boolean variable in your List to check whether to show Watch or Hide button.
use getAdapterPosition() method when user clicked the clicked on button and then use that position to update value in your model class.
I have no idea on expandable list view concept in android. Above is the image i want to create. When user clicks on it, it should expand with child having check box. Even the group should have check box. When i click on group check box, all the child check box should be selected. I checked other posts they are using it in activity. How to implement this in a dialog? Thanks in advance.
How to implement this in a dialog?
You can create a Dialog using a DialogFragment and override onCreateView(). This allows you as much freedom with the Dialog UI as you have in any Activity, so the other SO posts you read will be very helpful there.
To get you started, see this guide on dialogs.
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?
I have a GridView which display a small custom dialog (with data about that cell) when a cell is clicked.
Dialog is shown in a OnItemClickListener() set for the GridView.
Dialog has setCanceledOnTouchOutside(true).
Right now:
I click on a cell
dialog is shown
I click outside the dialog on another cell
dialog is closed
I click again on that another cell
a dialog for the new cell is shown
I would like for a single click outside a dialog to:
close this dialog
show the dialog for the new cell (trigger OnItemClickListener of the GridView)
I was looking at different combinations of
onInterceptTouchEvent()
onTouchEvent()
dispatchTouchEvent()
but I wasn't able to accomplish that.
Any ideas?
Thanks
we can't perform such kind of operation in android,
because while your dialog is open at that time your activity is in onPause() mode and the most forGround view is your dialod,
you must have to go back in your activity view (means start onResume()/onCreate()) then after you perform your task for open the second dialog.
I have 4 items in my list view in these 3 are text view and one is button in my case i have to open 2 new activities from a single list
1st from on button click
2nd from on list view item click
but when i add the button in list view list click is not working, also i am not able to handle the click of button.
I am using BaseAdapter class to set the data in list view.
Please help me to solve this.
Thanks.
Or you can just set to you button
android:focusable="false"
In this case you ListView will fire onItemClick action to listener, and the Button will also work when it clicked.
The previous answers to this didn't worked for me.
Add to your row's root layot android:descendantFocusability="blocksDescendants", this really does the trick, the buttons keep working and the list keeps firing the event.