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
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
android:targetSdkVersion="18" />
|
android:targetSdkVersion="19" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<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
|
// prevent flicker in ics
|
||||||
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
|
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);
|
web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
|
|||||||
cssOverride = "body { background : transparent; }";
|
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);
|
web.setBackgroundColor(Color.TRANSPARENT);
|
||||||
} else {
|
} else {
|
||||||
// seriously?
|
// seriously?
|
||||||
|
@ -155,7 +155,7 @@ public class CommonActivity extends SherlockFragmentActivity {
|
|||||||
@SuppressLint({ "NewApi", "ServiceCast" })
|
@SuppressLint({ "NewApi", "ServiceCast" })
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void copyToClipboard(String str) {
|
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);
|
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
clipboard.setText(str);
|
clipboard.setText(str);
|
||||||
} else {
|
} else {
|
||||||
@ -196,7 +196,7 @@ public class CommonActivity extends SherlockFragmentActivity {
|
|||||||
protected int getScreenWidthInPixel() {
|
protected int getScreenWidthInPixel() {
|
||||||
Display display = getWindowManager().getDefaultDisplay();
|
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();
|
Point size = new Point();
|
||||||
display.getSize(size);
|
display.getSize(size);
|
||||||
int width = size.x;
|
int width = size.x;
|
||||||
|
@ -594,7 +594,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
}
|
}
|
||||||
TextView titleText = new TextView(this);
|
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);
|
titleText.setPaddingRelative(24, 24, 24, 24);
|
||||||
} else {
|
} else {
|
||||||
titleText.setPadding(24, 24, 24, 24);
|
titleText.setPadding(24, 24, 24, 24);
|
||||||
@ -891,11 +891,9 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case R.id.share_article:
|
case R.id.share_article:
|
||||||
//if (android.os.Build.VERSION.SDK_INT < 14) {
|
if (ap != null) {
|
||||||
if (ap != null) {
|
shareArticle(ap.getSelectedArticle());
|
||||||
shareArticle(ap.getSelectedArticle());
|
}
|
||||||
}
|
|
||||||
//}
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.toggle_marked:
|
case R.id.toggle_marked:
|
||||||
if (ap != null & ap.getSelectedArticle() != null) {
|
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);
|
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
|
||||||
if (hf != null) {
|
if (hf != null) {
|
||||||
|
@ -10,10 +10,11 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
|
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
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) {
|
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);
|
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);
|
titleText.setPaddingRelative(24, 24, 24, 24);
|
||||||
} else {
|
} else {
|
||||||
titleText.setPadding(24, 24, 24, 24);
|
titleText.setPadding(24, 24, 24, 24);
|
||||||
|
@ -215,7 +215,7 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
|
|||||||
|
|
||||||
// prevent flicker in ics
|
// prevent flicker in ics
|
||||||
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
|
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);
|
web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
|
|||||||
cssOverride = "body { background : transparent; }";
|
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);
|
web.setBackgroundColor(Color.TRANSPARENT);
|
||||||
} else {
|
} else {
|
||||||
// seriously?
|
// seriously?
|
||||||
|
@ -29,7 +29,7 @@ public class CommonActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
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);
|
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user