以下内容主要是做笔记为主
修改前:
修改后:
1、修改圆角:
frameworks\base\packages\SystemUI\res\values\dimens.xml 文件中notification_material_rounded_rect_radius改为16dp(可以自定)
<!-- radius of the corners of the material rounded rect background -->
<dimen name="notification_material_rounded_rect_radius">16dp</dimen>
修改完后,接着修改长按显示的背景圆角:
frameworks\base\packages\SystemUI\res\drawable\notification_guts_bg.xml 文件,android:radius值改为notification_material_rounded_rect_radius
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/notification_guts_bg_color" />
<!--The radius is 1dp smaller than the notification one, to avoid aliasing bugs on the corners -->
<corners android:radius="@dimen/notification_material_rounded_rect_radius" />
</shape>
四角还有灰色背景。
2、修改通知四周灰色背景圆角:
修改frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\ExpandableOutlineView.java 文件,outline增加radius
public ExpandableOutlineView(Context context, AttributeSet attrs) {
...
setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
if (!mCustomOutline) {
// modify start {
/*outline.setRect(0,
mClipTopAmount,
getWidth(),
Math.max(getActualHeight(), mClipTopAmount));*/
outline.setRoundRect(0,
mClipTopAmount,
getWidth(),
Math.max(getActualHeight(), mClipTopAmount),
mRoundedRectCornerRadius);
// modify end }
} else {
outline.setRoundRect(mOutlineRect, mRoundedRectCornerRadius);
}
outline.setAlpha(mOutlineAlpha);
}
});
}