If you scroll through the Recycler view from the view above, I want to make the toolbar text above and the text view below disappear.
<android.support.design.widget.AppBarLayout
android:id="@+id/study_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:id="@+id/study_tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/study_tool_bar_title_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="5dp"
android:text="@string/app_name"
android:textColor="#ffffff"
android:textSize="20sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/introduce_app_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="17dp"
android:layout_marginTop="5dp"
android:background="@drawable/rectangle_back"
android:elevation="2dp"
android:text="@string/introduce_app_txt"
android:textColor="#ffffff"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/study_tab_recycler"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/study_app_bar"
android:layout_marginTop="2dp"
android:layout_marginBottom="90dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v7.widget.RecyclerView>
I tried to put collphaseMode in several views, but the toolbar doesn't go up.(Crying) Does anyone know?
android toolbar collapsemode app-bar
I googled a little bit and there's an example. Please refer to it ^ https://mzgreen.github.io/2015/02/15/How-to-hideshow-Toolbar-when-list-is-scroling%28part1%29/
^
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.