mardi 24 mai 2016

[Guide][tut] [Enable/Disable] Navigation bar Tint ( depends on app material )

Hello guys here i am presenting you new guide

a small mod from my Krypton rom

this is for both MM and LP

For MM look for post#2

So i will discuss from LP
First you need
android.policy.jar (deodexed)
settings.apk (deodexed)

1. Decompile android.policy.jar
2. open com/android/internal/policy/impl/PhoneWindow.smali

find this method

Code:

.method private getOptionsPanelGravity()I
before that add these methods

Code:

.method private getNavBarColorMod(I)I
    .locals 4

    const/high16 v2, -0x1000000

    move/from16 v1, p1

    iget v3, p0, Lcom/android/internal/policy/impl/PhoneWindow;->mStatusBarColor:I

    invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z

    move-result v0

    if-eqz v0, :cond_0

    or-int v1, v2, v3

    :cond_0
    return v1
.end method

.method private getNavBarTweak()Z
    .locals 3

    const/4 v0, -0x1

    invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "navbar_color_mod"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    if-nez v1, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

3. now from this method
Code:

.method protected generateLayout(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Landroid/view/ViewGroup;
look for this code
Code:

        invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z

    move-result v25

    if-eqz v25, :cond_1a

    .line 3479
    if-nez v22, :cond_1a

    const/16 v25, 0x22

    const/16 v26, 0x0

    move/from16 v0, v25

    move/from16 v1, v26

    invoke-virtual {v4, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v25

        if-eqz v25, :cond_1a

Note this :cond_1a (1a may vary with device may not be same )

in that before
Code:

if-eqz v25, :cond_1a
add this code
Code:

    invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z

    move-result v0

    if-nez v0, :cond_ta

after the same line of
Code:

if-eqz v25, :cond_1a
add this
Code:

:cond_ta
Finally it look like this

Code:

        invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z

    move-result v25

    if-eqz v25, :cond_1a

    .line 3479
    if-nez v22, :cond_1a

    const/16 v25, 0x22

    const/16 v26, 0x0

    move/from16 v0, v25

    move/from16 v1, v26

    invoke-virtual {v4, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v25

    invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarTweak()Z

    move-result v0

    if-nez v0, :cond_ta

       
    if-eqz v25, :cond_1a
       
        :cond_ta

4. Now look for this line in same method
Code:

iput v0, v1, Lcom/android/internal/policy/impl/PhoneWindow;->mNavigationBarColor:I
Before that add this code
Code:

    invoke-direct {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindow;->getNavBarColorMod(I)I

    move-result v0

5. Done.....! save and compile and replace

For settings Go to post #3

Have fun


from xda-developers http://ift.tt/1NJa3G6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire