我在使用CollapsingToolbarLayout的RecyclerView中发现了奇怪的行为.当我滚动RecyclerView时 - 它完美地工作.但是当我试图把它扔掉并且足够快地停止它时 - 我可以看到,RecyclerView被"内部"滚动.
糟糕的行为:
在CollapsingToolbarLayout完全折叠之前,RecyclerView不应该是可滚动的,但它是(在normall滚动中,一切都很完美,只有在投掷时才出现问题).
我的布局看起来像这样:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="kg.nongrate.arseniii.collapsingtoolbarlayouttest.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<TextView
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_marginTop="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:text="1. Hello World!\n\n\n2. Hello World!\n\n\n3. Hello World!"
android:textColor="@color/colorAccent"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
android:gravity="center" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0cc"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
以下是显示我的意思的来源和两个视频: https://NonGrate@bitbucket.org/NonGrate/collapsingtoolbarlayout-recyclerview-bug.git
android android-layout android-recyclerview android-collapsingtoolbarlayout nestedscrollview
我遇到了以下几行proguard示例:
# Keep the BuildConfig
-keep class com.example.BuildConfig { *; }
Run Code Online (Sandbox Code Playgroud)
我已经运行了带有和不带有这一行的应用程序(当然,带有我的包),并且没有发现任何差异。我还查看了generate /.../ BuildConfig.java,也没有任何变化。
我需要什么来将BuildConfig保留在ProGuard中?
谢谢!