Resplash icon indicating copy to clipboard operation
Resplash copied to clipboard

Like button

Open thisismultitaskingid opened this issue 7 years ago • 6 comments

please allow like on double click...

thisismultitaskingid avatar Jun 09 '18 04:06 thisismultitaskingid

most of the people just download it and skip to like the photo which i think is very unfair woth photographers

thisismultitaskingid avatar Jun 09 '18 04:06 thisismultitaskingid

@thisismultitaskingid A like button currently shows up if you sign into your Unsplash account in the navigation drawer. I can definitely look into adding something like double click to like also.

b-lam avatar Jun 09 '18 14:06 b-lam

thank u ...well i have resplash account

On Sat, Jun 9, 2018, 8:01 PM Brandon Lam [email protected] wrote:

@thisismultitaskingid https://github.com/thisismultitaskingid A like button currently shows up if you sign into your Unsplash account in the navigation drawer. I can definitely look into adding something like double click to like also.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/b-lam/Resplash/issues/46#issuecomment-395973843, or mute the thread https://github.com/notifications/unsubscribe-auth/AmOVmoYaO0-pyJf6Iqyn0bytT7jcTDhrks5t69wwgaJpZM4UhLJN .

thisismultitaskingid avatar Jun 10 '18 06:06 thisismultitaskingid

I don't have a lot of experience contributing actual code to open-source projects and although this is a pretty old issue I think that some people are still missing the feature. I'm pretty new to Android development but maybe this could be an approach to implementing the double-click to like feature: https://gist.github.com/Kenta1561/2d869cf2828d5d5cbbc19704011ef8f4

I know my test implementation is pretty rough atm but I hope at least it works as a conversation starter 😅

KentaKariya avatar Jul 27 '20 15:07 KentaKariya

@Kenta1561 Your implementation actually looks pretty good to me. I know this has been a pretty long standing issue and I would like to get it done one day. The main thing that is holding me back is Google paging library (https://developer.android.com/topic/libraries/architecture/paging). Currently they don't allow data to be modified in the recyclerview/adapter after it has been loaded. So modifying the "like state" of a photo would not persist unless all the data gets reloaded. I would like to keep using the paging library since it does simplify things and has pretty good performance but is definitely a little restrictive right now. Let me know what you think.

b-lam avatar Jul 27 '20 15:07 b-lam

So if I understand this correctly although an API request can be sent to like the photo upon a double tap by the user the Boolean liked_by_user cannot be set to true because it would change the state of the object, right? The only workaround that would come to my mind rn would be to request the like state from the API when PhotoDetailActivity is launched which I guess is pretty inefficient...

Edit: If the state of the displayed objects can't be altered, isn't it a possible approach to store the likes in e.g. another list until the view is not shown anymore and then alter the like state?

KentaKariya avatar Jul 27 '20 16:07 KentaKariya