Coder Social home page Coder Social logo

conductor-glide's People

Contributors

mkhytarmkhoian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

d-for-real

conductor-glide's Issues

Image doesn't load if loaded from LiveData.observe callback

In my controller's onCreateView I'm observing a LiveData and in that observer loading an image with Glide. Like so:

override fun onCreateView() {
    data.observe(this, Observer { glide.load(it.image).into(imageView) })
}

If I replace the observer with just Glide.with(context).load(it.image).into(imageView) it works fine.

That glide variable is from an implementation of BaseGlideControllerSupport:

    override fun getGlide(): GlideRequests = glideSupport.glide

    private val glideSupport by lazy {
        object : BaseGlideControllerSupport<GlideRequests>(this) {
            override fun getGlideRequest(
                lifecycle: ControllerLifecycle,
                requestManagerTreeNode: RequestManagerTreeNode?
            ): GlideRequests {
                return GlideRequests(
                    Glide.get(context.applicationContext),
                    lifecycle,
                    requestManagerTreeNode!!,
                    context.applicationContext
                )
            }
        }
    }

My controller extends the LifecycleController from the main Conductor project.

[UX Issue] What happens if I don't destroy glide?

  override fun getGlideRequest(lifecycle: ControllerLifecycle, requestManagerTreeNode: RequestManagerTreeNode): GlideRequests {
        val context = HungryApp.appContext
        setDestroyWhenDestroyView(false)
        setDestroyGlide(false)
        return GlideRequests(Glide.get(context), lifecycle, requestManagerTreeNode, context)
    }

I have a ux issue when backpress. if set all destroy to true.

setDestroyWhenDestroyView(true)
setDestroyGlide(true)

when the user presses back button they can see the Product Image resetting its state to original place holder before the screen is destroyed.

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.