MaterialSearchView icon indicating copy to clipboard operation
MaterialSearchView copied to clipboard

toolbar is not hidden with coordinatorlayout.

Open joaoarmando opened this issue 6 years ago • 3 comments

Hello, my toolbar does not hide when used in a coordinator layout, this is my xml.

 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">



            <FrameLayout
                android:id="@+id/toolbar_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbarPesquisar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_scrollFlags="scroll|enterAlways"
                    app:popupTheme="@style/toolbarWhiteColor"
                    app:theme="@style/toolbarWhiteColor" />

                <com.miguelcatalan.materialsearchview.MaterialSearchView
                    android:id="@+id/search_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone"
                    style="@style/MaterialSearchViewStyle"/>
            </FrameLayout>


            <com.ogaclejapan.smarttablayout.SmartTabLayout
                android:id="@+id/tabsTrab"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                app:stl_clickable="true"
                app:stl_defaultTabBackground="?attr/selectableItemBackground"
                app:stl_defaultTabTextAllCaps="true"
                app:stl_defaultTabTextColor="#FC000000"
                app:stl_defaultTabTextHorizontalPadding="16dp"
                app:stl_defaultTabTextMinWidth="0dp"
                app:stl_defaultTabTextSize="12sp"
                app:stl_distributeEvenly="true"
                app:stl_dividerColor="#4D000000"
                app:stl_dividerThickness="1dp"
                app:stl_drawDecorationAfterTab="false"
                app:stl_indicatorAlwaysInCenter="false"
                app:stl_indicatorColor="@color/primary"
                app:stl_indicatorCornerRadius="2dp"
                app:stl_indicatorGravity="bottom"
                app:stl_indicatorInFront="true"
                app:stl_indicatorInterpolation="smart"
                app:stl_indicatorThickness="4dp"
                app:stl_indicatorWidth="auto"
                app:stl_indicatorWithoutPadding="false"
                app:stl_overlineColor="#4D000000"
                app:stl_overlineThickness="0dp"
                app:stl_titleOffset="24dp"
                app:stl_underlineColor="#4D000000"
                app:stl_underlineThickness="1dp" />


        </android.support.design.widget.AppBarLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewPagerTrab"
            android:layout_width="match_parent"
            android:layout_height="match_parent"

            app:layout_behavior="@string/appbar_scrolling_view_behavior"></android.support.v4.view.ViewPager>


    </android.support.design.widget.CoordinatorLayout>

joaoarmando avatar Nov 14 '17 23:11 joaoarmando

+1

TheLuckyCoder avatar Jun 25 '18 15:06 TheLuckyCoder

@TheLuckyCoder you can find the solution?

joaoarmando avatar Jun 27 '18 23:06 joaoarmando

@JoaoArmandoo The best I could do was this: `search_view.setOnSearchViewListener(object : MaterialSearchView.SearchViewListener { override fun onSearchViewShown() { search_view.visibility = View.VISIBLE toolbar.visibility = View.GONE }

        override fun onSearchViewClosed() {
            search_view.visibility = View.GONE
            toolbar.visibility = View.VISIBLE
        }
    })`

TheLuckyCoder avatar Jun 28 '18 16:06 TheLuckyCoder