replace integer android version numbers with version codes
disable webview_accel preference on 2.3 target sdk 19
This commit is contained in:
parent
4ab63ea6b8
commit
f2dde1362b
@ -6,7 +6,7 @@
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="18" />
|
||||
android:targetSdkVersion="19" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
@ -168,7 +168,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
|
||||
|
||||
// prevent flicker in ics
|
||||
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
|
||||
cssOverride = "body { background : transparent; }";
|
||||
}
|
||||
|
||||
if (useTitleWebView || android.os.Build.VERSION.SDK_INT < 11) {
|
||||
if (useTitleWebView || android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
web.setBackgroundColor(Color.TRANSPARENT);
|
||||
} else {
|
||||
// seriously?
|
||||
|
@ -155,7 +155,7 @@ public class CommonActivity extends SherlockFragmentActivity {
|
||||
@SuppressLint({ "NewApi", "ServiceCast" })
|
||||
@SuppressWarnings("deprecation")
|
||||
public void copyToClipboard(String str) {
|
||||
if (android.os.Build.VERSION.SDK_INT < 11) {
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clipboard.setText(str);
|
||||
} else {
|
||||
@ -196,7 +196,7 @@ public class CommonActivity extends SherlockFragmentActivity {
|
||||
protected int getScreenWidthInPixel() {
|
||||
Display display = getWindowManager().getDefaultDisplay();
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 13) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
|
||||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
int width = size.x;
|
||||
|
@ -594,7 +594,7 @@ public class OnlineActivity extends CommonActivity {
|
||||
}
|
||||
TextView titleText = new TextView(this);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 16) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
|
||||
titleText.setPaddingRelative(24, 24, 24, 24);
|
||||
} else {
|
||||
titleText.setPadding(24, 24, 24, 24);
|
||||
@ -891,11 +891,9 @@ public class OnlineActivity extends CommonActivity {
|
||||
}
|
||||
return true;
|
||||
case R.id.share_article:
|
||||
//if (android.os.Build.VERSION.SDK_INT < 14) {
|
||||
if (ap != null) {
|
||||
shareArticle(ap.getSelectedArticle());
|
||||
}
|
||||
//}
|
||||
if (ap != null) {
|
||||
shareArticle(ap.getSelectedArticle());
|
||||
}
|
||||
return true;
|
||||
case R.id.toggle_marked:
|
||||
if (ap != null & ap.getSelectedArticle() != null) {
|
||||
@ -1526,20 +1524,6 @@ public class OnlineActivity extends CommonActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/* if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
|
||||
|
||||
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||
|
||||
if (af != null && af.getSelectedArticle() != null) {
|
||||
shareProvider.setShareIntent(getShareIntent(af.getSelectedArticle()));
|
||||
|
||||
if (!isSmallScreen()) {
|
||||
m_menu.findItem(R.id.share_article).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||
|
||||
if (hf != null) {
|
||||
|
@ -10,10 +10,11 @@ public class PreferencesActivity extends PreferenceActivity {
|
||||
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
||||
boolean compatMode = android.os.Build.VERSION.SDK_INT <= 10;
|
||||
boolean compatMode = android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB;
|
||||
|
||||
if (compatMode) {
|
||||
findPreference("dim_status_bar").setEnabled(false);
|
||||
findPreference("dim_status_bar").setEnabled(false);
|
||||
findPreference("webview_hardware_accel").setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class OfflineActivity extends CommonActivity {
|
||||
}
|
||||
TextView titleText = new TextView(this);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 16) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
|
||||
titleText.setPaddingRelative(24, 24, 24, 24);
|
||||
} else {
|
||||
titleText.setPadding(24, 24, 24, 24);
|
||||
|
@ -215,7 +215,7 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
|
||||
|
||||
// prevent flicker in ics
|
||||
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
}
|
||||
}
|
||||
@ -230,7 +230,7 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
|
||||
cssOverride = "body { background : transparent; }";
|
||||
}
|
||||
|
||||
if (useTitleWebView || android.os.Build.VERSION.SDK_INT < 11) {
|
||||
if (useTitleWebView || android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
web.setBackgroundColor(Color.TRANSPARENT);
|
||||
} else {
|
||||
// seriously?
|
||||
|
@ -29,7 +29,7 @@ public class CommonActivity extends Activity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
m_compatMode = android.os.Build.VERSION.SDK_INT <= 10;
|
||||
m_compatMode = android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB;
|
||||
|
||||
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user