Questions tagged [android-viewbinder]

The ViewBinder is an Android class that can be used with an adapter to modify(or enhance) the way that adapter binds its data to its views.

The Android ViewBinder is designed to work with various types of adapters(like SimpleAdapter, SimpleCursorAdpter etc). This class should be used to either enable the adapter to bind data to views it doesn't support or to modify the way the adapter currently binds its data. The proper usage of a ViewBinder is to implement its setViewValue() method and then register it with the adapter(through the adapter's setViewBinder() method).

94 questions
22
votes
1 answer

Displaying dates in localized format on Android

I'm currently building my first app for Android. What I'm having trouble with is the storage and localized display of dates in connection with a SimpleCursorAdapter. I have a class that encapsulates access to an SQLitedatabase with three tables.…
16
votes
1 answer

Modifying SimpleCursorAdapter's data

I'm working on a TV Guide app which uses a ListActivity showing the TV shows for one channel / one day at a time. I'm using a RelativeLayout for the ListView items and I want the ListView to look something like this: 07:00 The Breakfast Show …
Squonk
  • 48,735
  • 19
  • 103
  • 135
13
votes
1 answer

How to Ignore view component(s) that I do not want to create bindings in Android view Binding library?

I am exploring new Android View Binding library. In my layout XML file, some views that I don't want to include in my binding class. Does there any attribute or mechanism exist that exclude views into generated Binding class?
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
8
votes
2 answers

Custom list clicking with checkboxes

I've populated a ListActivity from a Cursor using SimpleCursorAdapter that starts another activity when one of the list items have been clicked. I'm also using ViewBinder to do some custom transformation of the data. I want to add a CheckBox to…
Tom Martin
  • 2,498
  • 3
  • 29
  • 37
8
votes
3 answers

Databinding not work together with viewbinding in Kotlin

Android Studio 3.6 build.gradle: buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.0-beta01' classpath…
Alexei
  • 14,350
  • 37
  • 121
  • 240
6
votes
3 answers

Images in SimpleCursorAdapter

I'm trying to use a SimpleCursorAdapter with a ViewBinder to get an image from the database and put it into my ListView item view. Here is my code: private void setUpViews() { mNewsView = (ListView) findViewById(R.id.news_list); Cursor…
5
votes
1 answer

Better understanding of the SimpleAdapter's ViewBinder

I have 4 TextViews, 2 ImageViews, 2 Buttons and 2 widgets that are part of a row definition in a ListView. The data comes from XML and a SimpleAdapter. To access these TextViews I implement the ViewBinder in a custom class and override the…
GPGVM
  • 5,515
  • 10
  • 56
  • 97
4
votes
2 answers

How to set onClick listener for an ImageButton in ViewBinder?

I made a ListView with a SimpleCursorAdapter and a ViewBinder to set views for it, and I want to put an ImageButton in the ViewBinder but don't know how to set the onClick event. Should I create a MySimpleCursorAdapter and put it there or should I…
4
votes
2 answers

Setting an image in ListView item using SimpleCursorAdapter and ViewBinder

Is there a way I could set an image to an ImageView inside a ListView? In this, I am using a SimpleCursorAdapter to display all the fields and using a ViewBinder to set the image bitmap to the ImageView. The image is downloaded using an AsyncTask.…
Vivek
  • 680
  • 1
  • 12
  • 24
4
votes
1 answer

What is the difference between usage of setViewBinder/setViewValue and getView/LayoutInflater?

Looks like there are two possible ways to change something in the ListView rows: using of setViewBinder/setViewValue: myCursor.setViewBinder(new SimpleCursorAdapter.ViewBinder() { @Override public boolean setViewValue(View view, Cursor cursor,…
LA_
  • 19,823
  • 58
  • 172
  • 308
4
votes
1 answer

How to use SimpleAdapter.ViewBinder?

I have a list with a complex layout R.layout.menu_row. It consists of a ProgressBar and a text field. The adapter I use: SimpleAdapter simpleAdapter = new SimpleAdapter(this, getData(path), R.layout.menu_row, new String[] { "title",…
3
votes
2 answers

Using SimpleCursorAdapter.ViewBinder to change the color of TextView

I'm developing an alarm clock app for android and I want to have displayed list of alarms on the main screen. Each row of this ListView is defined in xml file. And I want to have separate TextViews for each day of week. Program will check in sqlite…
3
votes
2 answers

SimpleCursorAdapter and ViewBinder - Binding data to ListView items to be retrieved on click

So I've got a ListView (using a ListActivity) that I'm populating from a SQLiteDatabase. I'm trying to attach the ID (PK) of the row to the view, so that onListItemClick of each list item, I can do stuff with that ID. I've read that arbitrary data…
momo
  • 3,885
  • 4
  • 33
  • 54
3
votes
1 answer

CursorAdapter 's ViewBinder lifecycle?

Can someone help me understand SimpleCursorAdapter.ViewBinder lifecycle in terms of methods: setViewValue, bindView when are they called? Are instances re-used? Any source to understand all of it? I basically have a ScrollView that that uses…
Taranfx
  • 10,361
  • 17
  • 77
  • 95
3
votes
2 answers

Some help understanding columnIndex in ViewBInder

Skip to the bottom if you just want to see the question without context The android app I'm building has a simple table with three columns: _id INTEGER PRIMARY KEY..., name TEXT, color INT This table is called categories. I load my categories…
binary lobster
  • 444
  • 1
  • 6
  • 14
1
2 3 4 5 6 7