Search code examples
androidkotlinuser-interfaceglance

Implementing scrollable view flipper for Android widget


I'm trying to implement something like below this in a home screen widget.

Trying to use a ViewFlipper but it does not allow user control and only has option to automatically flip the views. What I want to acheive is flip on user verticle scroll. Pointers on how to acheive this would be helpful.

enter image description here


Solution

  • Quoting the documentation for app widgets:

    ...be aware that widget layouts are based on RemoteViews, which doesn't support every kind of layout or view widget. You can't use custom views or subclasses of the views that are supported by RemoteViews.

    The only RemoteViews-supported View classes that support any form of vertical gesture are ListView, GridView, and StackView. It is unclear what you expect "flip" to entail, so you will need to experiment with these three options to see which best meets your needs.