Highlight ListView selected row

前端 未结 12 1482
情歌与酒
情歌与酒 2020-11-27 16:04

I have a list of albums (several hundred). When I touch the selected album I want to offer the user a choice of playing the whole album, or moving to its track ListView. No

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 16:25

    Quoted from http://android-developers.blogspot.de/2008/12/touch-mode.html

    Imagine a simple application, ApiDemos for example, that shows a list of text items. The user can freely navigate through the list using the trackball but also, alternatively, scroll and fling the list using the touch screen. The issue in this scenario is how to handle the selection properly when the user manipulates the list through the touch screen.

    In this case, if the user selects an item at the top of the list and then flings the list towards the bottom, what should happen to the selection? Should it remain on the item and scroll off the screen? What should happen if the user then decided to move the selection with the trackball? Or worse, what should happen if the user presses the trackball to act upon the currently selected item, which is not shown on screen anymore?

    After careful consideration, we decided to remove the selection altogether, when the user manipulates the UI through the touch screen.

    In touch mode, there is no focus and no selection. Any selected item in a list of in a grid becomes unselected as soon as the user enters touch mode. Similarly, any focused widgets become unfocused when the user enters touch mode. The image below illustrates what happens when the user touches a list after selecting an item with the trackball.

提交回复
热议问题