remove compat mode, set minimum sdk version to 16 (jelly bean)

This commit is contained in:
Andrew Dolgov 2015-01-27 12:02:04 +03:00
parent 9696778835
commit 183079172d
12 changed files with 35 additions and 100 deletions

View File

@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "org.fox.ttrss"
minSdkVersion 8
minSdkVersion 16
targetSdkVersion 21
}

View File

@ -79,6 +79,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@ -5,7 +5,7 @@
android:versionName="1.86" >
<uses-sdk
android:minSdkVersion="10"
android:minSdkVersion="16"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />

View File

@ -14,7 +14,6 @@ import android.text.Html;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@ -32,10 +31,6 @@ import com.shamanland.fab.ShowHideOnScroll;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Attachment;
import org.fox.ttrss.util.TypefaceCache;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.net.MalformedURLException;
import java.net.URI;
@ -308,11 +303,6 @@ public class ArticleFragment extends Fragment {
unregisterForContextMenu(m_web);
return true;
} else {
if (m_activity.isCompatMode()) {
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
shiftPressEvent.dispatch(m_web);
}
return false;
}
}
@ -356,30 +346,11 @@ public class ArticleFragment extends Fragment {
String articleContent = m_article.content != null ? m_article.content : "";
if (m_activity.isCompatMode() || !acceleratedWebview) {
Document doc = Jsoup.parse(articleContent);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ws.setJavaScriptEnabled(true);
if (doc != null) {
// thanks webview for crashing on <video> tag
Elements videos = doc.select("video");
for (Element video : videos)
video.remove();
videos = doc.select("iframe");
for (Element video : videos)
video.remove();
articleContent = doc.toString();
}
} else {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ws.setJavaScriptEnabled(true);
m_chromeClient = new FSVideoChromeClient(view);
m_web.setWebChromeClient(m_chromeClient);
}
m_chromeClient = new FSVideoChromeClient(view);
m_web.setWebChromeClient(m_chromeClient);
}
if (m_prefs.getBoolean("justify_article_text", true)) {
@ -525,18 +496,14 @@ public class ArticleFragment extends Fragment {
public void onPause() {
super.onPause();
if (!m_activity.isCompatMode()) {
m_web.onPause();
}
m_web.onPause();
}
@Override
public void onResume() {
super.onResume();
if (!m_activity.isCompatMode()) {
m_web.onResume();
}
m_web.onResume();
}
public boolean inCustomView() {

View File

@ -36,7 +36,6 @@ public class CommonActivity extends ActionBarActivity {
private SQLiteDatabase m_writableDb;
private boolean m_smallScreenMode = true;
private boolean m_compatMode = false;
private String m_theme;
private boolean m_fullScreen;
@ -142,10 +141,6 @@ public class CommonActivity extends ActionBarActivity {
initDatabase();
m_compatMode = android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB;
Log.d(TAG, "m_compatMode=" + m_compatMode);
super.onCreate(savedInstanceState);
}
@ -166,10 +161,6 @@ public class CommonActivity extends ActionBarActivity {
return m_smallScreenMode;
}
public boolean isCompatMode() {
return m_compatMode;
}
@SuppressWarnings("deprecation")
public boolean isPortrait() {
Display display = getWindowManager().getDefaultDisplay();

View File

@ -208,13 +208,10 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
ListView list = (ListView)view.findViewById(R.id.feeds);
m_adapter = new FeedCategoryListAdapter(getActivity(), R.layout.feeds_row, (ArrayList<FeedCategory>)m_cats);

View File

@ -279,12 +279,10 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
/* Button parentBtn = (Button) view.findViewById(R.id.open_parent);

View File

@ -324,13 +324,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
ListView list = (ListView)view.findViewById(R.id.headlines_list);
@ -947,12 +944,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
flavorImageLoadingBar.setVisibility(View.INVISIBLE);
if (arg2.getWidth() > FLAVOR_IMG_MIN_WIDTH && arg2.getHeight() > FLAVOR_IMG_MIN_HEIGHT) {
if (!m_activity.isCompatMode() && weNeedAnimation) {
if (weNeedAnimation) {
ObjectAnimator anim = ObjectAnimator.ofFloat(flavorImageView, "alpha", 0f, 1f);
anim.setDuration(200);
anim.start();
}
//flavorImageHolder.setVisibility(View.VISIBLE);
} else {

View File

@ -5,7 +5,6 @@ import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
@ -16,7 +15,6 @@ import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
@ -29,7 +27,6 @@ import android.widget.TextView;
import com.shamanland.fab.ShowHideOnScroll;
import org.fox.ttrss.CommonActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.util.ImageCacheService;
import org.fox.ttrss.util.TypefaceCache;
@ -240,11 +237,6 @@ public class OfflineArticleFragment extends Fragment {
unregisterForContextMenu(web);
return true;
} else {
if (m_activity.isCompatMode()) {
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
shiftPressEvent.dispatch(web);
}
return false;
}
}

View File

@ -139,12 +139,10 @@ public class OfflineFeedCategoriesFragment extends Fragment implements OnItemCli
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
ListView list = (ListView)view.findViewById(R.id.feeds);

View File

@ -152,12 +152,10 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
ListView list = (ListView)view.findViewById(R.id.feeds);

View File

@ -302,12 +302,10 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
}
});
if (!m_activity.isCompatMode()) {
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
}
m_swipeLayout.setColorScheme(android.R.color.holo_green_dark,
android.R.color.holo_red_dark,
android.R.color.holo_blue_dark,
android.R.color.holo_orange_dark);
m_cursor = createCursor();