Tunous / SwipeActionView

Android swipe-able view, which allows users to perform actions with swipe gestures.
Apache License 2.0
198 stars 17 forks source link

Overlapping issue #9

Closed Tvede-dk closed 5 years ago

Tvede-dk commented 7 years ago

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

Tunous commented 7 years ago

Yes an example would be really useful. Right now I have no idea how to reproduce this.

AlbertVallsAxa commented 7 years ago

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.

Tunous commented 7 years ago

Can you provide example layout file so I can reproduce this issue myself?

Tunous commented 7 years ago

I've tested it with these layouts:

For activity

<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>

For adapter items

<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?

AlbertVallsAxa commented 7 years ago

Setting _app:sav_alwaysDrawBackground="true"_ seems to solve my problem.

My root layout is a CoordinatorLayoutwith a Toolbarand 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.

Tunous commented 7 years ago

What is the SDK version that you're using?

AlbertVallsAxa commented 7 years ago

ANDROID_BUILD_SDK_VERSION=25