Closed hendynugraha87 closed 8 years ago
Thanks for the compliment! I'm glad you like it.
Sure your can use data from SQLite database. Just iterate through the Cursor that has your data. I haven't tested this but here's a general idea:
Cursor c = db.query(
// get the relevant rows here
);
SwipeSelector swipeSelector = (SwipeSelector) findViewById(R.id.swipeSelector);
if (c != null && c.getCount() > 0) {
SwipeItem[] swipeItems = new SwipeItem[c.getCount()];
int i = 0;
while (c.moveToNext()) {
int value = c.getInt(c.getColumnIndex("col_value"));
String title = c.getString(c.getColumnIndex("col_title"));
String description = c.getString(c.getColumnIndex("col_description"));
swipeItems[i] = new SwipeItem(value, title, description);
i++;
}
swipeSelector.setItems(swipeItems);
c.close();
}
i already implement your library into my project and it looks marvelous. but sorry for ask, is there any clue how to set of SwipeItem objects using SQLite ? thanks.