Commit c9d62a58 authored by ianwen's avatar ianwen Committed by Commit bot

[Android] Fix a bug in download manager that spinner shows forever

If the backend initializes synchronously, the loading view will call
hideLoadingUi() and then showLoadingUi(), which makes the loading view
always visible.

BUG=641262

Review-Url: https://codereview.chromium.org/2294073002
Cr-Commit-Position: refs/heads/master@{#415445}
parent 955a6d52
......@@ -148,16 +148,15 @@ public class DownloadManagerUi implements OnMenuItemClickListener {
mMainView = (ViewGroup) LayoutInflater.from(activity).inflate(R.layout.download_main, null);
mHistoryAdapter = new DownloadHistoryAdapter(isOffTheRecord, parentComponent);
mHistoryAdapter.initialize(mBackendProvider);
addObserver(mHistoryAdapter);
mHistoryAdapter.registerAdapterDataObserver(mAdapterObserver);
mEmptyView = mMainView.findViewById(R.id.empty_view);
mLoadingView = (LoadingView) mMainView.findViewById(R.id.loading_view);
mLoadingView.showLoadingUI();
mHistoryAdapter = new DownloadHistoryAdapter(isOffTheRecord, parentComponent);
mHistoryAdapter.registerAdapterDataObserver(mAdapterObserver);
mHistoryAdapter.initialize(mBackendProvider);
addObserver(mHistoryAdapter);
mSpaceDisplay = new SpaceDisplay(mMainView, mHistoryAdapter);
mHistoryAdapter.registerAdapterDataObserver(mSpaceDisplay);
mSpaceDisplay.onChanged();
......
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