diff options
| author | Grace Kloba <klobag@google.com> | 2009-12-20 11:33:58 -0800 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2009-12-20 11:33:58 -0800 |
| commit | 9a67c82089e43d37f5038c74b0e1dca8edc4ac8a (patch) | |
| tree | b9d94f8fd20045a3d8a89c5b6720427c50d27fb7 /core/java/android/webkit/ViewManager.java | |
| parent | 4d0e827d0be6085893428b420ec5800f1973a43b (diff) | |
Address the multiple resizing during initializing
problem adobe run into.
When a child view is created, we first hide it if
the webview is not ready to draw yet. This will avoid
the multiple resizing notification.
Diffstat (limited to 'core/java/android/webkit/ViewManager.java')
| -rw-r--r-- | core/java/android/webkit/ViewManager.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/java/android/webkit/ViewManager.java b/core/java/android/webkit/ViewManager.java index 6a838c3b3a9b..75db0a0ffd2d 100644 --- a/core/java/android/webkit/ViewManager.java +++ b/core/java/android/webkit/ViewManager.java @@ -16,7 +16,6 @@ package android.webkit; -import android.content.Context; import android.view.View; import android.widget.AbsoluteLayout; @@ -26,6 +25,7 @@ class ViewManager { private final WebView mWebView; private final ArrayList<ChildView> mChildren = new ArrayList<ChildView>(); private boolean mHidden; + private boolean mReadyToDraw; class ChildView { int x; @@ -70,6 +70,9 @@ class ViewManager { void attachViewOnUIThread(AbsoluteLayout.LayoutParams lp) { mWebView.addView(mView, lp); mChildren.add(this); + if (!mReadyToDraw) { + mView.setVisibility(View.GONE); + } } void removeView() { @@ -154,4 +157,23 @@ class ViewManager { } mHidden = false; } + + void postResetStateAll() { + mWebView.mPrivateHandler.post(new Runnable() { + public void run() { + mReadyToDraw = false; + } + }); + } + + void postReadyToDrawAll() { + mWebView.mPrivateHandler.post(new Runnable() { + public void run() { + mReadyToDraw = true; + for (ChildView v : mChildren) { + v.mView.setVisibility(View.VISIBLE); + } + } + }); + } } |
