Saturday 23 July 2016

[GUIDE][MOD][4.3+] How to add Blur background to your Recent Apps, Notification Panel



One line - One blur background

I will guide you to add blur background to recent apps panel, but you can add to any layout you want.

Requirements
  • Apktool 2.0

  • SystemUI.apk (or any other app you want)

  • Notepad++ for editting

  • Brain.apk installed :D

LET'S START
- First, decompile your SystemUI.apk
- Download and extract simon_blur_background.zip (5.1 KB) then merge the smali folder to your decompiled folder.
- Open SystemUI.apk/smali/com/simonoid/blur/BlurImageView.smali
- Now find this method:

Code:


# direct methods
.method static constructor <clinit>()V


- Scroll a little bit down, you'll see this:

Code:


    const/16 v0, 0x320

    sput v0, Lcom/simonoid/blur/BlurImageView;->HIGH:I

    const/16 v0, 0x1e0

    sput v0, Lcom/simonoid/blur/BlurImageView;->WIDHT:I


- Look at the BLUE hex code. It's my phone resolution (480x800 in hexadecimal is 1e0x320). You have to change it to match your device's resolution or it'll get FC error.
320 is the height
1e0 is the width
You can click HERE to convert decimal to hexadecimal number.
Or you can use some presets:

Code:


Decimal = Hexadecimal
480 = 1e0
540 = 21c
800 = 320
960 = 3c0
1080 = 438
1920 = 780


Then you can save it.
- Now go to the layout you want to add blur background, for example: SystemUI.apk/res/layout/status_bar_recent_panel.xml (for Recent Apps panel). Add the blue code:

Code:


<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:background="@color/recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <com.simonoid.blur.BlurImageView android:id="@id/backgroundImageView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="centerCrop" />
    <FrameLayout android:id="@id/recents_bg_protect" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
        <com.android.systemui.recent.NokiaRecentsHorizontalScrollView android:id="@id/recents_container" android:fitsSystemWindows="true" android:scrollbars="none" android:fadingEdgeLength="0.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layoutDirection="ltr">
            <LinearLayout android:orientation="horizontal" android:id="@id/recents_linear_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" />
        </com.android.systemui.recent.NokiaRecentsHorizontalScrollView>
    </FrameLayout>
    <include android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
</com.android.systemui.recent.RecentsPanelView>


- Now recompile your apk and push to your system. :fingers-crossed:
- Finally hit the Thanks :good: button and tell me if it works. :o
- If you're encountering any errors then post here (with log) so that I could help

NOTE: If you're going to add blur background in somewhere in framework-res.apk/res/layout and you don't know where to put the smali. Just put it in framework.jar :fingers-crossed:







No comments:

Post a Comment