2017-01-23 07:56:55 +01:00
|
|
|
package org.mariotaku.twidere.model
|
|
|
|
|
|
|
|
import android.database.Cursor
|
2017-03-27 13:34:21 +02:00
|
|
|
import org.mariotaku.twidere.provider.TwidereDataStore.Suggestions
|
2017-01-23 07:56:55 +01:00
|
|
|
|
|
|
|
class SuggestionItem(cursor: Cursor, indices: Indices) {
|
|
|
|
|
|
|
|
val title: String?
|
|
|
|
val summary: String?
|
|
|
|
val _id: Long
|
|
|
|
val extra_id: String?
|
|
|
|
|
|
|
|
init {
|
2017-03-27 13:34:21 +02:00
|
|
|
_id = if (indices._id < 0) -1 else cursor.getLong(indices._id)
|
2017-01-23 07:56:55 +01:00
|
|
|
title = cursor.getString(indices.title)
|
|
|
|
summary = cursor.getString(indices.summary)
|
|
|
|
extra_id = cursor.getString(indices.extra_id)
|
|
|
|
}
|
|
|
|
|
|
|
|
class Indices(cursor: Cursor) {
|
|
|
|
val _id: Int = cursor.getColumnIndex(Suggestions._ID)
|
|
|
|
val type: Int = cursor.getColumnIndex(Suggestions.TYPE)
|
|
|
|
val title: Int = cursor.getColumnIndex(Suggestions.TITLE)
|
|
|
|
val value: Int = cursor.getColumnIndex(Suggestions.VALUE)
|
|
|
|
val summary: Int = cursor.getColumnIndex(Suggestions.SUMMARY)
|
|
|
|
val icon: Int = cursor.getColumnIndex(Suggestions.ICON)
|
|
|
|
val extra_id: Int = cursor.getColumnIndex(Suggestions.EXTRA_ID)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|