Skip to content
Snippets Groups Projects
Commit e6253806 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

TV: Remove history row when needed

parent 88d7cfd4
No related branches found
No related tags found
No related merge requests found
......@@ -186,6 +186,19 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
public void run() {
final ListRow hist = updateHistory(history);
if (hist != null) mRowsAdapter.add(Math.min(2, mRowsAdapter.size()), hist);
else removeHistory();
}
private void removeHistory() {
int position = -1;
for (int i = 0; i < mRowsAdapter.size(); ++i) {
if (((ListRow)mRowsAdapter.get(i)).getHeaderItem().getId() == HEADER_HISTORY) {
position = i;
break;
}
}
if (position != -1) mRowsAdapter.removeItems(position, 1);
mHistoryAdapter = null;
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment