Replace actionBarPrimaryText with colorOnPrimary

pull/848/head
Alex Baker 5 years ago
parent 309377ee31
commit db66f9bce9

@ -219,7 +219,7 @@ public class CommentBarFragment extends TaskEditControlFragment {
private void resetPictureButton() {
TypedValue typedValue = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.actionBarPrimaryText, typedValue, true);
getActivity().getTheme().resolveAttribute(R.attr.colorOnPrimary, typedValue, true);
Drawable drawable =
DrawableCompat.wrap(
ContextCompat.getDrawable(getContext(), R.drawable.ic_outline_photo_camera_24px));

@ -68,7 +68,7 @@ public class ThemeCache {
i,
resolveAttribute(theme, R.attr.colorPrimary),
resolveAttribute(theme, R.attr.colorPrimaryVariant),
resolveAttribute(theme, R.attr.actionBarPrimaryText),
resolveAttribute(theme, R.attr.colorOnPrimary),
resolveBoolean(theme, R.attr.dark_status_bar)));
}
String[] accentNames = resources.getStringArray(R.array.accents);

@ -51,19 +51,18 @@ public class MenuColorizer {
public static void colorToolbar(Context context, Toolbar toolbar) {
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.actionBarPrimaryText, typedValue, true);
context.getTheme().resolveAttribute(R.attr.colorOnPrimary, typedValue, true);
colorToolbar(toolbar, typedValue.data);
}
public static void colorToolbar(Toolbar toolbar, int color) {
toolbar.setNavigationIcon(colorDrawable(toolbar.getNavigationIcon(), color));
toolbar.setTitleTextColor(color);
colorMenu(toolbar.getMenu(), color);
}
public static void colorMenu(Context context, Menu menu) {
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.actionBarPrimaryText, typedValue, true);
context.getTheme().resolveAttribute(R.attr.colorOnPrimary, typedValue, true);
colorMenu(menu, typedValue.data);
}

@ -42,7 +42,7 @@
android:nextFocusLeft="@id/commentField"
android:nextFocusUp="@id/commentField"
android:textAlignment="viewStart"
android:textColor="?attr/actionBarPrimaryText"
android:textColor="?attr/colorOnPrimary"
android:textColorHint="?attr/actionBarSecondaryText"
android:textCursorDrawable="@null"
android:textSize="16sp"/>
@ -56,7 +56,7 @@
android:layout_marginLeft="3dip"
android:scaleType="center"
android:src="@drawable/ic_outline_add_24px"
android:tint="?attr/actionBarPrimaryText"
android:tint="?attr/colorOnPrimary"
android:visibility="gone"/>
</LinearLayout>

@ -7,6 +7,7 @@
android:background="?attr/colorPrimary"
android:elevation="@dimen/elevation_toolbar"
android:theme="?attr/overlay_theme"
app:titleTextColor="?attr/colorOnPrimary"
app:popupTheme="@style/popup_overlay"
app:toolbarStyle="@style/Widget.MaterialComponents.Toolbar"
tools:ignore="UnusedAttribute"/>

@ -12,7 +12,6 @@
<attr format="color" name="asTextColorHint"/>
<attr format="color" name="icon_tint"/>
<attr format="reference" name="overlay_theme"/>
<attr format="color" name="actionBarPrimaryText"/>
<attr format="color" name="actionBarSecondaryText"/>
<attr format="boolean" name="dark_status_bar"/>
<attr format="dimension" name="alpha_secondary"/>

@ -31,14 +31,14 @@
<style name="WhiteToolbarTheme">
<item name="dark_status_bar">false</item>
<item name="overlay_theme">@style/WhiteToolbarOverlay</item>
<item name="actionBarPrimaryText">@color/white_100</item>
<item name="colorOnPrimary">@color/white_100</item>
<item name="actionBarSecondaryText">@color/white_70</item>
</style>
<style name="BlackToolbarTheme">
<item name="dark_status_bar">true</item>
<item name="overlay_theme">@style/BlackToolbarOverlay</item>
<item name="actionBarPrimaryText">@color/black_87</item>
<item name="colorOnPrimary">@color/black_87</item>
<item name="actionBarSecondaryText">@color/black_54</item>
</style>

Loading…
Cancel
Save