Lint fixes, new icon, fixes for SearchAdapter showing weird on ICS
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 19 KiB |
@ -27,12 +27,11 @@
|
||||
<item name="progressBackgroundColor">#00000000</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="progressColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="numberColor">@color/gray_dark</item>
|
||||
<item name="autoCompleteTitleColor">@color/black</item>
|
||||
<item name="autoCompleteUrlColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="android:actionBarStyle">@style/LightActionBar</item>
|
||||
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
|
||||
</style>
|
||||
|
||||
@ -49,12 +48,11 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="progressColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="numberColor">@color/gray_dark</item>
|
||||
<item name="autoCompleteTitleColor">@color/black</item>
|
||||
<item name="autoCompleteUrlColor">@color/gray_medium</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="android:actionBarStyle">@style/LightActionBar</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back_dark</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward_dark</item>
|
||||
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
|
||||
</style>
|
||||
|
||||
|
@ -27,12 +27,11 @@
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="progressColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="numberColor">@color/gray_dark</item>
|
||||
<item name="autoCompleteTitleColor">@color/black</item>
|
||||
<item name="autoCompleteUrlColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="android:actionBarStyle">@style/LightActionBar</item>
|
||||
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
|
||||
</style>
|
||||
|
||||
@ -49,10 +48,10 @@
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="progressColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back_dark</item>
|
||||
<item name="numberColor">@color/gray_dark</item>
|
||||
<item name="autoCompleteTitleColor">@color/black</item>
|
||||
<item name="autoCompleteUrlColor">@color/gray_medium</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back_dark</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward_dark</item>
|
||||
<item name="actionOverflowButtonStyle">@style/overFlowButtonStyle</item>
|
||||
</style>
|
||||
@ -71,12 +70,5 @@
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
</style>
|
||||
|
||||
<style name="DarkActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||
<item name="android:background">@color/gray_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="LightActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid">
|
||||
<item name="android:background">@color/gray_light</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -136,6 +136,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
initialize();
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
private synchronized void initialize() {
|
||||
setContentView(R.layout.activity_main);
|
||||
@ -1439,6 +1440,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
Utils.trimCache(this);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
public void clearCookies() {
|
||||
CookieManager c = CookieManager.getInstance();
|
||||
|
@ -18,13 +18,16 @@ import java.util.Locale;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserFactory;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.graphics.Color;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -53,9 +56,12 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||
private XmlPullParserFactory mFactory;
|
||||
private XmlPullParser mXpp;
|
||||
private String mSearchSubtitle;
|
||||
private static final int API = Build.VERSION.SDK_INT;
|
||||
private Theme mTheme;
|
||||
|
||||
public SearchAdapter(Context context, boolean incognito) {
|
||||
mDatabaseHandler = HistoryDatabase.getInstance(context);
|
||||
mTheme = context.getTheme();
|
||||
mFilteredList = new ArrayList<HistoryItem>();
|
||||
mHistory = new ArrayList<HistoryItem>();
|
||||
mBookmarks = new ArrayList<HistoryItem>();
|
||||
@ -131,6 +137,8 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View row = convertView;
|
||||
@ -184,7 +192,11 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||
}
|
||||
}
|
||||
|
||||
holder.mImage.setImageDrawable(mContext.getResources().getDrawable(imageId));
|
||||
if (API < Build.VERSION_CODES.LOLLIPOP) {
|
||||
holder.mImage.setImageDrawable(mContext.getResources().getDrawable(imageId));
|
||||
} else {
|
||||
holder.mImage.setImageDrawable(mContext.getResources().getDrawable(imageId, mTheme));
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
@ -193,6 +205,8 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||
if (mFilteredList != null) {
|
||||
mFilteredList.clear();
|
||||
mFilteredList.addAll(list);
|
||||
} else {
|
||||
mFilteredList = list;
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -321,12 +335,9 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<HistoryItem> result) {
|
||||
synchronized (mFilteredList) {
|
||||
mSuggestions = result;
|
||||
|
||||
mFilteredList = getSuggestions();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
mSuggestions = result;
|
||||
mFilteredList = getSuggestions();
|
||||
notifyDataSetChanged();
|
||||
mIsExecuting = false;
|
||||
}
|
||||
|
||||
|