Aghajari / ZoomHelper

ZoomHelper will make any view to be zoomable just like Instagram pinch-to-zoom
Apache License 2.0
247 stars 21 forks source link

ZoomHelper with multiple fragment #5

Closed gauravbansod-retailogy closed 3 years ago

gauravbansod-retailogy commented 3 years ago

When using zoom helper in activity with multiple fragment , when navigating to new fragment to same activity , it holds instance of previous fragments view , ZooomHelper.release() not working

Aghajari commented 3 years ago

Hi @gauravbansod-retailogy , check this : https://github.com/Aghajari/ZoomHelper/issues/4#issuecomment-725887938

mohitdholakia commented 3 years ago

Hello I am facing this same issue I have also tried the suggested link above but in case of multiple fragments on the same activity it causes this issue

Aghajari commented 3 years ago

Hi @MohitDholakia , could you share your codes here? or attach a simple project..

mohitdholakia commented 3 years ago

@Aghajari I have used one main activity which contains four fragments and below is the sample code for Main activity

override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        return ZoomHelper.getInstance().dispatchTouchEvent(
            ev!!,
            findViewById<FrameLayout>(R.id.aBottomNavigation_frame)
        ) || super.dispatchTouchEvent(ev)
    }

Here every time I switch fragments zoom view contains an old zoomable view so on zooming for first time in another fragment incorrect image will appear

Aghajari commented 3 years ago

Hi @MohitDholakia , As i said before, This should solve your issue : #4 (comment)