[Asus Zenfone 4] bamzzz:
Hi all, this time I want to provide a "Header Machine Guide", this guide for change the background of Expanded Header.. Hopefully it works for all ..

This guide is based on the Asus Zenfone 4S (T00Q) Lollipop firmware.

Feature:

Header BG with option (Default, Color, BG Picker, Timer/Omni)

Header BG Timer/Omni style (Default, Modern, Poly)

Header BG alpha

Header BG animation

Enable/disable blur BG

Add options to set date for Idul Fitri, Idul Adha and birthday

Add Blur BG preview

Requirement:

- Understanding about APK compile/decompile

- APKTool

- Notepad++ (PC)

Step:

Part AsusSystemUI:

1. Decompile AsusSystemUI.apk

2. Copy smali and res folder from guide to your systemui.. Overwrite if exist..

3. Open AndroidManifest.xml

Find:

<activity android:excludeFromRecents="true" android:name="com.android.keyguard.KeyguardIntruderView" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>

Add this just below:

<activity android:theme="@android:style/Theme.Holo" android:label="Header Machine Preference" android:icon="@null" android:name="com.bamzzz.prefs.HeaderMachineActivity" android:excludeFromRecents="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

4. Open res/layout/asus_status_bar_expanded_header.xml (Asus) or status_bar_expanded_header.xml (Other phone)

Find:

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.StatusBarHeaderView android:layout_gravity="@integer/notification_panel_layout_gravity" android:id="@id/header" android:background="@null" android:paddingBottom="@dimen/asus_quicksetting_panel_header_padding_bottom" android:focusable="true" android:clickable="true" android:layout_width="@dimen/notification_panel_width" android:layout_height="@dimen/asus_status_bar_header_height" android:baselineAligned="false" android:paddingStart="@dimen/notification_side_padding" android:paddingEnd="@dimen/notification_side_padding"
xmlns:android="http://schemas.android.com/apk/res/android">

Add this just below:

<com.bamzzz.HeaderMachine android:id="@id/header_machine"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:scaleType="fitXY"
android:adjustViewBounds="true" />

For Asus Zenfone only:

Find:

<Button android:textSize="@dimen/asus_notification_clear_all_text_size" android:textColor="@color/asus_notification_clear_all_text_color" android:id="@id/clear_all_button" android:background="@drawable/ic_notify_clear" android:layout_width="wrap_content" android:layout_height="@dimen/asus_notification_clear_all_height" android:text="@string/status_bar_clear_all_button" android:layout_alignParentBottom="true" android:contentDescription="@string/accessibility_clear_all" android:fontFamily="sans-serif" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true" />

Add this after "<Button "

android:layout_marginBottom="@dimen/asus_quicksetting_panel_header_padding_bottom"

Looks like this:

<Button [COLOR="Blue"]android:layout_marginBottom="@dimen/asus_quicksetting_panel_header_padding_bottom"[/COLOR] android:textSize="@dimen/asus_notification_clear_all_text_size" android:textColor="@color/asus_notification_clear_all_text_color" android:id="@id/clear_all_button" android:background="@drawable/ic_notify_clear" android:layout_width="wrap_content" android:layout_height="@dimen/asus_notification_clear_all_height" android:text="@string/status_bar_clear_all_button" android:layout_alignParentBottom="true" android:contentDescription="@string/accessibility_clear_all" android:fontFamily="sans-serif" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true" />

5. Open res/values/ids.xml and add this:

<item type="id" name="header_machine">false</item>
<item type="id" name="header_machine_layout">false</item>
<item type="id" name="header_machine_time_title">false</item>
<item type="id" name="header_machine_idul_fitri_text">false</item>
<item type="id" name="header_machine_idul_fitri_button">false</item>
<item type="id" name="header_machine_idul_adha_text">false</item>
<item type="id" name="header_machine_idul_adha_button">false</item>
<item type="id" name="header_machine_birthday_text">false</item>
<item type="id" name="header_machine_birthday_button">false</item>
<item type="id" name="header_machine_background_title">false</item>
<item type="id" name="header_machine_background_content">false</item>
<item type="id" name="header_machine_checkBlur">false</item>
<item type="id" name="header_machine_background_button_pick">false</item>
<item type="id" name="header_machine_background_button_set">false</item>
<item type="id" name="header_machine_tip_text">false</item>

6. This step should not be applied !!! Especially for Asus Zenfone, is used to remove the default background or default theme:

Open /smali/com/android/systemui/statusbar/phone/StatusBarHeaderView.smali

Find:

# instance fields

Add this just below:

.field private mHeaderMachine:I

Find:

.method private setImageViewDrawable()V

Then find:

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackground(Landroid/graphics/drawable/Drawable;)V

Add this just above:

iget v8, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

const/4 v9, 0x0

if-ne v8, v9, :cond_brut

const-string v8, "BamzzzHeaderMachine"

new-instance v9, Ljava/lang/StringBuilder;

invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

const-string v10, "Header Machine disable -> "

invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v9

iget v10, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v9

invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v9

invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

Find again:

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackground(Landroid/graphics/drawable/Drawable;)V

Add this just below:

goto :goto_brutt

:cond_brut
const-string v8, "BamzzzHeaderMachine"

new-instance v9, Ljava/lang/StringBuilder;

invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

const-string v10, "Header Machine enable -> "

invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v9

iget v10, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v9

invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v9

invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

const/4 v8, 0x0

invoke-virtual {p0, v8}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackgroundResource(I)V

:goto_brutt

Find:

.line 199
.local v8, "paddingBottom":I
const/4 v12, 0x0

invoke-virtual {p0, v7, v12, v7, v8}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setPaddingRelative(IIII)V

.line 200
return-void

Above it add:

const/4 v8, 0x0

Find:

.method public updateEverything()V

Above return void add:

invoke-static {}, Lcom/bamzzz/HeaderMachine;->getVisibilities()I

move-result v0

iput v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setImageViewDrawable()V

7. Recompile SystemUI, then push and reboot phone.

8. Done

Part Settings:

Goto post 2

Attention: Don't rename or modify path of smali from this guide without my permissions !!!

Header Machine demo video: https://youtu.be/TaFGTlTdrMI

Created by bamzzz@xda

fb.me/bamz4ever

http://xdaforums.com/member.php?u=4672359

ZenControl by Wuby986@xda & daxgirl@xda

http://xdaforums.com/android/apps-games/app-rom-control-app-devs-t3146567

Idea from StatusBar Header Machine and some drawables and some methods from OmniROM Project

Thanks to SyahrulLail for idea of Date picker preference