The correct clock with the date in the status bar on the left on Android 6.0
big thanks our colleagues:
LINK.KZ ,
vadim-shavkunov ,
sergos77 : thank_you:
The continuation of these abusers -
The first ,
Second , Were prequels;), but we will not stir up the past
The purpose of mana - get roughly the clock display in the status bar, at the same time
right hide them in Loka
1. Adding the watch with a flashing point and the date on the left , Everything is similar to the previous mana, the only place the insert on both MM and added android: layout_weight = "1.0" to evenly distribute the space between statusbara clock, icons of notifications and system icons
SystemUI \ res \ layout \ status_bar.xml Looking string comprising
android: id = "@ id / notification_icon_area" and immediately above it paste this block
<LinearLayout android: orientation = "horizontal" android: id = "@ id / clock" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0" android: paddingStart = "0.0dip" android: paddingEnd = "2.0dip">
<LinearLayout android: gravity = "center" android: layout_gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginLeft = "0.0dip" android: layout_marginRight = "0.0dip" android: singleLine = "false" android: layout_alignParentStart = "true">
<LinearLayout android: gravity = "center" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 2.5dip" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "23.5dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: includeFontPadding = "false" android: format24Hour = "kk" />
<blink android: layout_gravity = "center | top" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "0.0dip">
<TextView android: textSize = "20.5dip" android: textstyle = "normal" android: textColor = "# ffffffff" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginBottom = "4.0dip" android: text = ":" android: includeFontPadding = "false" />
</ blink>
<TextClock android: textSize = "23.5dip" android: textColor = "# ffffffff" android: paddingRight = "5.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: includeFontPadding = "false" android: format24Hour = "mm" />
</ LinearLayout>
<RelativeLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginLeft = "- 1.0dip" android: layout_marginRight = "0.0dip" android: singleLine = "false" android: layout_alignParentLeft = "true">
<LinearLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 14.0dip" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: maxLines = "1" android: ellipsize = "marquee" android: includeFontPadding = "false" android: format24Hour = "EEEE" />
</ LinearLayout>
<LinearLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 3.0dip" android: singleLine = "false" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: includeFontPadding = "false" android: format24Hour = "d" />
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "2.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: includeFontPadding = "false" android: format24Hour = "MMMM" />
</ LinearLayout>
</ RelativeLayout>
</ LinearLayout>
</ LinearLayout>
and delete the row with the old clock
<com.android.systemui.statusbar.policy.Clock android: textAppearance = "@ style / TextAppearance.StatusBar.Clock" android: gravity = "start | center" android: id = "@ id / clock" android: layout_width = "wrap_content "android: layout_height =" fill_parent "android: singleLine =" true "android: paddingStart =" 4.0dip "/>
Here is the complete code to insert
<? xml version = "1.0" encoding = "utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android: orientation = "vertical" android: id = "@ id / status_bar" android: background = "@ drawable / system_bar_background" android: focusable = "false" android: descendantFocusability = " afterDescendants "
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: systemui = "http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android: id = "@ id / notification_lights_out" android: paddingBottom = "2.0dip" android: visibility = "gone" android: layout_width = "@ dimen / status_bar_icon_size" android: layout_height = "fill_parent" android: src = "@ drawable / ic_sysbar_lights_out_dot_small "android: scaleType =" center "android: paddingStart =" 6.0dip "/>
<LinearLayout android: orientation = "horizontal" android: id = "@ id / status_bar_contents" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: paddingStart = "6.0dip" android: paddingEnd = "8.0dip">
<LinearLayout android: orientation = "horizontal" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0">
<TextView android: textSize = "14.0dip" android: gravity = "center_vertical" android: id = "@ id / network_label" android: visibility = "gone" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: singleLine = "true" android: maxLength = "@ integer / config_operatorNameMaxLength" />
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android: orientation = "horizontal" android: id = "@ id / notification_icon_area" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android: id = "@ id / notification_icon_area_inner" android: layout_width = "fill_parent" android: layout_height = "fill_parent">
<com.android.keyguard.CarrierText android: textAppearance = "? android: textAppearanceSmall" android: textColor = "# ffffffff" android: ellipsize = "marquee" android: gravity = "center_vertical" android: id = "@ id / status_carrier_text" android : visibility = "gone" android: layout_width = "wrap_content" android: layout_height = "@ dimen / match_parent" android: singleLine = "true" android: layout_marginStart = "@ dimen / keyguard_carrier_text_margin" />
<com.android.systemui.statusbar.StatusBarIconView android: id = "@ id / moreIcon" android: visibility = "gone" android: layout_width = "@ dimen / status_bar_icon_size" android: layout_height = "fill_parent" android: src = "@ drawable / stat_notify_more "/>
<com.android.systemui.statusbar.phone.IconMerger android: gravity = "center_vertical" android: orientation = "horizontal" android: id = "@ id / notificationIcons" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android : layout_alignParentStart = "true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
</ LinearLayout>
<com.android.keyguard.AlphaOptimizedLinearLayout android: orientation = "horizontal" android: id = "@ id / system_icon_area" android: layout_width = "wrap_content" android: layout_height = "fill_parent">
<include layout = "@ layout / system_icons" />
<com.android.systemui.statusbar.policy.Clock android: textAppearance = "@ style / TextAppearance.StatusBar.Clock" android: gravity = "start | center" android: id = "@ id / clock" android: layout_width = "wrap_content "android: layout_height =" fill_parent "android: singleLine =" true "android: paddingStart =" 4.0dip "/>
</com.android.keyguard.AlphaOptimizedLinearLayout>
</ LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
and after insertion of the
<? xml version = "1.0" encoding = "utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android: orientation = "vertical" android: id = "@ id / status_bar" android: background = "@ drawable / system_bar_background" android: focusable = "false" android: descendantFocusability = " afterDescendants "
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: systemui = "http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android: id = "@ id / notification_lights_out" android: paddingBottom = "2.0dip" android: visibility = "gone" android: layout_width = "@ dimen / status_bar_icon_size" android: layout_height = "fill_parent" android: src = "@ drawable / ic_sysbar_lights_out_dot_small "android: scaleType =" center "android: paddingStart =" 6.0dip "/>
<LinearLayout android: orientation = "horizontal" android: id = "@ id / status_bar_contents" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: paddingStart = "2.0dip" android: paddingEnd = "2.0dip">
<LinearLayout android: orientation = "horizontal" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0">
<TextView android: textSize = "14.0dip" android: gravity = "center_vertical" android: id = "@ id / network_label" android: visibility = "gone" android: layout_width = "0.0dip" android: layout_height = "0.0dip" android : singleLine = "true" android: maxLength = "@ integer / config_operatorNameMaxLength" />
<LinearLayout android: orientation = "horizontal" android: id = "@ id / clock" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0" android: paddingStart = "0.0dip" android: paddingEnd = "2.0dip">
<LinearLayout android: gravity = "center" android: layout_gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginLeft = "0.0dip" android: layout_marginRight = "0.0dip" android: singleLine = "false" android: layout_alignParentStart = "true">
<LinearLayout android: gravity = "center" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 2.5dip" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "23.5dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: includeFontPadding = "false" android: format24Hour = "kk" />
<blink android: layout_gravity = "center | top" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "0.0dip">
<TextView android: textSize = "20.5dip" android: textstyle = "normal" android: textColor = "# ffffffff" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginBottom = "4.0dip" android: text = ":" android: includeFontPadding = "false" />
</ blink>
<TextClock android: textSize = "23.5dip" android: textColor = "# ffffffff" android: paddingRight = "5.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: includeFontPadding = "false" android: format24Hour = "mm" />
</ LinearLayout>
<RelativeLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginLeft = "- 1.0dip" android: layout_marginRight = "0.0dip" android: singleLine = "false" android: layout_alignParentLeft = "true">
<LinearLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 14.0dip" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: maxLines = "1" android: ellipsize = "marquee" android: includeFontPadding = "false" android: format24Hour = "EEEE" />
</ LinearLayout>
<LinearLayout android: gravity = "center | left" android: orientation = "horizontal" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "- 3.0dip" android: singleLine = "false" android: layout_alignParentLeft = "true">
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "0.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: includeFontPadding = "false" android: format24Hour = "d" />
<TextClock android: textSize = "12.0dip" android: textColor = "# ffffffff" android: paddingLeft = "2.0dip" android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: layout_marginTop = "8.0dip" android: includeFontPadding = "false" android: format24Hour = "MMMM" />
</ LinearLayout>
</ RelativeLayout>
</ LinearLayout>
</ LinearLayout>
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android: orientation = "horizontal" android: id = "@ id / notification_icon_area" android: layout_width = "0.0dip" android: layout_height = "fill_parent" android: layout_weight = "1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android: id = "@ id / notification_icon_area_inner" android: layout_width = "fill_parent" android: layout_height = "fill_parent">
<com.android.keyguard.CarrierText android: textAppearance = "? android: textAppearanceSmall" android: textColor = "# ffffffff" android: ellipsize = "marquee" android: gravity = "center_vertical" android: id = "@ id / status_carrier_text" android : visibility = "gone" android: layout_width = "wrap_content" android: layout_height = "@ dimen / match_parent" android: singleLine = "true" android: layout_marginStart = "@ dimen / keyguard_carrier_text_margin" />
<com.android.systemui.statusbar.StatusBarIconView android: id = "@ id / moreIcon" android: visibility = "gone" android: layout_width = "@ dimen / status_bar_icon_size" android: layout_height = "fill_parent" android: src = "@ drawable / stat_notify_more "/>
<com.android.systemui.statusbar.phone.IconMerger android: gravity = "center_vertical" android: orientation = "horizontal" android: id = "@ id / notificationIcons" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android : layout_alignParentStart = "true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
</ LinearLayout>
<com.android.keyguard.AlphaOptimizedLinearLayout android: orientation = "horizontal" android: id = "@ id / system_icon_area" android: layout_width = "wrap_content" android: layout_height = "fill_parent">
<include layout = "@ layout / system_icons" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</ LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
here I advise immediately reset dimensions in line with
android: id = "@ id / network_label" Because in this embodiment, the operator's name will look strange
2. Hide the clock on Loka Then we start shaman: D
as you can see in addition we have registered unit
android: id = "@ id / clock" to be able to competently cover our clock on Loka (remember the manna of our sk0t all), but it is necessary to take into account that the drain this identifier is rigidly connected with the TextView (he's been text at birth: yes2:), and we changed it orientation: girl_hospital: and transferred LinearLayout in class. Therefore, we need to continue to give it a new class in Smal, which go to
SystemUI_stock \ smali \ com \ android \ systemui \ statusbar \ phone \ StatusBarIconController.smali and set it to search for
mClock: Landroid / widget / TextView; (This field has shown us identifier)
and begin conversion of the field in the field
mClock: Landroid / widget / LinearLayout; , Ie simply replace one for the other, not forgetting to change and classes, such as
It was
check-cast v0, Landroid / widget /Textview ;
iput-object v0, p0, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->mClock: Landroid / widget /Textview ;
has become
check-cast v0, Landroid / widget /Linearlayout ;
iput-object v0, p0, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->mClock: Landroid / widget /Linearlayout ;
and in two cases have to completely remove the blocks because they prescribed color and size of text that does not privyazhesh to layotu, namely here the
iget-object v2, p0, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->mClock: Landroid / widget / TextView;
iget v3, p0, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->mIconTint: I
invoke-virtual {v2, v3}, Landroid / widget / TextView; ->setTextColor (I) V
and
iget-object v0, p0, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->mClock: Landroid / widget / TextView;
const v1, 0x7f09001a
invoke-static {v0, v1}, Lcom / android / systemui / FontSizeUtils; ->updateFontSize (Landroid / widget / TextView; I) V
All orientation we changed it now hide that is much simpler method podsmotren here:
The clock in the center (right display) for Android 6.0.1 in the same Smal looking
.method private animateHide (Landroid / view / View; Z) V and after him
invoke-virtual {p1, v0}, Landroid / view / View; ->setVisibility (I) V
we insert
const / 4 v0, 0x0
invoke-virtual {p0, v0}, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->setClockVisibility (Z) V
We seek further method
.method private animateShow (Landroid / view / View; Z) V and after him
invoke-virtual {p1, v0}, Landroid / view / View; ->setVisibility (I) V
we insert
const / 4 v0, 0x1
invoke-virtual {p0, v0}, Lcom / android / systemui / statusbar / phone / StatusBarIconController; ->setClockVisibility (Z) V
As you can see, we used the existing method setClockVisibility, why and changed the floor of our ID, although it was possible to add a method to your ID.
Just in Soviet times, we, ordinary engineers learned first to use the maximum available resources and then get into the "pocket of the Motherland" (in other words, to make candy from feces: rolleyes:), and it works with a bang.That's just my layoty and Smal BEFORE and AFTER
Added in Post has been editedoganyan-arthur - 13.11.16, 11:46