Repository navigation
TWEAK - Widget TextView marquee stops scrolling (focus lost when widgets are re-attached) #325
Closed
Ferenczy68
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
• What happens: Widgets that scroll text with a marquee (a TextView using
ellipsize="marquee"plus<requestFocus/>in RemoteViews) scroll fine in other launchers, but in Supernova they stop and show "…" instead. Swiping pages or opening the drawer search reliably triggers it.• Likely cause: Widgets can't call
setSelected()through RemoteViews, so a widget's marquee depends entirely on the TextView holding focus. In Supernova, the homeViewPager2(set to take focus before its children) is focusable in touch mode. Each time a widget host view gets detached and re-attached between page containers, or focus gets cleared (the drawer search does this), focus goes back to the pager rather than the widget's TextView. The TextView never gets focus back, so the marquee stops.• Possible fixes:
•• Make the pager and page containers non-focusable in touch mode, or switch them to
FOCUS_AFTER_DESCENDANTS, so widget views can keep focus.•• Avoid detaching and re-attaching AppWidgetHostViews on page changes where possible. Keeping them attached is how other launchers behave.
•• After re-attaching a widget, call
requestFocus()on its first focusable child, or callsetSelected(true)on TextViews that use marquee ellipsizing.• Minor: The launcher reports only one widget size (other launchers report portrait and landscape through
OPTION_APPWIDGET_SIZES). Also, a 5×1 widget only gets about 31dp of height, so 1-row widgets look cramped.Tested on a Pixel 10 Pro XL with Android 17 and Supernova v0.2.6.
All reactions