mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-04 08:35:08 -05:00
Extracted code to disable Lint warning when using newer API
This commit is contained in:
parent
1f2104cae1
commit
a281b3401e
@ -1,5 +1,6 @@
|
||||
package com.fsck.k9.view;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
@ -98,16 +99,7 @@ public class MessageWebView extends WebView {
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build.VERSION.SDK is deprecated cause it just returns the
|
||||
* "its raw String representation"
|
||||
* http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#GINGERBREAD
|
||||
* http://developer.android.com/reference/android/os/Build.VERSION.html#SDK
|
||||
*/
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
setOverScrollMode(OVER_SCROLL_NEVER);
|
||||
}
|
||||
|
||||
disableOverscrolling();
|
||||
|
||||
webSettings.setTextSize(K9.getFontSizes().getMessageViewContent());
|
||||
|
||||
@ -116,6 +108,13 @@ public class MessageWebView extends WebView {
|
||||
|
||||
}
|
||||
|
||||
@TargetApi(9)
|
||||
private void disableOverscrolling() {
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
setOverScrollMode(OVER_SCROLL_NEVER);
|
||||
}
|
||||
}
|
||||
|
||||
public void setText(String text, String contentType) {
|
||||
String content = text;
|
||||
if (K9.getK9Theme() == K9.THEME_DARK) {
|
||||
|
Loading…
Reference in New Issue
Block a user