exodus-android-app icon indicating copy to clipboard operation
exodus-android-app copied to clipboard

Bug: too much scroll possible on trackers tab in app details

Open Altonss opened this issue 3 years ago • 2 comments

When the trackers aren't loaded yet, I can scroll the trackers tab very far until all the screen becomes black. This shouldn't happen I think...

Altonss avatar Sep 08 '22 16:09 Altonss

Thanks for feedback, yes i know this bug, trackers tabs and permissions tabs have sames dimensions. If reports have lot of permissions tab trackers take sames dimensions then permissions tab.

Jean-BaptisteC avatar Sep 08 '22 17:09 Jean-BaptisteC

Would there be a way to have 2 separate dimensions? :thinking: I don't know Kotlin at all, so I can't help on that one ^^

Altonss avatar Sep 08 '22 17:09 Altonss

@Jean-BaptisteC I've looked at multiple solutions and all of them use a custom view that extends ViewPager and overrides the onMeasure() method.

Let me know if this solution sounds good or if you have any other suggestions.

sivasubramaniamv avatar Jun 02 '23 12:06 sivasubramaniamv

I'm really not an expert in Android dev, but i think it's good idea. When do you want call onMeasure each time user switch between tabs or only one time when users open AppDetailFragment ?

Jean-BaptisteC avatar Jun 02 '23 12:06 Jean-BaptisteC

onMeasure() is a method that is called to get the measurements of a view (a view is any UI element) in Android. The idea behind overriding the onMeasure() function is that we are providing our own measurement to Android.

In this case, we will provide the height of the child element (tracker fragment/permission fragment) so that the ViewPager's height will be the height of the current tab.

More about onMeasure on stackoverflow

sivasubramaniamv avatar Jun 02 '23 13:06 sivasubramaniamv

Thanks for more explanation, yes i think it's a good solution

Jean-BaptisteC avatar Jun 02 '23 13:06 Jean-BaptisteC

@Jean-BaptisteC Unfortunately, in the Exodus app ViewPager2 is used which is a final class that cannot be extended.

Therefore the solution mentioned above isn't possible.

I've tried multiple solutions for ViewPager2:

  1. stackoverflow.com/a/64235840
  2. stackoverflow.com/a/58632613/17240756
  3. stackoverflow.com/a/68691439/17240756

but none of them worked perfectly.

Resources:

  1. developer.android.com/guide/topics/ui/how-android-draws
  2. issuetracker.google.com/u/0/issues/143095219

I hope someone can make use of the linked resources and fix this bug in the future.

sivasubramaniamv avatar Jun 05 '23 14:06 sivasubramaniamv

Thanks for research, it's not a problem if this bug is not solved now 🙂

Jean-BaptisteC avatar Jun 05 '23 15:06 Jean-BaptisteC