Closed Tvede-dk closed 5 years ago
Yes an example would be really useful. Right now I have no idea how to reproduce this.
The same issue here. The layout inside SwipeActionView is painted over the NavigationBar(buttons bar) when I scroll. I have the issue on RecyclerViews and on NestedScrollViews.
Can you provide example layout file so I can reproduce this issue myself?
I've tested it with these layouts:
<FrameLayout 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:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="me.thanel.swipeactionview.sample.BottomNavigationActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?android:attr/windowBackground"
app:menu="@menu/navigation" />
</FrameLayout>
<me.thanel.swipeactionview.SwipeActionView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorPrimary">
<ImageView
android:layout_width="36dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:src="@mipmap/ic_launcher" />
<ImageView
android:layout_width="36dp"
android:layout_height="match_parent"
android:layout_gravity="end|center_vertical"
android:src="@mipmap/ic_launcher" />
<TextView
style="@style/TextAppearance.AppCompat.Body1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:padding="16dp"
android:text="Test text" />
</me.thanel.swipeactionview.SwipeActionView>
But didn't manage to reproduce. Is there anything that I'm missing in these?
Setting _app:sav_alwaysDrawBackground="true"
_ seems to solve my problem.
My root layout is a CoordinatorLayout
with a Toolbar
and NestedScrollView.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="start"
android:layout_gravity="start">
<include layout="@layout/toolbar" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<View
android:id="@+id/fakeView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:visibility="visible" />
</FrameLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/youtube_player_container_full_screen"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
The Coordinator as root is added by code.
getLayoutInflater().inflate(R.layout.root, new CoordinatorLayout(AbstractBaseActivity.this));
The device that I used for testing is a Nexus 6.
What is the SDK version that you're using?
ANDROID_BUILD_SDK_VERSION=25
There appears somewhen to be an issue with the always draw background, (the issue appears to be in recycler views. with toolbars (set as the actionbar)) here appears somewhen to be an issue with the always draw background, which appears to be in recycler views. The issue appears as the view get drawn OVER the toolbar (actionbar), this means that the line 531 in SwipeActionView.kt
canvas.drawInBoundsOf
does not respect the bounds / view's clipping correctly. Thus a solution would be to calculate the correct clipping or container in that case.I will try and come up with a example