listviewitem

Android Reordering ListView items with drag and drop [duplicate]

柔情痞子 提交于 2019-12-01 00:52:02
This question already has an answer here: Android List View Drag and Drop sort 6 answers How to Drag drop Listview item to another Listview 4 answers I have custom ListView with custom Layout consisting of one TextView for display text and another ImageView for long pressing to drag and drop for reordering ListView items like image below.Please help me! Here is a nice library DSLV. very smooth and fine working. https://github.com/bauerca/drag-sort-listview . 来源: https://stackoverflow.com/questions/20853863/android-reordering-listview-items-with-drag-and-drop

GridView DoubleClick

瘦欲@ 提交于 2019-12-01 00:29:33
I have a GridView where I want to detect a doubleclick event on the items in the list, i do it as follows: <ListView> <ListView.View > <GridView > <GridViewColumn Header="FileName"> <GridViewColumn.CellTemplate> <DataTemplate> <Label Content="{Binding FileName}" MouseDoubleClick="Configuration_MouseDoubleClick"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn DisplayMemberBinding="{Binding CreationDate}" Header="Date"/> </GridView> </ListView.View> </ListView> The problem is that I can only detect doubleclicks by attaching it to the control in the template.

How to do custom ListView with colorful items' backgrounds?

岁酱吖の 提交于 2019-11-30 19:23:18
I have created an ArrayList<HashMap<String, String>> collection to hold my data for ListView . I'm using SimpleAdapter . Is it possible to change background of list item when list item's ID % 10 == 0? Here is the code (method generating layout): private void fillData() { Cursor c = this.mDbManager.getNgOrderDetailByOrderNumber(this.mNumber); ArrayList<HashMap<String, String>> items = new ArrayList<HashMap<String, String>>(); if (!c.isAfterLast()) { do { // ... filling HashMap and putting it to ArrayList } while (c.moveToNext()); } SimpleAdapter adapter = new SimpleAdapter(this, items, R.layout

Android Reordering ListView items with drag and drop [duplicate]

会有一股神秘感。 提交于 2019-11-30 19:16:07
问题 This question already has answers here : Android List View Drag and Drop sort (6 answers) How to Drag drop Listview item to another Listview (4 answers) Closed 5 years ago . I have custom ListView with custom Layout consisting of one TextView for display text and another ImageView for long pressing to drag and drop for reordering ListView items like image below.Please help me! 回答1: Here is a nice library DSLV. very smooth and fine working. https://github.com/bauerca/drag-sort-listview. 来源:

Add SubItems to ListView without using XAML

狂风中的少年 提交于 2019-11-30 15:25:36
How do you add sub-items to a ListView ? I need to generate everything dynamically, but every example I've found uses XAML. Non-WPF was so simple: ListViewItem lvi = listview.items.add(wahtever); lvi. blah blah blah How do you add sub-items in WPF without using XAML? As already mentioned, WPF doesn't have sub-items like WinForms. Instead you use properties on an object that suits your purposes. For completeness, here is XAML contrasted with code. XAML: <UniformGrid Columns="2"> <ListView Name="xamlListView"> <ListView.View> <GridView> <GridViewColumn Header="X Value" DisplayMemberBinding="

set text in textview of a list item on click of button

给你一囗甜甜゛ 提交于 2019-11-30 09:40:30
问题 I have created a list view as shown in this image.Link: Image Problem: I want that if the user clicks on the button + or - the textview which is currently showing 0 is incremented or decremented accordingly. But if I click first item's button the textview is updated in some other row. I don't know how to implement this. Here's code: public class HomePage extends Fragment { String[] listitems; int[] images = { R.drawable.cadburysilk, R.drawable.cadburys_dairymilk, R.drawable.perk, R.drawable

How to set a WPF ListView Selected Item color?

孤者浪人 提交于 2019-11-30 08:53:36
I am trying to recreate the Mail UI from Windows 8 in a WPF application running on Windows 7. Here's what I want to achieve: In particular, I don't know how to change the background color for selected items e.g. the Inbox item in the first column and the mail from Twitter in the second column. I have tried several solutions from other similar Stackoverflow Questions but none seem to work for me. e.g. Selected item loses style when focus moved out in WPF ListBox WPF ListView Inactive Selection Color Here is the code I have for my listview: <ListView Grid.Row="0" SelectedItem="{Binding Path

Trying to get value out of text view in list view click event in android

回眸只為那壹抹淺笑 提交于 2019-11-30 08:51:21
问题 I have a click event hooked up to my listview as shown. int[] GenusListIDs = { R.id.txt_ID, R.id.txt_Genus, R.id.txt_Count }; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.genusitem, cursor_genuslist, service.GenusListColumns, GenusListIDs); ListView list_Genus = (ListView)findViewById(R.id.list_Genus); list_Genus.setAdapter(adapter); list_Genus.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView parent, View view, int

How to do custom ListView with colorful items' backgrounds?

≡放荡痞女 提交于 2019-11-30 04:25:19
问题 I have created an ArrayList<HashMap<String, String>> collection to hold my data for ListView . I'm using SimpleAdapter . Is it possible to change background of list item when list item's ID % 10 == 0? Here is the code (method generating layout): private void fillData() { Cursor c = this.mDbManager.getNgOrderDetailByOrderNumber(this.mNumber); ArrayList<HashMap<String, String>> items = new ArrayList<HashMap<String, String>>(); if (!c.isAfterLast()) { do { // ... filling HashMap and putting it

android auto-refresh listview items

妖精的绣舞 提交于 2019-11-29 23:57:28
问题 I'm really new to android programming, I successfully get data from server and then populated into a listview. But how do I auto-refresh the listview items within certain amount of time? There maybe new items coming in from the server when I refresh the new items may appear. Here's my code of retrieving data from server: public class TabActivityQueue extends Fragment { ListView list; TextView number; TextView info; TextView remark; TextView statuss; Button Btngetdata; ArrayList<HashMap<String