mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-25 15:11:52 -05:00
Use Build.VERSION.SDK_INT instead of parsing Build.VERSION.SDK
This commit is contained in:
parent
14ff4d006e
commit
07fa0c7264
@ -265,7 +265,7 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
mZoomControlsEnabled.setChecked(K9.zoomControlsEnabled());
|
mZoomControlsEnabled.setChecked(K9.zoomControlsEnabled());
|
||||||
|
|
||||||
mMobileOptimizedLayout = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT);
|
mMobileOptimizedLayout = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT);
|
||||||
if (Integer.parseInt(Build.VERSION.SDK) <= 7) {
|
if (Build.VERSION.SDK_INT <= 7) {
|
||||||
mMobileOptimizedLayout.setEnabled(false);
|
mMobileOptimizedLayout.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,10 +40,8 @@ public abstract class Contacts {
|
|||||||
* Check the version of the SDK we are running on. Choose an
|
* Check the version of the SDK we are running on. Choose an
|
||||||
* implementation class designed for that version of the SDK.
|
* implementation class designed for that version of the SDK.
|
||||||
*/
|
*/
|
||||||
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
|
||||||
|
|
||||||
String className = null;
|
String className = null;
|
||||||
if (sdkVersion <= Build.VERSION_CODES.ECLAIR_MR1) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ECLAIR_MR1) {
|
||||||
/*
|
/*
|
||||||
* The new API was introduced with SDK 5. But Android versions < 2.2
|
* The new API was introduced with SDK 5. But Android versions < 2.2
|
||||||
* need some additional code to be able to search for phonetic names.
|
* need some additional code to be able to search for phonetic names.
|
||||||
|
@ -91,9 +91,7 @@ public class MessageWebView extends WebView {
|
|||||||
|
|
||||||
// SINGLE_COLUMN layout was broken on Android < 2.2, so we
|
// SINGLE_COLUMN layout was broken on Android < 2.2, so we
|
||||||
// administratively disable it
|
// administratively disable it
|
||||||
if (
|
if (Build.VERSION.SDK_INT > 7 && K9.mobileOptimizedLayout()) {
|
||||||
(Integer.parseInt(Build.VERSION.SDK) > 7)
|
|
||||||
&& K9.mobileOptimizedLayout()) {
|
|
||||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||||
} else {
|
} else {
|
||||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user