diff options
author | cyBerta <cyberta@riseup.net> | 2023-10-23 17:34:57 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-10-23 17:34:57 +0200 |
commit | 4e563004800af71d326077c8a4de4bee598fd336 (patch) | |
tree | 809f451b6d729d0a5bad0f0ef4017b94f97356e2 /app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java | |
parent | 9ad95a20f7500e3b52ae0cc50609635e8c73205f (diff) |
tint actionbar subtitle and icons according to actionbar title color
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java index 89b167f3..07608211 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java @@ -5,6 +5,8 @@ package se.leap.bitmaskclient.base.fragments; +import static se.leap.bitmaskclient.R.string.exclude_apps_fragment_title; + import android.Manifest; import android.app.Activity; import android.content.Context; @@ -41,8 +43,6 @@ import se.leap.bitmaskclient.base.utils.PreferenceHelper; import se.leap.bitmaskclient.base.utils.ViewHelper; import se.leap.bitmaskclient.base.views.SimpleCheckBox; -import static se.leap.bitmaskclient.R.string.exclude_apps_fragment_title; - /** * Created by arne on 16.11.14. */ @@ -271,7 +271,6 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.allowed_apps, menu); - SearchView searchView = (SearchView) menu.findItem( R.id.app_search_widget ).getActionView(); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override @@ -298,9 +297,23 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC return false; }); + tintSearchViewChild(searchView); super.onCreateOptionsMenu(menu, inflater); } + private void tintSearchViewChild(ViewGroup view) { + for (int i = 0; i < view.getChildCount(); i++) { + View v = view.getChildAt(i); + if (v instanceof ViewGroup) { + tintSearchViewChild((ViewGroup) v); + } + if (v instanceof ImageView) { + ((ImageView) v).setColorFilter(getResources().getColor(R.color.colorActionBarTitleFont), + android.graphics.PorterDuff.Mode.SRC_IN); + } + } + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.allowed_vpn_apps, container, false); |