Like button
please allow like on double click...
most of the people just download it and skip to like the photo which i think is very unfair woth photographers
@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.
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 .
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 😅
@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.
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?