[android] Use material properties in styles and themes

Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-08-10 07:44:15 +02:00
committed by Konstantin Pastbin
parent 2492e8bda4
commit 826ddba26f
66 changed files with 97 additions and 97 deletions

View File

@@ -87,8 +87,8 @@ public class AdvancedTimetableFragment extends BaseMwmFragment implements View.O
private void setExampleDrawables(@DrawableRes int left, @DrawableRes int right)
{
mExamplesTitle.setCompoundDrawablesRelativeWithIntrinsicBounds(
Graphics.tint(requireActivity(), left, androidx.appcompat.R.attr.colorAccent), null,
Graphics.tint(requireActivity(), right, androidx.appcompat.R.attr.colorAccent), null);
Graphics.tint(requireActivity(), left, com.google.android.material.R.attr.colorSecondary), null,
Graphics.tint(requireActivity(), right, com.google.android.material.R.attr.colorSecondary), null);
}
@Override

View File

@@ -215,7 +215,7 @@ public class SearchWheel implements View.OnClickListener
final SearchOption searchOption = mMapButtonsViewModel.getSearchOption().getValue();
mSearchButton.setImageDrawable(Graphics.tint(
mSearchButton.getContext(), searchOption == null ? R.drawable.ic_routing_search_off : searchOption.mDrawableOff,
androidx.appcompat.R.attr.colorAccent));
com.google.android.material.R.attr.colorSecondary));
}
@Override

View File

@@ -261,9 +261,9 @@ final class RoutingBottomMenuController implements View.OnClickListener
{
UiUtils.show(mActionButton);
Drawable icon = ContextCompat.getDrawable(mContext, R.drawable.ic_location_crosshair);
int colorAccent = ContextCompat.getColor(
mContext, UiUtils.getStyledResourceId(mContext, androidx.appcompat.R.attr.colorAccent));
mActionIcon.setImageDrawable(Graphics.tint(icon, colorAccent));
int colorSecondary = ContextCompat.getColor(
mContext, UiUtils.getStyledResourceId(mContext, com.google.android.material.R.attr.colorSecondary));
mActionIcon.setImageDrawable(Graphics.tint(icon, colorSecondary));
}
else
{

View File

@@ -65,7 +65,7 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
@AttrRes
int getTintAttr()
{
return androidx.appcompat.R.attr.colorAccent;
return com.google.android.material.R.attr.colorSecondary;
}
abstract TextView getTitleView();

View File

@@ -92,7 +92,7 @@ class TabAdapter extends FragmentPagerAdapter
editor.putInt(Config.KEY_PREF_LAST_SEARCHED_TAB, tab.getPosition());
editor.apply();
super.onTabSelected(tab);
Graphics.tint(mContext, tab.getIcon(), androidx.appcompat.R.attr.colorAccent);
Graphics.tint(mContext, tab.getIcon(), com.google.android.material.R.attr.colorSecondary);
}
@Override

View File

@@ -328,7 +328,7 @@ public class VoiceInstructionsSettingsFragment extends BaseXmlSettingsFragment
// Set link color.
link.setSpan(
new ForegroundColorSpan(ContextCompat.getColor(
requireContext(), UiUtils.getStyledResourceId(requireContext(), androidx.appcompat.R.attr.colorAccent))),
requireContext(), UiUtils.getStyledResourceId(requireContext(), com.google.android.material.R.attr.colorSecondary))),
0, ttsLinkText.length(), 0);
ttsLangInfoLink.setSummary(link);

View File

@@ -52,7 +52,7 @@ public class MyPositionButton
if (mode == LocationState.FOLLOW || mode == LocationState.FOLLOW_AND_ROTATE
|| mode == LocationState.PENDING_POSITION)
{
colorAttr = androidx.appcompat.R.attr.colorAccent;
colorAttr = com.google.android.material.R.attr.colorSecondary;
if (mode == LocationState.PENDING_POSITION)
sizeDimen = R.dimen.map_button_size;
else

View File

@@ -167,7 +167,7 @@ public class NavMenu
public void refreshTts()
{
mTts.setImageDrawable(TtsPlayer.isEnabled()
? Graphics.tint(mActivity, R.drawable.ic_voice_on, androidx.appcompat.R.attr.colorAccent)
? Graphics.tint(mActivity, R.drawable.ic_voice_on, com.google.android.material.R.attr.colorSecondary)
: Graphics.tint(mActivity, R.drawable.ic_voice_off));
}

View File

@@ -478,7 +478,7 @@ public class PlacePageView extends Fragment
final int editPlaceButtonColor =
Editor.nativeShouldEnableEditPlace()
? ContextCompat.getColor(getContext(),
UiUtils.getStyledResourceId(getContext(), androidx.appcompat.R.attr.colorAccent))
UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary))
: getResources().getColor(R.color.button_accent_text_disabled);
mTvEditPlace.setTextColor(editPlaceButtonColor);
mTvAddBusiness.setTextColor(editPlaceButtonColor);