mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-27 16:33:38 +00:00
[android] Use material properties in styles and themes
Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
2492e8bda4
commit
826ddba26f
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user