Quantcast
Channel: xda-developers - Android Themes
Viewing all articles
Browse latest Browse all 4090

[guide][tut]lp/cm12/12.1 custom header backgroound (omni header machine)

$
0
0
Hello friends this is my first thread

Okay let's start :D

REQUIREMENT:
- BRAIN.apk
- Patient.jar
- experience.zip
- Know how to decompile/recompiling Apk file
- Know how to decompile/recompiling jar Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else

STEP 1

- Decompile your SystemUI.apk
- Download Atached, Extract and merge to your Decompiled SystemUI.apk
- Open /res/layout/status_bar_expanded_header.xml
- Add the red line

Code:

http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res-auto">
        <ImageView android:layout_gravity="center" android:id="@+id/background_image" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="centerCrop" android:adjustViewBounds="true" />
    <com.android.systemui.statusbar.phone.MultiUserSwitch




SAVE
Decompile then Recompile again

STEP -2


- Open /res/values/public.xml and let standby here :D
- Open smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smali

Find thi line

# instance fields

Add the red line below

Code:

.field private mStatusBarHeaderMachine:Lcom/android/systemui/omni/StatusBarHeaderMachine;
SAVE

Find this method .method protected makeStatusBarView()V
In this method find this line
Code:

iput-object v2, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWeatherController:Lcom/android/systemui/statusbar/policy/WeatherControllerImpl;
And add the red line
LiKE this
Code:

iput-object v2, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWeatherController:Lcom/android/systemui/statusbar/policy/WeatherControllerImpl;
   
    .line 1249
    new-instance v2, Lcom/android/systemui/omni/StatusBarHeaderMachine;

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

    invoke-direct {v2, v3}, Lcom/android/systemui/omni/StatusBarHeaderMachine;-><init>(Landroid/content/Context;)V

    move-object/from16 v0, p0

    iput-object v2, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarHeaderMachine:Lcom/android/systemui/omni/StatusBarHeaderMachine;


    .line 1250
    :cond_1b
    new-instance

SAVE

NEXT


Find this line
Code:

invoke-virtual {v2}, Lcom/android/systemui/statusbar/policy/UserInfoController;->reloadUserInfo()V
And Add the red line below
Like this
Code:

invoke-virtual {v2}, Lcom/android/systemui/statusbar/policy/UserInfoController;->reloadUserInfo()V
   
    .line 1298
    move-object/from16 v0, p0

    iget-object v2, v0,Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarHeaderMachine:Lcom/android/systemui/omni/StatusBarHeaderMachine;

    invoke-virtual {v2}, Lcom/android/systemui/omni/StatusBarHeaderMachine;->updateEnablement()V


    .line 1299
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHeader:Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;



SAVE

STEP -3

- Open com/android/systemui/statusbar/phone/StatusBarHeaderView.smali
Find this line # interfaces
And add the red line
Like this

Code:

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Lcom/android/systemui/statusbar/policy/NextAlarmController$NextAlarmChangeCallback;
.implements Lcom/android/systemui/statusbar/policy/WeatherController$Callback;
.implements Lcom/android/systemui/omni/StatusBarHeaderMachine$IStatusBarHeaderMachineObserver;

SAVE

NEXT

Find this Line # instance fields
Add the ted linr
Like this

Code:

# instance fields
  .field private mBackgroundImage:Landroid/widget/ImageView;

    .field private mCollapsedHeight:I

  .field private mCurrentBackground:Landroid/graphics/drawable/Drawable;

    .field private mCurrentT:F

    .field private mExpanded:Z

    .field private mExpandedHeight:I

  .field private mLastHeight:F

NEXT

Find This method .method static synthetic access$900(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/widget/Switch;
Add the red line
Like this

Code:

.method static synthetic access$900(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/widget/Switch;
    .locals 1
    .param p0, "x0"    # Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;

    .prologue
    .line 70
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mQsDetailHeaderSwitch:Landroid/widget/Switch;

    return-object v0
.end method


.method static synthetic access$1000007(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;Z)V
    .locals 8

    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move-object v5, v0

    move-object v6, v1

    move v7, v2

    invoke-direct {v5, v6, v7}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->doUpdateStatusBarCustomHeader(Landroid/graphics/drawable/Drawable;Z)V

    return-void
.end method

.method static synthetic access$L1000005(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/widget/ImageView;
    .locals 4

    move-object v0, p0

    move-object v3, v0

    iget-object v3, v3, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    move-object v0, v3

    return-object v0
.end method

.method static synthetic access$L1000006(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)Landroid/graphics/drawable/Drawable;
    .locals 4

    move-object v0, p0

    move-object v3, v0

    iget-object v3, v3, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

    move-object v0, v3

    return-object v0
.end method

.method static synthetic access$S1000005(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/widget/ImageView;)V
    .locals 6

    move-object v0, p0

    move-object v1, p1

    move-object v4, v0

    move-object v5, v1

    iput-object v5, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    return-void
.end method

.method static synthetic access$S1000006(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;)V
    .locals 6

    move-object v0, p0

    move-object v1, p1

    move-object v4, v0

    move-object v5, v1

    iput-object v5, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

    return-void
.end method

.method private doUpdateStatusBarCustomHeader(Landroid/graphics/drawable/Drawable;Z)V
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/graphics/drawable/Drawable;",
            "Z)V"
        }
    .end annotation

    .prologue
    .line 32
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move-object v4, v1

    if-eqz v4, :cond_1

    .line 33
    move-object v4, v1

    move-object v5, v0

    iget-object v5, v5, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

    if-eq v4, v5, :cond_0

    .line 35
    move-object v4, v0

    iget-object v4, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    const/4 v5, 0x0

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 36
    move-object v4, v0

    move-object v5, v1

    move v6, v2

    invoke-direct {v4, v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setNotificationPanelHeaderBackground(Landroid/graphics/drawable/Drawable;Z)V

    .line 37
    move-object v4, v0

    move-object v5, v1

    iput-object v5, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

    .line 41
    :cond_0
    :goto_0
    return-void

    .line 40
    :cond_1
    move-object v4, v0

    const/4 v5, 0x0

    check-cast v5, Landroid/graphics/drawable/Drawable;

    iput-object v5, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentBackground:Landroid/graphics/drawable/Drawable;

    .line 41
    move-object v4, v0

    iget-object v4, v4, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    const/16 v5, 0x8

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    goto :goto_0
.end method

.method private setNotificationPanelHeaderBackground(Landroid/graphics/drawable/Drawable;Z)V
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/graphics/drawable/Drawable;",
            "Z)V"
        }
    .end annotation

    .prologue
    .line 98
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move-object v7, v0

    iget-object v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    invoke-virtual {v7}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v7

    if-eqz v7, :cond_0

    move v7, v2

    if-nez v7, :cond_0

    .line 99
    const/4 v7, 0x2

    new-array v7, v7, [Landroid/graphics/drawable/Drawable;

    move-object v4, v7

    .line 100
    move-object v7, v4

    const/4 v8, 0x0

    move-object v9, v0

    iget-object v9, v9, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    invoke-virtual {v9}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v9

    aput-object v9, v7, v8

    .line 101
    move-object v7, v4

    const/4 v8, 0x1

    move-object v9, v1

    aput-object v9, v7, v8

    .line 103
    new-instance v7, Landroid/graphics/drawable/TransitionDrawable;

    move-object v10, v7

    move-object v7, v10

    move-object v8, v10

    move-object v9, v4

    invoke-direct {v8, v9}, Landroid/graphics/drawable/TransitionDrawable;-><init>([Landroid/graphics/drawable/Drawable;)V

    move-object v5, v7

    .line 104
    move-object v7, v5

    const/4 v8, 0x1

    invoke-virtual {v7, v8}, Landroid/graphics/drawable/TransitionDrawable;->setCrossFadeEnabled(Z)V

    .line 105
    move-object v7, v0

    iget-object v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    move-object v8, v5

    invoke-virtual {v7, v8}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 106
    move-object v7, v5

    const/16 v8, 0x3e8

    invoke-virtual {v7, v8}, Landroid/graphics/drawable/TransitionDrawable;->startTransition(I)V

    .line 108
    :goto_0
    return-void

    :cond_0
    move-object v7, v0

    iget-object v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

    move-object v8, v1

    invoke-virtual {v7, v8}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0
.end method

NEXT

Finf this Line # virtual methods
And add the red line below

Code:

# virtual method
.method public disableHeader()V
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()V"
        }
    .end annotation

    .prologue
    .line 123
    move-object v0, p0

    move-object v2, v0

    new-instance v3, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000002;

    move-object v6, v3

    move-object v3, v6

    move-object v4, v6

    move-object v5, v0

    invoke-direct {v4, v5}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000002;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;)V

    invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

    move-result v2

    return-void
.end method

.method public updateHeader(Landroid/graphics/drawable/Drawable;Z)V
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/graphics/drawable/Drawable;",
            "Z)V"
        }
    .end annotation

    .prologue
    .line 114
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move-object v4, v0

    new-instance v5, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000001;

    move-object v10, v5

    move-object v5, v10

    move-object v6, v10

    move-object v7, v0

    move-object v8, v1

    move v9, v2

    invoke-direct {v6, v7, v8, v9}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000001;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;Landroid/graphics/drawable/Drawable;Z)V

    invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

    move-result v4

    return-void
.end method

NEXT

FIND this Method .method protected onFinishInflate()V

Find this line
Code:

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mDateExpanded:Landroid/widget/TextView;
And add the red line
Code:

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mDateExpanded:Landroid/widget/TextView;
 
  .line 31
    const v0, 0x7f0f016b </android:id="@id/background_image" >

    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mBackgroundImage:Landroid/widget/ImageView;

       
    .line 168
    const v0, 0x7f0f0114


NEXT

Find this method .method public setExpansion(F)V
Delete and replace with this method

Code:

.method public setExpansion(F)V
    .locals 12
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(F)V"
        }
    .end annotation

    .prologue
    .line 49
    move-object v0, p0

    move v1, p1

    move-object v6, v0

    iget-boolean v6, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpanded:Z

    if-nez v6, :cond_0

    .line 51
    const/4 v6, 0x0

    move v1, v6

    .line 53
    :cond_0
    move-object v6, v0

    move v7, v1

    iput v7, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCurrentT:F

    .line 54
    move-object v6, v0

    iget v6, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

    int-to-float v6, v6

    move v7, v1

    move-object v8, v0

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

    move-object v9, v0

    iget v9, v9, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

    sub-int/2addr v8, v9

    int-to-float v8, v8

    mul-float/2addr v7, v8

    add-float/2addr v6, v7

    move v3, v6

    .line 55
    move v6, v3

    move-object v7, v0

    iget v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mLastHeight:F

    cmpl-float v6, v6, v7

    if-eqz v6, :cond_3

    .line 56
    move v6, v3

    move-object v7, v0

    iget v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

    int-to-float v7, v7

    cmpg-float v6, v6, v7

    if-gez v6, :cond_1

    .line 57
    move-object v6, v0

    iget v6, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mCollapsedHeight:I

    int-to-float v6, v6

    move v3, v6

    .line 59
    :cond_1
    move v6, v3

    move-object v7, v0

    iget v7, v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpandedHeight:I

    int-to-float v7, v7

    cmpl-float v6, v6, v7

    if-lez v6, :cond_2

    .line 60
    move-object v6, v0

    iget v6, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpandedHeight:I

    int-to-float v6, v6

    move v3, v6

    .line 62
    :cond_2
    move v6, v3

    move v4, v6

    .line 63
    move-object v6, v0

    move v7, v4

    invoke-direct {v6, v7}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setClipping(F)V

    .line 65
    move-object v6, v0

    new-instance v7, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000000;

    move-object v11, v7

    move-object v7, v11

    move-object v8, v11

    move-object v9, v0

    move v10, v4

    invoke-direct {v8, v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView$100000000;-><init>(Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;F)V

    invoke-virtual {v6, v7}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->post(Ljava/lang/Runnable;)Z

    move-result v6

    .line 73
    move-object v6, v0

    move v7, v1

    invoke-direct {v6, v7}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->updateLayoutValues(F)V

    .line 74
    move-object v6, v0

    move v7, v4

    iput v7, v6, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mLastHeight:F

    :cond_3
    return-void
.end method



[B]SAVE And DONE[/B

STEP -4



OPEN com/android/systemui/omni/DaylightHeaderProvider.smali

Replace all id below with id public.xml of your SystemUI

Code:

    0x7f020004 <public type="drawable" name="notifhead_afternoon" id="0x7×××××" />
    0x7f020005  <public type="drawable" name="notifhead_christmas" id="0x7×××××" />
    0x7f020006 <public type="drawable" name="notifhead_evening" id="0x7×××××" />
    0x7f020007 <public type="drawable" name="notifhead_hbd" id="0x7×××××" />
    0x7f020008 <public type="drawable" name="notifhead_lebaran" id="0x7×××××" />
    0x7f020009 <public type="drawable" name="notifhead_morning" id="0x7×××××" />
    0x7f02000a <public type="drawable" name="notifhead_newyearseve" id="0x7×××××" />
    0x7f02000b <public type="drawable" name="notifhead_night" id="0x7×××××" />
    0x7f02000c <public type="drawable" name="notifhead_noon" id="0x7×××××" />
    0x7f02000d <public type="drawable" name="notifhead_sore" id="0x7×××××" />
    0x7f02000e <public type="drawable" name="notifhead_sunrise" id="0x7×××××" />
    0x7f02000f <public type="drawable" name="notifhead_sunset" id="0x7×××××" />
    0x7f020011 <public type="drawable" name="notification_panel_bg" id="0x7×××××" />


SAVE AND DONE
RECOMPILE
SIGN
PUSH




#CREDITS

KIDO1611 a.k.a Abdusy-sensei for basic training java
Omni Rom project for awesome source java
CyanogenMod ROM for first testing ROM :D
github
Aide
MAAaD Reborn "Mediatek Android Art and Dev - Reborn"

Attached Thumbnails
Click image for larger version

Name:	Screenshot_2016-04-11-16-45-26.png
Views:	N/A
Size:	153.6 KB
ID:	3656356   Click image for larger version

Name:	Screenshot_2016-02-23-09-31-17.png
Views:	N/A
Size:	235.7 KB
ID:	3656357  
Attached Files
File Type: zip [OHM]LP-CM12.1SystemUI.zip - [Click for QR Code] (589.7 KB)
File Type: apk OHM.apk - [Click for QR Code] (55.7 KB)

Viewing all articles
Browse latest Browse all 4090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>