Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cbc3ed7 authored by Zemiao Zhu's avatar Zemiao Zhu Committed by Automerger Merge Worker
Browse files

Fix toolbar shadow for tablet mode. am: 47e3f4f1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/DocumentsUI/+/13274662

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia35e2fa168f16ba3548f4b6a0be6ec2622a72b4d
parents 7ad69fdd 47e3f4f1
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -194,6 +194,19 @@ public class NavigationViewManager {
    }
    }


    private void updateToolbar() {
    private void updateToolbar() {
        if (mCollapsingBarLayout == null) {
            // Tablet mode does not use CollapsingBarLayout
            // (res/layout-sw720dp/directory_app_bar.xml or res/layout/fixed_layout.xml)
            if (shouldShowSearchBar()) {
                mToolbar.setBackgroundResource(R.drawable.search_bar_background);
                mToolbar.setOutlineProvider(mSearchBarOutlineProvider);
            } else {
                mToolbar.setBackground(mDefaultActionBarBackground);
                mToolbar.setOutlineProvider(null);
            }
            return;
        }

        CollapsingToolbarLayout.LayoutParams toolbarLayoutParams =
        CollapsingToolbarLayout.LayoutParams toolbarLayoutParams =
                (CollapsingToolbarLayout.LayoutParams) mToolbar.getLayoutParams();
                (CollapsingToolbarLayout.LayoutParams) mToolbar.getLayoutParams();


+3 −1
Original line number Original line Diff line number Diff line
@@ -223,8 +223,10 @@ final class ListDocumentHolder extends DocumentHolder {
            }
            }


            metadataList.add(mFileTypeLookup.lookup(mDoc.mimeType));
            metadataList.add(mFileTypeLookup.lookup(mDoc.mimeType));
            if (mMetadataView != null) {
                mMetadataView.setText(TextUtils.join(", ", metadataList));
                mMetadataView.setText(TextUtils.join(", ", metadataList));
            }
            }
        }


        // mDetails view doesn't exists in layout-sw720dp-land layout
        // mDetails view doesn't exists in layout-sw720dp-land layout
        if (mDetails != null) {
        if (mDetails != null) {
+4 −2
Original line number Original line Diff line number Diff line
@@ -122,8 +122,10 @@ public class SearchFragment extends Fragment {
        mListView.setOnItemClickListener(this::onHistoryItemClicked);
        mListView.setOnItemClickListener(this::onHistoryItemClicked);


        View toolbar = getActivity().findViewById(R.id.toolbar);
        View toolbar = getActivity().findViewById(R.id.toolbar);
        if (toolbar != null) {
        View collapsingBarLayout = getActivity().findViewById(R.id.collapsing_toolbar);
            // Align top with the bottom of search bar.
        if (toolbar != null && collapsingBarLayout != null) {
            // If collapsingBarLayout is used (i.e. not in Tablet mode),
            // need to align top with the bottom of search bar.
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT);
                    ViewGroup.LayoutParams.MATCH_PARENT);