prevent crash on 2.3 with dim_status_bar enabled, cleanup unused imports

This commit is contained in:
Andrew Dolgov 2013-01-05 12:19:26 +04:00
parent c62d4b987b
commit 479d1f0a6c
11 changed files with 19 additions and 32 deletions

View File

@ -3,7 +3,6 @@ package org.fox.ttrss;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.fox.ttrss.types.Article;
@ -36,9 +35,6 @@ import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
public class ArticleFragment extends Fragment implements GestureDetector.OnDoubleTapListener {

View File

@ -49,7 +49,7 @@ public class ArticlePager extends Fragment {
if (article != null) {
ArticleFragment af = new ArticleFragment(article);
if (m_prefs.getBoolean("dim_status_bar", false) && getView() != null) {
if (!m_prefs.getBoolean("dim_status_bar", false) && getView() != null && !m_activity.isCompatMode()) {
getView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
}
@ -263,7 +263,7 @@ public class ArticlePager extends Fragment {
m_activity.initMenu();
if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false)) {
if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false) && !m_activity.isCompatMode()) {
getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
}

View File

@ -1,13 +1,8 @@
package org.fox.ttrss;
import java.util.List;
import org.fox.ttrss.util.DatabaseHelper;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

View File

@ -10,7 +10,6 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.MenuItem;

View File

@ -1,7 +1,5 @@
package org.fox.ttrss;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -11,24 +9,20 @@ import java.util.TimeZone;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList;
import org.fox.ttrss.types.Attachment;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.util.HeadlinesRequest;
import org.jsoup.Jsoup;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@ -43,12 +37,9 @@ import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import com.google.gson.JsonElement;

View File

@ -1,8 +1,6 @@
package org.fox.ttrss;
import java.lang.reflect.Type;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -11,7 +9,6 @@ import org.fox.ttrss.offline.OfflineDownloadService;
import org.fox.ttrss.offline.OfflineUploadService;
import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList;
import org.fox.ttrss.types.Attachment;
import org.fox.ttrss.types.Feed;
import org.fox.ttrss.types.Label;

View File

@ -9,6 +9,12 @@ public class PreferencesActivity extends PreferenceActivity {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
boolean compatMode = android.os.Build.VERSION.SDK_INT <= 10;
if (compatMode) {
findPreference("dim_status_bar").setEnabled(false);
}
}
}

View File

@ -3,7 +3,6 @@ package org.fox.ttrss.offline;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.fox.ttrss.ArticlePager;
import org.fox.ttrss.CommonActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.util.ImageCacheService;
@ -17,7 +16,6 @@ import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
@ -27,6 +25,7 @@ import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
@ -38,7 +37,6 @@ import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebView;
import android.widget.TextView;
import android.view.GestureDetector;
public class OfflineArticleFragment extends Fragment implements GestureDetector.OnDoubleTapListener {
private final String TAG = this.getClass().getSimpleName();

View File

@ -79,7 +79,7 @@ public class OfflineArticlePager extends Fragment {
if (m_cursor.moveToPosition(position)) {
if (m_prefs.getBoolean("dim_status_bar", false) && getView() != null) {
if (m_prefs.getBoolean("dim_status_bar", false) && getView() != null && !m_activity.isCompatMode()) {
getView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
}
@ -95,6 +95,15 @@ public class OfflineArticlePager extends Fragment {
}
}
@Override
public void onResume() {
super.onResume();
if (!m_activity.isCompatMode() && m_prefs.getBoolean("dim_status_bar", false) && !m_activity.isCompatMode()) {
getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
}
public OfflineArticlePager() {
super();
}

View File

@ -1,11 +1,9 @@
package org.fox.ttrss.offline;
import org.fox.ttrss.GlobalState;
import org.fox.ttrss.LoadingFragment;
import org.fox.ttrss.R;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.database.sqlite.SQLiteStatement;

View File

@ -23,7 +23,6 @@ import android.support.v4.app.Fragment;
import android.support.v4.widget.SimpleCursorAdapter;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@ -36,7 +35,6 @@ import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;