I have 2 WebView stacked up in 2 container ViewGroups (LinearLayout)
like this:
<merge
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/container_view_0"
android:visibility="invisible"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<LinearLayout
android:id="@+id/container_view_1"
android:visibility="invisible"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</merge>
Finally, it merges with DecorView.
I am adding these WebView like this in my activity:
containerView1.addView(new WebView());
containerView2.addView(new WebView());
Now the problem is - invalidate from WebView are not redrawing my
WebView properly. This is most apparent with zoom controls. When I
click on zoom in or zoom out, it redraws for a second and then WebView
freezes completely. Touch or click - nothing happens. It just freezes
When I looked in framework WebView code - on ZoonIn/ZoomOut it starts
animation and calls invalidate on WebView. That WebView invalidate is
either not propagating to my LinearLayout or something else, WebView
just freezes.
I tried using my custom WebView and override invalidate like this:
/* (non-Javadoc)
* @see android.view.View#invalidate()
*/
@Override
public void invalidate() {
super.invalidate();
if (mRect == null)
mRect = new Rect(0, 0, getWidth(), getHeight());
mRect.right = getWidth();
mRect.bottom = getHeight();
if (mParentView == null)
mParentView = getParent();
if (mParentView != null)
mParentView.invalidateChild(this, mRect);
}
this works and does not freeze WebView completely but this hack looks
very vulnerable.
Any idea. I assume I am missing some flag in my view xml.
Thanks for help,
Abhi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---