mardi 26 mai 2015

webview draw white trace over other layout when moving

I'm moving a webview inside a nested layout. The webview is positioned behind the others part of the view (drawn first).When I rotate it and a corner goes under another part of the layout (atop of the webview), the part of the view supposed to cover the webview become white. I managed to correct this bug by redrawing the view when I'm moving the webview. However, I am now trying to use animation. I cannot redraw the whole thing during the animation (or I didn't find how to do it), so now a ugly white trace is left over the other view during the animation duration. How can I get ride of that?

Here is my XML layout :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:background="#00000000"
android:id="@+id/root">


<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_horizontal"
    android:layout_alignParentLeft="false"
    android:layout_marginLeft="0dp"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:id="@+id/AdContent"
    android:layout_above="@+id/FollowAd"
    android:layout_below="@+id/DateView">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:id="@+id/SlideBg"
        android:layout_gravity="center"
        android:visibility="visible">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:id="@+id/DismissBg"
            android:scaleType="centerInside"
            android:src="@drawable/icon_widget_unlock_ad_a"
            android:background="#ff6eff21" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:id="@+id/FollowBg"
            android:scaleType="centerInside"
            android:src="@drawable/icon_widget_unlock_a"
            android:background="#ff6eff21" />
    </LinearLayout>

    <WebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/webView"
        android:layout_gravity="center"
        android:background="#00000000"
        android:theme="@android:style/Theme.Translucent" />
</FrameLayout>

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Large Text"
    android:id="@+id/DateView"
    android:background="#ff000000"
    android:layout_alignParentTop="true"
    android:maxLines="1"
    android:gravity="center_horizontal" />

<SurfaceView
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:id="@+id/surfaceView"
    android:layout_alignBottom="@+id/NavigLogo"
    android:layout_below="@+id/AdContent"
    android:background="#ff000000"
    android:layout_alignParentBottom="true" />

<ImageView
android:layout_width="50dp"
android:layout_height="40dp"
android:id="@+id/FollowAd"
android:layout_alignParentEnd="false"
android:layout_alignParentRight="false"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="false"
android:layout_alignParentBottom="true"
android:paddingLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:src="@drawable/icon_widget_unlock_w"/>

<ImageView
    android:layout_width="50dp"
    android:layout_height="40dp"
    android:id="@+id/DismissAd"
    android:layout_alignParentEnd="false"
    android:layout_alignParentRight="true"
    android:layout_alignParentLeft="false"
    android:layout_alignParentStart="false"
    android:layout_alignParentBottom="true"
    android:paddingRight="10dp"
    android:layout_marginBottom="20dp"
    android:src="@drawable/icon_widget_unlock_ad_w"/>

<ImageView
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:id="@+id/NavigLogo"
    android:src="@drawable/logo_rond"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="10dp" />

Aucun commentaire:

Enregistrer un commentaire