MikeOrtiz / TouchImageView

Adds touch functionality to Android ImageView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatibility between Viewpager2, TouchImageView and BottomSheetBehavior

JorisBodin opened this issue · comments

I use viewpage2 and for zoom, move the photo and slider, I followed your example here: https://github.com/MikeOrtiz/TouchImageView/blob/master/app/src/main/java/info/touchimage/demo/custom/AdapterImages.kt
But it is incompatible with BottomSheetBehavior

The exemple is here: https://github.com/JorisBodin/TouchImageView/tree/bug-viewpager2

device-2021-01-25-181758.mp4

Is there a solution for this case? Thank you in advance :)

Simple solutions are always the best and here is the code 37620df

Please consider to buy me a coffee

class ViewPager2ExampleActivity : AppCompatActivity() {

    public override fun onCreate(savedInstanceState: Bundle?) {
        ...
        binding.bottomSheetFileInfos.setOnTouchListener { v, event ->
            true
        }
    }
}
fixTouch.mov

@hannesa2 Big thank you :)
It's perfect et very simple. I was looking for a more complicated solution ...