Commit 320a1c39 authored by Shakti Sahu's avatar Shakti Sahu Committed by Commit Bot

Changed download home toolbar to use common styles

Bug: 1013403
Change-Id: I259c45060c86d35de84149351539430be57478b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854521Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705023}
parent 085c9ffe
......@@ -19,16 +19,7 @@
android:id="@+id/download_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height_no_shadow"
style="@style/ModernToolbar">
<TextView
android:id="@+id/title_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/TextAppearance.BlackHeadline"
android:text="@string/menu_downloads"/>
</org.chromium.chrome.browser.download.home.toolbar.DownloadHomeToolbar>
style="@style/ModernToolbar"/>
<org.chromium.chrome.browser.ui.widget.FadingShadowView
android:id="@+id/shadow"
......
......@@ -22,7 +22,6 @@ import java.util.List;
*/
public class DownloadHomeToolbar extends SelectableListToolbar<ListItem> {
private UiConfig mUiConfig;
private View mTitleBar;
public DownloadHomeToolbar(Context context, AttributeSet attrs) {
super(context, attrs);
......@@ -32,7 +31,6 @@ public class DownloadHomeToolbar extends SelectableListToolbar<ListItem> {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mTitleBar = findViewById(R.id.title_bar);
post(() -> {
mUiConfig = new UiConfig(this);
configureWideDisplayStyle(mUiConfig);
......@@ -59,7 +57,6 @@ public class DownloadHomeToolbar extends SelectableListToolbar<ListItem> {
boolean wasSelectionEnabled = mIsSelectionEnabled;
super.onSelectionStateChange(selectedItems);
mTitleBar.setVisibility((mIsSelectionEnabled || isSearching()) ? GONE : VISIBLE);
if (mIsSelectionEnabled) {
int numSelected = mSelectionDelegate.getSelectedItems().size();
......@@ -82,16 +79,4 @@ public class DownloadHomeToolbar extends SelectableListToolbar<ListItem> {
}
}
}
@Override
public void showSearchView() {
super.showSearchView();
mTitleBar.setVisibility(GONE);
}
@Override
public void hideSearchView() {
super.hideSearchView();
mTitleBar.setVisibility(VISIBLE);
}
}
......@@ -101,7 +101,7 @@ public class ToolbarCoordinator implements SelectionObserver<ListItem> {
mToolbar = mView.findViewById(R.id.download_toolbar);
mShadow = mView.findViewById(R.id.shadow);
mToolbar.initialize(selectionDelegate, 0 /* titleResId */, R.id.normal_menu_group,
mToolbar.initialize(selectionDelegate, R.string.menu_downloads, R.id.normal_menu_group,
R.id.selection_mode_menu_group, hasCloseButton);
mToolbar.setOnMenuItemClickListener(this ::onMenuItemClick);
......
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