Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recyclerview #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Recyclerview #21

wants to merge 7 commits into from

Conversation

SidMalladi
Copy link
Collaborator

Replaced the valueView StringBuilder implementation with RecyclerView/Adapter

Comment on lines +296 to +324
if (cursor.moveToFirst()) {
for (String header : headerTokens) {

if (!header.equals(mListId)) {

final String val = cursor.getString(
cursor.getColumnIndexOrThrow(header)
);

if (header.equals("color") || header.equals("scan_count") || header.equals("date")
|| header.equals("user") || header.equals("note")) {
if (header.equals("color")) continue;
else if (header.equals("scan_count")) auxValues.append("Number of scans");
else if (header.equals("date")) auxValues.append("Date");
else auxValues.append(header);
auxValues.append(" : ");
if (val != null) auxValues.append(val);
auxValues.append(line_separator);
} else {
String value = header + " :\n\t\t";
if (val != null) value += val;
values.add(value);
}
}
}
cursor.close();

adapter.values = values;
adapter.notifyDataSetChanged();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve your recycler view implementation to not require this string builder. Augment your adapter with a model class that has a prefix and value, which are populated here, then sent to the adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants