Commit 39dd3bcb authored by Geoffrey Métais's avatar Geoffrey Métais

TV: clear adapters only once update is ready

parent ec000500
......@@ -386,23 +386,15 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
};
private class AsyncUpdate extends AsyncTask<Void, Void, Void> {
boolean showHistory;
MediaWrapper[] history, videoList;
private boolean showHistory;
private MediaWrapper[] history, videoList;
AsyncUpdate() {}
@Override
protected void onPreExecute() {
showHistory = mSettings.getBoolean(PreferencesFragment.PLAYBACK_HISTORY, true);
if (mRowsAdapter != null)
mRowsAdapter.clear();
else
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mHandler.sendEmptyMessageDelayed(SHOW_LOADING, 300);
mHistoryIndex.clear();
//Video Section
mVideoIndex.clear();
}
@Override
......@@ -425,6 +417,13 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
mHandler.sendEmptyMessage(HIDE_LOADING);
if (!isVisible())
return;
if (mRowsAdapter != null)
mRowsAdapter.clear();
else
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mHistoryIndex.clear();
//Video Section
mVideoIndex.clear();
mVideoAdapter = new ArrayObjectAdapter(
new CardPresenter(mContext));
final HeaderItem videoHeader = new HeaderItem(HEADER_VIDEO, getString(R.string.video));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment