Code Monkey home page Code Monkey logo

Comments (6)

thisismultitaskingid avatar thisismultitaskingid commented on July 17, 2024

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

from resplash.

b-lam avatar b-lam commented on July 17, 2024

@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.

from resplash.

thisismultitaskingid avatar thisismultitaskingid commented on July 17, 2024

from resplash.

KentaKariya avatar KentaKariya commented on July 17, 2024

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 😅

from resplash.

b-lam avatar b-lam commented on July 17, 2024

@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.

from resplash.

KentaKariya avatar KentaKariya commented on July 17, 2024

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?

from resplash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.