hsmnzaydn / image-zoom-view

Imageview zoom library for android
Apache License 2.0
55 stars 12 forks source link

minSdk Version seems to be incorrect (in some circum states) #6

Closed Hatzen closed 3 years ago

Hatzen commented 3 years ago

First of all thank you for your Lib!

I am trying to run this lib on a Firephone with SDK 19 and the app crashes when opening the zoom activity.
I am getting following exception when clicking onto the ZoomImageView which was created programmatically.

java.lang.ClassCastException: androidx.appcompat.widget.TintContextWrapper cannot be cast to androidx.fragment.app.FragmentActivity
        at ozaydin.serkan.com.image_zoom_view.ImageViewZoom.onClick(ImageViewZoom.java:131)
        at android.view.View.performClick(View.java:4768)
        at android.view.View$PerformClick.run(View.java:19073)
        at android.os.Handler.handleCallback(Handler.java:755)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:5266)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:826)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:642)
        at dalvik.system.NativeStart.main(Native Method)

After some research it looks like the lib does not support minSdk 15 (or at least 19) at least with support lib version used in version 23.0.0 and above.
Full context of crash and solution:
https://stackoverflow.com/questions/38814267/android-support-v7-widget-tintcontextwrapper-cannot-be-cast

Hatzen commented 3 years ago

Fix implemented and tested. Ready for review :)

hsmnzaydn commented 3 years ago

Fix implemented and tested. Ready for review :)

Thanks for your PR :)