Migrate materialColor* attributes into colors
TLDR: * This change should not break anything or change any color. * Simplifies theming and styling while improving developer experience. * With this developers can often skip styling for color entirely, while ensuring consistency and preventing accidental overrides. Bug: 374273611 Test: presubmit Flag: EXEMPT bugfix Change-Id: Id19038078e83c73847b1a7c686c3a3df1ecccac2
This commit is contained in:
@@ -315,8 +315,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
0,
|
||||
0 // Bottom left
|
||||
};
|
||||
mBottomSheetBackgroundColor =
|
||||
Themes.getAttrColor(getContext(), R.attr.materialColorSurfaceDim);
|
||||
mBottomSheetBackgroundColor = getContext().getColor(R.color.materialColorSurfaceDim);
|
||||
updateBackgroundVisibility(mActivityContext.getDeviceProfile());
|
||||
mSearchUiManager.initializeSearch(this);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.Themes;
|
||||
|
||||
/**
|
||||
* A TextView that is used to display the letter list in the fast scroller.
|
||||
@@ -56,7 +55,7 @@ public class LetterListTextView extends TextView {
|
||||
mLetterBackground = context.getDrawable(R.drawable.bg_letter_list_text);
|
||||
mLetterListTextWidthAndHeight = context.getResources().getDimensionPixelSize(
|
||||
R.dimen.fastscroll_list_letter_size);
|
||||
mTextColor = Themes.getAttrColor(context, R.attr.materialColorOnSurface);
|
||||
mTextColor = context.getColor(R.color.materialColorOnSurface);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,6 @@ import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Themes;
|
||||
|
||||
public class SectionDecorationHandler {
|
||||
|
||||
@@ -60,10 +59,8 @@ public class SectionDecorationHandler {
|
||||
|
||||
mContext = context;
|
||||
mFillAlpha = fillAlpha;
|
||||
mFocusColor = Themes.getAttrColor(context,
|
||||
R.attr.materialColorSurfaceBright); // UX recommended
|
||||
mFillColor = Themes.getAttrColor(context,
|
||||
R.attr.materialColorSurfaceContainerHigh); // UX recommended
|
||||
mFocusColor = context.getColor(R.color.materialColorSurfaceBright); // UX recommended
|
||||
mFillColor = context.getColor(R.color.materialColorSurfaceContainerHigh); // UX recommended
|
||||
|
||||
mIsTopLeftRound = isTopLeftRound;
|
||||
mIsTopRightRound = isTopRightRound;
|
||||
|
||||
@@ -138,7 +138,7 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
|
||||
|
||||
// Initialize arrow view
|
||||
final Resources resources = getResources();
|
||||
mArrowColor = Themes.getAttrColor(getContext(), R.attr.materialColorSurfaceContainer);
|
||||
mArrowColor = getContext().getColor(R.color.materialColorSurfaceContainer);
|
||||
mChildContainerMargin = resources.getDimensionPixelSize(R.dimen.popup_margin);
|
||||
mArrowWidth = resources.getDimensionPixelSize(R.dimen.popup_arrow_width);
|
||||
mArrowHeight = resources.getDimensionPixelSize(R.dimen.popup_arrow_height);
|
||||
@@ -170,8 +170,7 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
|
||||
getContext().getColor(R.color.popup_shade_third)
|
||||
};
|
||||
} else {
|
||||
mColors = new int[]{Themes.getAttrColor(getContext(),
|
||||
R.attr.materialColorSurfaceContainer)};
|
||||
mColors = new int[]{getContext().getColor(R.color.materialColorSurfaceContainer)};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ public class RecyclerViewFastScroller extends View {
|
||||
mTrackPaint.setAlpha(MAX_TRACK_ALPHA);
|
||||
|
||||
mThumbColor = Themes.getColorAccent(context);
|
||||
mThumbLetterScrollerColor = Themes.getAttrColor(context, R.attr.materialColorSurfaceBright);
|
||||
mThumbLetterScrollerColor = context.getColor(R.color.materialColorSurfaceBright);
|
||||
mThumbPaint = new Paint();
|
||||
mThumbPaint.setAntiAlias(true);
|
||||
mThumbPaint.setColor(mThumbColor);
|
||||
|
||||
Reference in New Issue
Block a user