From my MiuiSystemUI.apk you need to pick up the necessary smiles for yourself:
Compile class. Dex
Now edit the markup: files
/res/layout/system_icons.xml system_icons_aosp.xml system_icons_ios.xml system_icons_miuipro.xml
In these files we find (at the very bottom) View:
<com.android.systemui.BatteryMeterView
android: id = "@ id / battery"
android: focusable = "true"
android: focusableInTouchMode = "true"
android: layout_width = "wrap_content"
android: layout_height = "match_parent" />
Select it completely and change it to:
<com.android.systemui.BatteryMeterView
android: id = "@ id / battery"
android: focusable = "true"
android: focusableInTouchMode = "true"
android: visibility = "gone"
android: layout_width = "wrap_content"
android: layout_height = "match_parent" />
<main.kampf.gitler.kaput.BatteryText
android: layout_width = "wrap_content"
android: layout_height = "wrap_content" />
With this, we turned off the stock battery, and prescribed a text one.
Next, we take out the folder from my Miisystem.apk folder
assets And add it to your apk. You can immediately put your own fonts.
MiuiSystemUI.apk is ready.
Now the settings.
In Settings.apk you need to add some resources.
In / res / layout add msim_list_preference_layout.xml
Its content is:
<? xml version = "1.0" encoding = "utf-8"?>
<LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
android: gravity = "center_vertical"
android: layout_gravity = "center_vertical"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
<Linearlayout
android: layout_gravity = "center_vertical"
android: orientation = "horizontal"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
<Linearlayout
android: layout_width = "0dp"
android: layout_height = "wrap_content"
android: layout_weight = "1">
<Textview
android: textAppearance = "<0x100D0057, type 0x07>"
android: ellipsize = "end"
android: layout_gravity = "center | start"
android: id = "@ android: id / title"
android: fadingEdge = "horizontal"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: singleLine = "true" />
</ LinearLayout>
<ImageView
android: gravity = "center"
android: layout_gravity = "center_vertical"
android: id = "@ android: id / icon"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: scaleType = "fitCenter"
android: adjustViewBounds = "true"
android: maxHeight = "47dp"
android: minWidth = "48dp"
android: paddingEnd = "<0x100A000C, type 0x07>" />
<Textview
android: textAppearance = "<0x100D0072, type 0x07>"
android: ellipsize = "end"
android: layout_gravity = "center_vertical"
android: id = "@ android: id / summary"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: singleLine = "true"
android: maxLength = "30" />
<ImageView
android: gravity = "center"
android: layout_gravity = "center | right"
android: id = "@ + id / arrow_right"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: src = "<0x10020068, type 0x07>"
android: layout_marginStart = "<0x100A000C, type 0x07>" />
</ LinearLayout>
</ LinearLayout>
In the lowest View, check the idea - if it is not in the apk, then add. At 8.10.25 I did not have it, at 8.11.1 was. Compile.
Now in /res/values/strings.xml add the line:
Now the most hemorrhoid. It is necessary to add in /res/values/arrays.xml a list of all fonts from the Miui system.ap folder
assets Who makes an apctul - copy from me. Mt. hand-to-hand manager:
We added resources, assigned the idea to everything, we add the settings themselves.
/res/xml/status_bar_settings.xml
Are looking for:
<ListPreference
android: persistent = "false"
android: entries = "@ array / battery_indicator_style_entries"
android: title = "@ string / battery_indicator_style"
android: key = "battery_indicator"
android: entryValues ​​= "@ array / battery_indicator_style_values" />
We add after it:
<MiuiListPreference
intent = "my.settings.RESTART_UI"
android: entries = "@ array / battery_font"
android: layout = "@ layout / msim_list_preference_layout"
android: title = "Battery Font"
android: key = "battery_font"
android: summary = "% s"
android: defaultValue = "font / Mitype2018-battery.otf"
android: entryValues ​​= "@ array / battery_font" />
<MiuiColorPickerPreference
intent = "my.settings.RESTART_UI"
android: title = "Battery color"
android: key = "color_battery"
android: defaultValue = "0xFFFFFFFF" />
<MiuiColorPickerPreference
intent = "my.settings.SETPIC"
android: title = "Low battery color"
android: key = "color_battery_low"
android: defaultValue = "0xFFFF0F00" />
<MiuiColorPickerPreference
intent = "my.settings.RESTART_UI"
android: title = "Color of the charging battery"
android: key = "color_battery_charging"
android: defaultValue = "0xFFFFB318" />
<MiuiSeekBarPreference
min = "12"
max = "18"
step = "1"
intent = "my.settings.RESTART_UI"
android: layout = "@ layout / preference_ringtone_arrow"
android: title = "Battery font size"
android: key = "battery_text_size"
android: summary = "@ string / battery_text_size"
android: defaultValue = "15" />
We collect.
Seem it all: yes2: