tint search view in upload activity

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-05-29 10:39:10 +02:00 committed by AndyScherzinger
parent df01428150
commit 7ae333635a
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 15 additions and 1 deletions

View file

@ -35,9 +35,11 @@ import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatSpinner;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -45,6 +47,8 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
@ -230,6 +234,16 @@ public class UploadFilesActivity extends FileActivity implements
MenuItem switchView = menu.findItem(R.id.action_switch_view);
switchView.setTitle(isGridView() ? R.string.action_switch_list_view : R.string.action_switch_grid_view);
int fontColor = ThemeUtils.fontColor(this);
final MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
EditText editText = searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
editText.setHintTextColor(fontColor);
editText.setTextColor(fontColor);
ImageView searchClose = searchView.findViewById(android.support.v7.appcompat.R.id.search_close_btn);
searchClose.setColorFilter(fontColor);
return super.onCreateOptionsMenu(menu);
}

View file

@ -24,7 +24,7 @@
android:title="@string/actionbar_search"
android:contentDescription="@string/actionbar_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom|collapseActionView"/>
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_select_all"
android:checkable="true"