Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifacts appearing on flipping #21

Closed
ljaniszewski opened this issue May 2, 2018 · 7 comments
Closed

Artifacts appearing on flipping #21

ljaniszewski opened this issue May 2, 2018 · 7 comments

Comments

@ljaniszewski
Copy link

ljaniszewski commented May 2, 2018

The best to see for yourself
https://youtu.be/CSgVNxgrKIY

the code:

<?xml version="1.0" encoding="utf-8"?>
<com.wajahatkarim3.easyflipview.EasyFlipView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/flipper"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    app:flipOnTouch="true"
    app:flipEnabled="true"
    app:flipDuration="400"
    app:flipType="horizontal"
    >

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="16dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Front"
            android:textAppearance="@style/TextAppearance.AppCompat.Large" />

    </android.support.v7.widget.CardView>

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="16dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.AppCompat.Large"
            android:text="Back"/>

    </android.support.v7.widget.CardView>

</com.wajahatkarim3.easyflipview.EasyFlipView>

Any idea why this is happening/what I'm doing wrong?

@wajahatkarim3
Copy link
Owner

I think its happening due to CardView's drop shadow. I would have to look at it.

@ljaniszewski
Copy link
Author

Thanks man, I just done exactly the thing haha.
I set elevation to 0dp and it's fixed. But CardView without elevation is like a dog without a bone! haha

@wajahatkarim3
Copy link
Owner

I see. I just looked at the demo app, and i realized that the first demo i created for EasyFlipView was using CardView. Here is the link to the front side layout: https://github.com/wajahatkarim3/EasyFlipView/blob/master/app/src/main/res/layout/flash_card_layout_back.xml

I think you have increased the initial elevation or something. Because the flipping in the demo looks good.

@ljaniszewski
Copy link
Author

No, elevation is standard. So this layout is basically the same, only uses tags instead normal nesting. I am going to try use this that way, but I suspect there would be no difference.
The phone is Nexus 5, I will try and test this on other phones in a minute.

@wajahatkarim3
Copy link
Owner

Yeah Sure. Do let me know 👍

@ljaniszewski
Copy link
Author

Testes on Huawei p8, Samsung s5, and LG g3 additionally, and the effect is the same, though on LG g3 there is another weird thing going on - the card doesn't flip on touch most of the times https://youtu.be/o4jtiOZVVJ0

Is there demo .apk available somewhere?

@wajahatkarim3
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants