listviewitem

Create a custom listViewItem class to store additional hidden info - VB .Net

我的未来我决定 提交于 2019-12-06 17:38:28
I want to store additional information about a listview item using a custom class, but I can't seem to get it to work. I'm currently using this code to accomplish something similar using a listbox item. I just want to do the same thing with a listview. Public Class myListboxItem Public id As String Public rootFolder As String Public name As String Public info() As String Public Text As String Public Overrides Function ToString() As String Return Me.Text End Function End Class I set the properties like this Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

ListView items won't show focus when touched

别等时光非礼了梦想. 提交于 2019-12-06 15:42:55
I've got a ListView that works just great, except for this minor annoyance. I can use the trackball/dpad to move up and down my list, and the background changes according to which row has focus. But when I touch the row (click or long click), there's no background change letting me know what's been focused. I've tried setting 'focusable' and 'focusable in touch mode' to true on the rows, but it still doesn't work. Just in case it matters somehow: I am setting onClickListeners for each row. The row is comprised of LinearLayouts, TextViews, and a single ImageView. Focusable/clickable is 'true'

ListView Reorder Items

浪尽此生 提交于 2019-12-06 13:14:48
I tried to look answers but I couldn't find any. So I want to change my ListView items order in app and I don't have any idea how to do that. I guess Drag and Drop is too hard to build but how about some arrow buttons where you can press up and item move one row up? And how to make app to remember order that next time I open it every item are in order where I moved them? I have my ListView Items in their own file (values->arrays.xml). And here is my ListView activity: public class MainScreen extends ListActivity implements OnClickListener{ /** Called when the activity is first created. **/

How to open Android activities based on role of user?

痞子三分冷 提交于 2019-12-06 09:51:02
I am creating an online based Android app in which there is a listview , which shows notifications from different types of users like ' student ', ' teacher '. When I click a list view item, it should check the role of the user, whether the user is registered as ' teacher ' or a ' student ' and it should open the activity screen based on their role. I'll use intents to open different activities. How do I check the role of the user from server? Well, I would like to provide my own answer. I actually used Shared Preferences . Its much simple and could globally use the values we put in it. Below

ListViewItem does not get highlighted if the background isn't transparent

半腔热情 提交于 2019-12-06 09:39:35
I have a ListViewItem with a custom gradient background. The default selector no longer highlights these rows anymore. Highlight only works if I set the background to transparent. How can I get the highlight without this change? Here is my ListView: <ListView android:id="@+id/symbolsListView" android:layout_width="fill_parent" android:background="@drawable/transparent_background" android:layout_height="390dp" android:divider="@drawable/ui_divider_line" android:cacheColorHint="#00000000" android:listSelector="@drawable/blue" android:drawSelectorOnTop="true" > your some states that are focused

Listview get item text

↘锁芯ラ 提交于 2019-12-06 07:15:25
问题 I need to grab selected item TEXT (not id). What can I write under onListItemClick to do that? I get: java.lang.ClassCastException: org.eclipse.jdt.internal.debug.core.model.JDIObjectValue cannot be cast to org.eclipse.jdt.debug.core.IJavaArray at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.getCompiledExpression(JavaDetailFormattersManager.java:396) at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.resolveFormatter(JavaDetailFormattersManager.java:167) at org

WPF ListViewItem lost focus event - How to get at the event?

你说的曾经没有我的故事 提交于 2019-12-06 07:09:36
问题 I have a listview that you select a row/item on. This is linked to a datatrigger that displays an image on the row. The image should only be displayed when the row is selected. This part works fine, however when you move the focus to something else, such as a textbox, or a messagebox is displayed, the listviewitem loses focus ie the highlight on the row is no longer displayed. The problem is that my image still remains. It should be hidden/collapsed when the listview loses focus... It works

How to drag & drop items in the same ListView?

痴心易碎 提交于 2019-12-06 06:33:28
Consider this is a ListView that shows files and folders, I have already wrote code for copy/move/rename/show properties ...etc and I just need one more last thing. how to drag and drop in the same ListView like in Windows Explorer, I have move and copy functions, and I just need to get the items which user drops in some folder or in other way I need to get these two parameters to call copy function void copy(ListViewItem [] droppedItems, string destination path) { // Copy target to destination } Start by setting the list view's AllowDrop property to true. Implementing the ItemDrag event to

Problem setting ListView selector color when pressed

吃可爱长大的小学妹 提交于 2019-12-06 05:29:01
问题 I have the following ListView, and have followed the answer from this SO Question w/ no luck: Android ListView Selector Color <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ARListView" android:background="@drawable/transparent_background" android:cacheColorHint="#00000000" android:listSelector="@drawable/ar_selector" android:drawSelectorOnTop="true"> Here is my ar_selector.xml <?xml

Click in a ListView item changes status of elements inside the item?

拥有回忆 提交于 2019-12-06 02:58:10
I don't know exactly how to explain this problem, but I'll try. I have a ListView with several items. Each item has inside a TextView and two ImageView. I want the ImageView change when I click on them, and I want to open a context menu when I press for a long time into the ListView item. For the ImageView, everything works properly. For the whole item, I can show the context menu after a long press, but my problem is that the ImageView changes as well when I am pressing the TextView, for example. Somo pieces of my code: ListView item: <TextView android:id="@+id/title" android:textColor="