From c4723cba4a72afc4f51ae9908c2288ea57693be7 Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Tue, 28 Apr 2015 20:57:30 -0700 Subject: [PATCH 1/4] Disable RigidWebView resize throttling on Android Lollipop or higher. This fixes the problem with blank messages. --- src/com/fsck/k9/view/RigidWebView.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/fsck/k9/view/RigidWebView.java b/src/com/fsck/k9/view/RigidWebView.java index 2031648b7..796ab5674 100644 --- a/src/com/fsck/k9/view/RigidWebView.java +++ b/src/com/fsck/k9/view/RigidWebView.java @@ -18,6 +18,7 @@ package com.fsck.k9.view; import android.content.Context; +import android.os.Build; import android.util.AttributeSet; import android.util.Log; import android.webkit.WebView; @@ -45,6 +46,7 @@ public class RigidWebView extends WebView { super(context, attrs, defStyle); } + private boolean noThrottle = Build.VERSION.SDK_INT >= 21; //Build.VERSION_CODES.LOLLIPOP private static final int MIN_RESIZE_INTERVAL = 200; private static final int MAX_RESIZE_INTERVAL = 300; private final Clock mClock = Clock.INSTANCE; @@ -66,6 +68,13 @@ public class RigidWebView extends WebView { protected void onSizeChanged(int w, int h, int ow, int oh) { mRealWidth = w; mRealHeight = h; + + // Don't throttle resizes on Android 5 or higher. + if (noThrottle) { + performSizeChange(ow, oh); + return; + } + long now = mClock.getTime(); boolean recentlySized = (now - mLastSizeChangeTime < MIN_RESIZE_INTERVAL); From 4784a3f6fff346eb7c36697d1efe84180b59b044 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 30 Apr 2015 04:41:50 +0200 Subject: [PATCH 2/4] Do less work in RigidWebView in 'no throttle' case --- src/com/fsck/k9/view/RigidWebView.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/com/fsck/k9/view/RigidWebView.java b/src/com/fsck/k9/view/RigidWebView.java index 796ab5674..43e344ba5 100644 --- a/src/com/fsck/k9/view/RigidWebView.java +++ b/src/com/fsck/k9/view/RigidWebView.java @@ -35,6 +35,7 @@ import com.fsck.k9.helper.Utility; * contents with percent-based height will force the WebView to infinitely expand (or shrink). */ public class RigidWebView extends WebView { + private static final boolean NO_THROTTLE = Build.VERSION.SDK_INT >= 21; //Build.VERSION_CODES.LOLLIPOP public RigidWebView(Context context) { super(context); @@ -46,7 +47,6 @@ public class RigidWebView extends WebView { super(context, attrs, defStyle); } - private boolean noThrottle = Build.VERSION.SDK_INT >= 21; //Build.VERSION_CODES.LOLLIPOP private static final int MIN_RESIZE_INTERVAL = 200; private static final int MAX_RESIZE_INTERVAL = 300; private final Clock mClock = Clock.INSTANCE; @@ -66,15 +66,14 @@ public class RigidWebView extends WebView { @Override protected void onSizeChanged(int w, int h, int ow, int oh) { - mRealWidth = w; - mRealHeight = h; - - // Don't throttle resizes on Android 5 or higher. - if (noThrottle) { - performSizeChange(ow, oh); + if (NO_THROTTLE) { + super.onSizeChanged(w, h, ow, oh); return; } + mRealWidth = w; + mRealHeight = h; + long now = mClock.getTime(); boolean recentlySized = (now - mLastSizeChangeTime < MIN_RESIZE_INTERVAL); From 0b49c85c93d03cb9720d70b0108d1bec2afc99c7 Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 2 May 2015 17:56:36 +0200 Subject: [PATCH 3/4] Prepare changelog for 5.106 --- res/xml/changelog_master.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/xml/changelog_master.xml b/res/xml/changelog_master.xml index 1b3e0f69c..cc6946a6e 100644 --- a/res/xml/changelog_master.xml +++ b/res/xml/changelog_master.xml @@ -8,6 +8,9 @@ They are automatically updated with "ant bump-version". --> + + Fixed a bug where messages where not always displayed on Android 5.x + Reverted all changes introduced with v5.104 except for the bugfixes related to Android 5.1 From 9d225dc84c1c8f64ec07048492b0c8ba7e8e5cf0 Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 2 May 2015 17:57:09 +0200 Subject: [PATCH 4/4] Bump version to 5.106 --- AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a8db319bb..affd2f232 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="23060" + android:versionName="5.106">