Commit 82e84858 authored by Shakti Sahu's avatar Shakti Sahu Committed by Commit Bot

Download home V1 : Fixed close button for tablets

This was broken due to introduction of location change. This
has already been fixed in download home V2.

Bug: 887728
Change-Id: I4041fea1681eb7cc179c2155a8fca7b96750db39
Reviewed-on: https://chromium-review.googlesource.com/c/1316089Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605426}
parent 6878039c
......@@ -50,10 +50,12 @@ public class DownloadManagerToolbar extends SelectableListToolbar<DownloadHistor
}
/**
* Removes the close button from the toolbar.
* Removes a menu item from the toolbar.
* @param menuItemId The menu item to be removed. Nothing happens if there is no menu item
* associated with this ID.
*/
public void removeCloseButton() {
getMenu().removeItem(R.id.close_menu_id);
public void removeMenuItem(int menuItemId) {
getMenu().removeItem(menuItemId);
}
/** Called whenever the selected filter on this adapter should change. */
......
......@@ -231,6 +231,8 @@ public class DownloadManagerUi implements OnMenuItemClickListener, SearchDelegat
isLocationEnabled ? R.id.with_settings_normal_menu_group : R.id.normal_menu_group;
mSearchMenuId = isLocationEnabled ? R.id.with_settings_search_menu_id : R.id.search_menu_id;
mInfoMenuId = isLocationEnabled ? 0 : R.id.info_menu_id;
final int closeMenuId =
isLocationEnabled ? R.id.with_settings_close_menu_id : R.id.close_menu_id;
mToolbar = (DownloadManagerToolbar) mSelectableListLayout.initializeToolbar(
R.layout.download_manager_toolbar, mBackendProvider.getSelectionDelegate(), 0, null,
......@@ -253,7 +255,7 @@ public class DownloadManagerUi implements OnMenuItemClickListener, SearchDelegat
enableStorageInfoHeader(mHistoryAdapter.shouldShowStorageInfoHeader());
mIsSeparateActivity = isSeparateActivity;
if (!mIsSeparateActivity) mToolbar.removeCloseButton();
if (!mIsSeparateActivity) mToolbar.removeMenuItem(closeMenuId);
RecordUserAction.record("Android.DownloadManager.Open");
}
......
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