On the Android developers website, in the section discussing AppWidgets, there is a passage that says that the only available gestures for AppWidgets are touch and vertical swipe (link):

Because widgets live on the home screen, they have to co-exist with the navigation that is established there. This limits the gesture support that is available in a widget compared to a full-screen app. While apps for example may support a view pager that allows the user to navigate between screens laterally, that gesture is already taken on the home screen for the purpose of navigating between home panels.

The only gestures available for widgets are:

Touch

Vertical swipe

Does this mean it is possible to listen for vertical swipes on an AppWidget?

有帮助吗?

解决方案

I guess this is meant to say that you can only scroll through a ListView or go through items of the StackView (by doing vertical swipes).

There is no way how to implement regular onScroll, nor onTouch listeners for AppWidget.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top