quentin-st / Munin-for-Android

Watch your munin-monitored servers on your Android devices
https://www.munin-for-android.com/
GNU General Public License v2.0
44 stars 7 forks source link

ViewDragHelper crashes #28

Closed quentin-st closed 8 years ago

quentin-st commented 8 years ago

@MrMitch reported several crashes related to ViewDragHelper in Activity_GraphView:

They are actually related to chrisbanes/PhotoView library and has been documented in Issues With ViewGroups:

There are some ViewGroups (ones that utilize onInterceptTouchEvent) that throw exceptions when a PhotoView is placed within them, most notably ViewPager and DrawerLayout. This is a framework issue that has not been resolved.

Some exceptions are already caught by the HackyViewPager class, which covers the first component. It seems though that the DrawerLayout is now faulty for the remaining crashes.

Unfortunately, DrawerLayouts are automatically inflated by mikepenz/MaterialDrawer library so we cannot replace those. Project's owner said though that this could be possible:

Theoretically it's possible to pass your own DrawerLayout implementation to the DrawerBuilder and use this one. Note the provided layout must follow the same structure as the MaterialDrawer intern one.

Still waiting for an answer, but this seems to be the only way to go. We'd create a HackyDrawerLayout (implements DrawerLayout) that would intercept the exceptions. Let's wait & see

quentin-st commented 8 years ago

A pull request has been created to document how to use a custom DrawerLayout implementation with MaterialDrawer library: https://github.com/mikepenz/MaterialDrawer/pull/755