CyanogenMod is based on open-source Android system for certain secondary market firmware phone use. It provides a number of features in the official Android system or mobile phone manufacturers do not provide. But for CM11 who wish to try DIY, be your favorite ROM. If you need to see the speed in which the statistics of this feature, take a look at this tutorial.

First, decompile systemUI.apk,
Copy the file to decompile smali directory: smali / COM / Android / systemui / StatusBar / policy /

** // for refresh interval, open Traffic.smali, search
const-wide / 16 v2, 0xbb8
Copy the code

Note: 0xbb8 compared hexadecimal number of milliseconds, the default is 3000 that 3s, you can change the refresh rate you think is reasonable, remember to convert back to hexadecimal

open res / layout / statusbar.xml file, we put speed display code :
<Com.android.systemui.statusbar.policy.Traffic android: textAppearance = "@ style / TextAppearance.StatusBar.Traffic" android: gravity = "left | center" android: id = "@ id / traffic" android: layout_width = " wrap_content "android: layout_height =" fill_parent "android: singleLine =" true "/>
Copy the code

Into the system icons region following code above the front :()
<LinearLayout android: gravity = "center_vertical" android: orientation = "horizontal" android: id = "@ id / statusIcons" android: layout_width = "wrap_content" android: layout_height = "fill_parent" />
Copy the code

Next, open the res / values ​​/ ids.xml, added:
<Item type = "id" name = "traffic"> false </ item>
Copy the code

Then open the res / values ​​/ styles.xml, at <resources> After adding the following definition:
<Style name = "TextAppearance.StatusBar.Traffic" parent = "@ style / TextAppearance.StatusBar.Clock">
        <Item name = "android: textSize"> 16.0dip </ item>
        <Item name = "android: textStyle"> normal </ item>
        <Item name = "android: textAllCaps"> false </ item>
    </ Style>
Copy the code

Replace the original apk in the res / layout / statusbar.xml, resources.arsc, classes.dex

Post a Comment

أحدث أقدم