Contributions
Re: Android: enumerating all items in a ListView (even the off-screen ones).
As described inviewarticle/74368/listViewObj.smoothScrollToOffset(listViewObj.ChildCount) seems indeed the ideal solution which will me allow to bring the not visible listitems into view. But as mentioned above, for some reason this method is not available for my ListView Object. When viewing the methods for the Aliases.Device.Process_qv.RootLayout.View_drawer_layout.ListView("channel_lists") I can only see following methods: - smoothScrollBy, ..._2, ...Offset - smoothScrollToPosition, smoothScrollToPosition_2, ..._3, ...FromTop, ...Position_2 But none of them apparently allow me to scroll the view based on a listItem index.1.6KViews0likes0CommentsAndroid: enumerating all items in a ListView (even the off-screen ones).
On Android I can access a ListView and select any of its items (even the none visible ones) without any problem: var RefListView = "Aliases.Device.Process_qv.RootLayout.View_drawer_layout.ListView('channel_lists')"; var ObjListView = eval(RefListView); var ItemCount = ObjListView.wItemCount; ObjListView.SelectItem(12); // Works OK; even on invisible Items [0 - wItemCount-1] However, I want an inventory of all the names of the list items. Each item in the listviewhas 3 subitems. The subitemI'm interested in looks like below(I used the 5th ListView Item as example here): Aliases.Device.Process_qv.RootLayout.View_drawer_layout.ListView('channel_lists').Layout('NO_ID', 4).TextView('text1') So I use following code to read the 'text1' field from all items in the ListView: for (var ItemIndex=1; ItemIndex <= ItemCount; ItemIndex++) { var RefItem = "Aliases.Device.Process_qv.RootLayout.View_drawer_layout.ListView('channel_lists').Layout('NO_ID', PLACEHOLDER_INDEX).TextView('text1')"; var ObjItem = eval(RefItem.replace("PLACEHOLDER_INDEX", ItemIndex)); Log.Message("ObjItem" + ItemIndex + ":Text=" + ObjItem.mText); } Unfortunately, this only works for the items that are currently on the screen, but not for the ones that are currently outside the view.What is the recommended method for making an inventory of ALL listItems, including the ones currently not on screen? I read about using 'listviewObj.smoothScrollToOffset' to reach items that are out of the screen (viewarticle/74368/). But when I try this on my listviewObj I get "object does not support this action". Thanks for your help,1.6KViews0likes2CommentsAccessing object via string reference
Hi, Currently I access the fields in MyObject in following manner: var MyObject = Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list'); var ButtonLabel = MyObject.Button("title", 1).mText; I'm wondering if it also possible to store an object reference as a string and create an object of it when needed. This way I can maintain a centralized list of all object references. var MyObjectRefString = "Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list');" var MyObject = ??? how to turn object string reference into an actual object ??? var ButtonLabel = MyObject.Button("title", 1).mText Thanks!Solved1.3KViews0likes2Comments