Tag: listview

MVVMCross changing ViewModel within a MvxBindableListView

Little problem with my Android application and I don’t know how to solve it with MVVM Cross. Here is my Model public class Article { string Label{ get; set; } string Remark { get; set; } } My ViewModel public class ArticleViewModel: MvxViewModel { public List<Article> Articles; …. } My layout.axml … <LinearLayout android:layout_width=”0dip” android:layout_weight=”6″ […]

Remote Images in a ListView with ViewHolder pattern

Main question: What is the most efficient bug free method of lazy loading remote images in a simple ListView adapter that utilizes the ViewHolder pattern? I currently have an implementation that will first check a SoftReference Bitmap HashMap for a soft caches version of the image. If that fails I check my hard cache for […]

Preventing Pixelation of Images, indenting listViews and adding Rounded corners

I have a few issues and questions regarding some UI development on Android. Firstly look at this image: Firstly at image A) This is a image that I insert and repeat horizontally to give the zig-zag shape at the top of the screen regardless of screensize and above that a textField with no content and […]

Customizing Android ListView Colors?

I’ve scoured the interwebs and found many posts regarding how to change the colors of a list view using a list selector. However it does not seem to work for me. So my question would be what am I doing wrong? When I use the below files I get a list where all item backgrounds […]

Cannot resolve method .runOnUiThread

I found this exmaple here on how to use the runOnUiThreaed method, but I don’t understand how to use it. I setup the list adapter in my main activity // Set a gobal reference to the list adapter and the list respectivly ListAdapter listAdapter; static ArrayList<String> list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); […]

Adding a button underneath a listview on android

So Ive been trying to add a button underneath a listview in android, the problem is that the button does not appear. <?xml version=”1.0″ encoding=”utf-8″?> <AbsoluteLayout android:id=”@+id/widget0″ android:layout_width=”fill_parent” android:layout_height=”fill_parent” xmlns:android=”http://schemas.android.com/apk/res/android”> <ListView android:id=”@+id/messagelist” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_x=”0px” android:layout_y=”0px”> </ListView> <Button android:id=”@+id/addbutton” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Button” android:layout_x=”0px” android:layout_y=”379px”> </Button> </AbsoluteLayout>

RecyclerView styling at theme level

I’m trying to implement generic style parameters for RecyclerView at theme levels. As in contrast to ListView, I used something like this: Defined a style: <style name=”StyleListView” parent=”Widget.AppCompat.ListView”> <item name=”android:requiresFadingEdge”>vertical</item> <item name=”android:fadingEdgeLength”>10dp</item> <item name=”android:scrollbars”>vertical</item> </style> and later used in my custom theme: <item name=”android:listViewStyle”>@style/StyleListView</item> This works perfectly fine for ListView. However, I’m unable to reflect […]

android scroll while drag & drop

Hi I am trying to do a drag and drop on a ListView. It works great. But I lost the ability to click and scroll. How to I retain those two? I was thinkng the drag and drop should happen on long press of the item instead of a normal press. Here is my onTouch […]

ListView – ImageLoader moves List / Items on Scroll up

I’m looking for an answer half a day, but I can’t find anything although I thought it is a common problem. My Problem: I have a ListView which has items of different sizes (heights). Every item contains an ImageView. The Image for this ImageView is loaded in background by an ImageLoader class: imageLoader.DisplayImage(url, holder.image); If […]

Custom ListView not highlighting ListViewItem on click

I have a custom listview made up of an ImageView and a TextView. Clicking works fine however it won’t highlight the item like a normal ListView would. How would I add a highlight? I tried to rig it by setting the background color on click and then adding a timer to remove the background color. […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.