From 7ae333635a13083a099a92dfc237fac206d861b6 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 29 May 2018 10:39:10 +0200 Subject: [PATCH] tint search view in upload activity Signed-off-by: tobiasKaminsky --- .../android/ui/activity/UploadFilesActivity.java | 14 ++++++++++++++ src/main/res/menu/upload_files_picker.xml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java b/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java index a890361f39..ba06e28155 100644 --- a/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -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); } diff --git a/src/main/res/menu/upload_files_picker.xml b/src/main/res/menu/upload_files_picker.xml index 98e0b9a5d5..8756ec8148 100644 --- a/src/main/res/menu/upload_files_picker.xml +++ b/src/main/res/menu/upload_files_picker.xml @@ -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"/>