Skip to content

Commit

Permalink
Merge pull request #841 from Iterable/MOB-9211-InApp-Bug-Fix
Browse files Browse the repository at this point in the history
[MOB-9211] - InApp resizing fix
  • Loading branch information
Ayyanchira authored Nov 20, 2024
2 parents d099e27 + 08e3ea0 commit 64d89bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.view.OrientationEventListener;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
Expand Down Expand Up @@ -168,14 +167,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
webView.setId(R.id.webView);
webView.createWithHtml(this, htmlString);

webView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
runResizeScript();
return true;
}
});

if (orientationListener == null) {
orientationListener = new OrientationEventListener(getContext(), SensorManager.SENSOR_DELAY_NORMAL) {
// Resize the webView on device rotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
@Override
public void onPageFinished(WebView view, String url) {
inAppHTMLNotification.setLoaded(true);
inAppHTMLNotification.runResizeScript();
view.postDelayed(inAppHTMLNotification::runResizeScript, 100);
}
}

0 comments on commit 64d89bf

Please sign in to comment.