mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Move AOSP files.
Patch RigidWebView for K9. MessageWebView would need to extend RigidWebView.
This commit is contained in:
parent
97d571cb43
commit
fa962e7bd7
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.email;
|
||||
package com.fsck.k9;
|
||||
|
||||
/**
|
||||
* A class provide the current time (like {@link System#currentTimeMillis()}).
|
@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.email;
|
||||
|
||||
import com.android.emailcommon.Logging;
|
||||
package com.fsck.k9;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
@ -96,7 +94,7 @@ public class Throttle {
|
||||
}
|
||||
|
||||
private void debugLog(String message) {
|
||||
Log.d(Logging.LOG_TAG, "Throttle: [" + mName + "] " + message);
|
||||
Log.d(K9.LOG_TAG, "Throttle: [" + mName + "] " + message);
|
||||
}
|
||||
|
||||
private boolean isCallbackScheduled() {
|
@ -8,6 +8,8 @@ import android.database.Cursor;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.util.Log;
|
||||
import android.widget.EditText;
|
||||
@ -65,6 +67,8 @@ public class Utility {
|
||||
private static final Pattern TAG_PATTERN = Pattern.compile("\\[[-_a-z0-9]+\\] ",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static Handler sMainThreadHandler;
|
||||
|
||||
public static boolean arrayContains(Object[] a, Object o) {
|
||||
for (Object element : a) {
|
||||
if (element.equals(o)) {
|
||||
@ -714,4 +718,16 @@ public class Utility {
|
||||
|
||||
return newArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a {@link Handler} tied to the main thread.
|
||||
*/
|
||||
public static Handler getMainThreadHandler() {
|
||||
if (sMainThreadHandler == null) {
|
||||
// No need to synchronize -- it's okay to create an extra Handler, which will be used
|
||||
// only once and then thrown away.
|
||||
sMainThreadHandler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
return sMainThreadHandler;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import com.fsck.k9.helper.HtmlConverter;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class MessageWebView extends WebView {
|
||||
public class MessageWebView extends RigidWebView {
|
||||
|
||||
|
||||
/**
|
||||
|
@ -15,18 +15,17 @@
|
||||
*/
|
||||
|
||||
|
||||
package com.android.email.view;
|
||||
package com.fsck.k9.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.android.email.Clock;
|
||||
import com.android.email.Email;
|
||||
import com.android.email.Throttle;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
import com.fsck.k9.Clock;
|
||||
import com.fsck.k9.K9;
|
||||
import com.fsck.k9.Throttle;
|
||||
import com.fsck.k9.helper.Utility;
|
||||
|
||||
/**
|
||||
* A custom WebView that is robust to rapid resize events in sequence.
|
||||
@ -75,8 +74,8 @@ public class RigidWebView extends WebView {
|
||||
if (mIgnoreNext) {
|
||||
mIgnoreNext = false;
|
||||
if (recentlySized) {
|
||||
if (Email.DEBUG) {
|
||||
Log.w(Logging.LOG_TAG, "Supressing size change in RigidWebView");
|
||||
if (K9.DEBUG) {
|
||||
Log.w(K9.LOG_TAG, "Supressing size change in RigidWebView");
|
||||
}
|
||||
return;
|
||||
}
|
Loading…
Reference in New Issue
Block a user