Android 10.0 SystemUI pull-down status bar time format modification (2)

The time display format has been modified through the previous blog, but the customer modified the time display format of the drop-down status bar to be displayed in separate lines, that is, the first line displays the time in large fonts
and the second line displays the current date and day of the week in small fonts. The display format then continues to be modified

The time display control is DateView.java to display the time.
The specific path is:
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java

The same string can be displayed in different colors and styles using SpannableString's related api.

    SpannableString ss = new SpannableString(text);
    //设置显示字体大小

    AbsoluteSizeSpan ass = new AbsoluteSizeSpan(20,true);
   //从哪个文字开始设置字体大小

    ss.setSpan(ass, 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);</

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/123246834