handle NULLs in fastscroll alphabet.

Display a question mark if the value was NULL, this enables the fastscroller to scroll to NULL columns.
This commit is contained in:
Adrian Ulrich 2017-07-02 15:41:13 +02:00
parent 753410bbef
commit 0d4c8685ae

View File

@ -70,7 +70,7 @@ public class MediaAdapter
/**
* The string to use for length==0 db fields
*/
private static final String DB_NULLSTRING_FALLBACK = "???";
private static final String DB_NULLSTRING_FALLBACK = "?";
/**
* A context to use.
*/
@ -686,11 +686,11 @@ public class MediaAdapter
Object lastKnown = null;
Object next;
do {
if(cursor.isNull(sortColumnIndex))
continue;
int type = cursor.getType(sortColumnIndex);
switch (type) {
case Cursor.FIELD_TYPE_NULL:
next = DB_NULLSTRING_FALLBACK;
break;
case Cursor.FIELD_TYPE_INTEGER:
int value = cursor.getInt(sortColumnIndex);
if (columnName.equals(MediaLibrary.SongColumns.MTIME)) {