[Xiaomi Mi 8 SE Themes, Apps, and Mods] Trần Anh VN:
[IMG="Cover"]http://miui.vn/forum/attachments/img_20181005_164139-jpg.66083/[/IMG]​

Hello everybody!

Just wanted to write a guide to mod SystemUI for notch device cause I want to show both notification icon and clock. This mod is temporary because I believe that MIUI Team will fix this in next version

Big update: This mod is officially supported by mi-globe.com and made for all version of MIUI. Big thanks to mi-globe.com and [MENTION=8584732]zapperbyte[/MENTION].

[IMG="default_no-notifications"]https://mi-globe.com/wp-content/uploads/2018/10/notch_notification_mod_default-768x287.png[/IMG]

[IMG="mi-globe.com Notch Notification Mod"]https://mi-globe.com/wp-content/uploads/2018/10/notch_notification_mod_modded-768x287.png[/IMG]

See more here:

https://mi-globe.com/miui-notification-icons-for-notch-phones/[/QUOTE]

Ok let start

Things needed:

1.Basic knowledge how to compile/decompile using Apktool/Apk Studio... whatever you prefered

3.Brain and pation :D

Thanks to [MENTION=6380165]sacca25[/MENTION] for letting me know about mi-globe forum. Thanks mi-globe forum for awesome center-clock mod

Steps:

First, backup your original MiuiSystemUI.apk

1. Decompile center clock MiuiSystemUI

2. Edit status_bar layout

3. Edit status_bar smali code

4. Edit dimension for smaller clock

5. Recompile MiuiSystemUI. Done!

Dont forget to run "adb shell settings put system status_bar_show_notification_icon 1" from CMD

Edit smali code. Be careful

Note: Code can be different base on MIUI release version and devices. Find exactly code to remove. Just look at method name to find

1. Edit SystemUI\smali\com\android\systemui\statusbar\phone\CollapsedStatusBarFragment.smali

Find this code and remove RED line

.method public hideNotificationIconArea(Z)V
.locals 1

[COLOR="Red"] sget-boolean v0, Lcom/android/systemui/Constants;->IS_NOTCH:Z

if-nez v0, :cond_0[/COLOR]

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->animateHide(Landroid/view/View;Z)V

[COLOR="red"] :cond_0[/COLOR]
return-void
.end method

Next find this code and remove RED line too

.method public initNotificationIconArea(Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;)V
.locals 3

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mStatusBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

const v2, 0x7f0a01d1

invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/view/ViewGroup;

invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;->getNotificationInnerAreaView()Landroid/view/View;

move-result-object v1

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

iput-object p1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaController:Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

move-result-object v1

if-eqz v1, :cond_0

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

move-result-object v1

check-cast v1, Landroid/view/ViewGroup;

iget-object v2, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-virtual {v1, v2}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

:cond_0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

const/4 v1, 0x0

invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->showNotificationIconArea(Z)V

[COLOR="Red"] sget-boolean v1, Lcom/android/systemui/Constants;->IS_NOTCH:Z

if-nez v1, :cond_1[/COLOR]

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mStatusBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

const v2, 0x7f0a01a9

invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Lcom/android/systemui/statusbar/StatusBarIconView;

invoke-virtual {p1, v1}, Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;->setMoreIcon(Lcom/android/systemui/statusbar/StatusBarIconView;)V

[COLOR="red"] :cond_1[/COLOR]
return-void
.end method

Finally for this file, found this code and remove RED line

.method public showNotificationIconArea(Z)V
.locals 1

[COLOR="Red"] sget-boolean v0, Lcom/android/systemui/Constants;->IS_NOTCH:Z

if-nez v0, :cond_0[/COLOR]

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->mNotificationIconAreaInner:Landroid/view/View;

invoke-direct {p0, v0, p1}, Lcom/android/systemui/statusbar/phone/CollapsedStatusBarFragment;->animateShow(Landroid/view/View;Z)V

[COLOR="red"] :cond_0[/COLOR]
return-void
.end method

2. Edit SystemUI\smali\com\android\systemui\statusbar\phone\StatusBar.smali

Find this code and remove RED line

.method private updateNotificationIconsLayout()V
.locals 5

iget v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mState:I

const/4 v4, 0x1

if-ne v3, v4, :cond_1

const/4 v1, 0x1

:goto_0
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mMiuiStatusBarPrompt:Lcom/android/systemui/miui/statusbar/phone/MiuiStatusBarPromptController;

const/4 v4, 0x2

invoke-virtual {v3, v4}, Lcom/android/systemui/miui/statusbar/phone/MiuiStatusBarPromptController;->isShowingState(I)Z

move-result v0

[COLOR="Red"] sget-boolean v3, Lcom/android/systemui/Constants;->IS_NOTCH:Z

if-nez v3, :cond_2[/COLOR]

iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mShowNotifications:Z

if-eqz v3, :cond_2

if-eqz v0, :cond_0

if-eqz v1, :cond_2

:cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mDemoMode:Z

xor-int/lit8 v2, v3, 0x1

:goto_1
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mNotifications:Landroid/view/View;

if-eqz v2, :cond_3

const/4 v3, 0x0

:goto_2
invoke-virtual {v4, v3}, Landroid/view/View;->setVisibility(I)V

return-void

:cond_1
const/4 v1, 0x0

goto :goto_0

:cond_2
const/4 v2, 0x0

goto :goto_1

:cond_3
const/4 v3, 0x4

goto :goto_2
.end method

Done. Now you have notification icon show on status bar, but it covered by the notch. Next, we going to edit layout file to show notification icon

Edit status bar layout

Just need to replace status_bar.xml attach below to exist one in res/layout folder

For one who have knowledge about editting xml layout file, you can edit layout file to what you prefered.

Edit dimension (Optional)

Edit dimension for smaller clock size and smaller notification icon size

Open res/values/dimens.xml and find code to edit

For clock size. Mine is 9.0sp:

<dimen name="status_bar_clock_size">11.5sp</dimen>

For clock padding. Mine is 2.0dp

<dimen name="status_bar_clock_end_padding">3.0dip</dimen>

<dimen name="status_bar_clock_starting_padding">3.0dip</dimen>

For notification icon size. Mine is 10dp:

<dimen name="status_bar_icon_size">13.0dip</dimen>

You can edit another dimensions like status_bar_notification_icon_padding for notification icon padding, status_bar_padding_start for statusbar padding...

Recompile APK and use it. Again, dont forget to run "adb shell settings put system status_bar_show_notification_icon 1" from CMD

Problem fixing:

1. For one who facing problem with pip_dismiss_scrim.9.png when recompiling, download attachment below, unzip it and override exist one

2. Statusbar missing after reboot:

- Open both original MiuiSystemUI.apk and recompiled MiuiSystemUI.apk in winrar.

- Replace classes.dex from new apk to original one

- Replace status_bar.xml from new apk to original one

- Replace resources.arsc from new apk to original only if you modify dimens

- Use the original with replaced files

Thanks for reading. Any idea/comments would be appriciated :D

Bonus: Here my mod for Mi8 SE using 8.9.20 ROM. Backup and flash via twrp:

https://drive.google.com/file/d/1Huq9zcHtOHs9bQL80U8ikqaW-fLCEEXC/view