Animating the image in recycler view to fullscreen through dialog box - java

In RecyclerView, how can I expand the image such that when we click the Whatsapp profile image of others, it shows a complete image in a dialog box? How can I achieve that in RecyclerView? with that transaction animation as well.

Use a Dailog Fragment with a single ImageView in the center Tutorials here
When the user clicks the recyclerView item, pass the imageView of that specific item to the Dialog Fragment using SharedElementTransition. ( SharedElementTransition Tutorial here)
This should do the trick.

Related

Recycler view adapter remove items

I have two activities: HomePage and MyFavorites. Both have recycler views with items (similar to facebook posts) each item has a button, when you click on it, the item will be shown in the recycler view for MyFav activity. The code for when the button is clicked is in the Adapter class for the recycler view (both activities use the same adapter). Now when a user click on the button for the second time (while the user is in MyFav activity) it means that this specific item should be removed from the recycler view in MyFav activity, but when the button is clicked for a second time while the user is using/opening the HomePage activity the item shouldn’t be removed, the button will turn from red to white ONLY . How can i remove the item only from the recycler view in MyFav activity without removing it from the HomePage activity (since both use the same adapter for their recycler view) without making a new adapter?
If i create separate adapter class for each activity, is it good practice? Since the same code will be duplicated twice with minor changes.
Note: the button (Fav button) is a checkbox with a heart shaped icon, the color is initially white, it will turn red when clicked for the first time, and white when clicked again and so on..

How can I make checkboxes visible for all recycler view items without calling notifydatasetchanged?

I have been trying to make a photo gallery app and I want to select multiple photos.
The problem in the current implementation is that when I try to longpress to make checkbox visible, the thumbnails are reloading for a fraction of second.
This is because I am calling notifydatasetchanged() after I longpress so that onbindviewholder can load the checkboxes on the screen for every recycler view item, which in turn reloads the thumbnails.
I am using glide to load thumbnails.

How to handle Swipe and Click event in the same cardview - Android

I am working on a android app, which has card swiping functionality like Tinder. In each cards, I'm having a imageview, which on click, opens in full screen. My problem is when I try to swipe, the image view considers it as a click event and opens the image in full screen.
I'm having my code for imageview onclick in the card swipe adapter and the code for swipe in the main activity that uses the card swipe adapter. How can I restrict the child view from consuming the parent's event?

ImageView Onclick Animation

Below is a picture of my app, I am currently using a modified version of this app to show my expandable content. Now my problem is with my ImageView, I currently have 3 layouts, one for the main dialog (with listview), one for the listview title & arrow and one for the item details (item row once expanded). I want to add animation to the ImageView so when you click the image or title textview, the list will expand and animate the change. How can I do this? I cannot get the onClick to work because it doesn't know there are 2 imageviews, it seens only one...
I will assume that your ImageView is this arrow inside your ListView element (because you didn't write it clearly enough).
You probably shouldnt try to attach onClickListener to your ImageView at all (nor to your ListView element title). The good way of implementing what you want you achieve would be to use ListView's onItemClickListener to detect clicks performed on specific items inside your listview, and then expanding appropriate expandable content.

How to change textview dynamically in the slide menu?

Is it possible to add textview to slide menu and change it dynamicly?
If you talk about the NavigationDrawer, it is just a ListView so It is easy to change one of the items dynamically.
See Creating a Navigation Drawer and How to refresh ListView.

Categories

Resources