ฉันมีการตั้งค่าปัจจุบัน:
<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/coordiator_layout_in_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.design.widget.NavigationView
android:layout_width="170dp"
android:layout_height="match_parent"
android:fitsSystemWindows="true"/>
<FrameLayout
// I place a fragment containing a viewpager containing fragments that contain a recyclerview....
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/nav_view">
</FrameLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/settings_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
</FrameLayout>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_refresh"
app:layout_anchor="@id/coordiator_layout_in_main"
app:layout_anchorGravity="bottom|right|end"
app:layout_behavior="com.material.widget.MyFloatingActionButtonBehavior" />
</android.support.design.widget.CoordinatorLayout>
ตอนนี้ทุกอย่างทำงานได้ตามที่คาดไว้ ถ้าฉันเลื่อนเข้าไปภายในเค้าโครงเฟรมที่มีส่วนต่างๆ แถบเครื่องมือจะเลื่อนเข้าและออกตามที่ฉันต้องการ
ประเด็นก็คือ ฉันต้องการ ปิดการใช้งานแถบเครื่องมือที่เลื่อนเข้าและออก หากฉันเลื่อน NavView ซึ่งอยู่ที่ด้านข้างของเค้าโครงเฟรม (และภายในเค้าโครงแบบสัมพันธ์)
แต่ไม่ว่าฉันจะลบพฤติกรรมการเลื่อนทั้งหมดออกหรือไม่ แถบเครื่องมือก็ยังคงเลื่อนเข้าและออก (วิธีเดียวที่จะปิดใช้งานได้คือลบค่าสถานะการเลื่อนออกจากเค้าโครงแอปพลิเคชัน แต่จะปิดใช้งานการเลื่อนเข้าและออกจากแถบเครื่องมือทั้งหมด)
กรุณาสิ่งที่ฉันหายไปที่นี่? พฤติกรรมการสก๊อตไม่ควรส่งผ่านเหตุการณ์การเลื่อนไปยัง CoordinatorLayout ใช่หรือไม่