Show lock icon always, use correct search view text color on older devices
This commit is contained in:
parent
103fb635d1
commit
a92220f8db
|
@ -4,7 +4,6 @@ import android.app.Activity;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package de.danoeh.antennapod.menuhandler;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.support.v7.widget.SearchView;
|
||||
import android.view.Menu;
|
||||
|
@ -17,8 +19,18 @@ public class MenuItemUtils extends de.danoeh.antennapod.core.menuhandler.MenuIte
|
|||
|
||||
public static MenuItem addSearchItem(Menu menu, SearchView searchView) {
|
||||
MenuItem item = menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label);
|
||||
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW | MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||
MenuItemCompat.setActionView(item, searchView);
|
||||
|
||||
if(Build.VERSION.SDK_INT < 14) {
|
||||
SearchView.SearchAutoComplete textField = (SearchView.SearchAutoComplete) searchView.findViewById(de.danoeh.antennapod.R.id.search_src_text);
|
||||
if(UserPreferences.getTheme() == de.danoeh.antennapod.R.style.Theme_AntennaPod_Dark) {
|
||||
textField.setTextColor(Resources.getSystem().getColor(android.R.color.white));
|
||||
} else {
|
||||
textField.setTextColor(Resources.getSystem().getColor(android.R.color.black));
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:id="@+id/queue_lock"
|
||||
android:title=""
|
||||
android:menuCategory="container"
|
||||
custom:showAsAction="ifRoom" />
|
||||
custom:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/refresh_item"
|
||||
|
|
Loading…
Reference in New Issue