[Android General] SimonVN:
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:

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

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

const/16 v0, 0x[B][COLOR="Blue"]320[/COLOR][/B]

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

const/16 v0, 0x[COLOR="blue"][B]1e0[/B][/COLOR]

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:

[COLOR="Red"]Decimal[/COLOR] = [COLOR="blue"]Hexadecimal[/COLOR]
[COLOR="Red"]480[/COLOR] = [COLOR="blue"]1e0[/COLOR]
[COLOR="Red"]540[/COLOR] = [COLOR="blue"]21c[/COLOR]
[COLOR="Red"]800[/COLOR] = [COLOR="blue"]320[/COLOR]
[COLOR="Red"]960[/COLOR] = [COLOR="blue"]3c0[/COLOR]
[COLOR="Red"]1080[/COLOR] = [COLOR="blue"]438[/COLOR]
[COLOR="Red"]1920[/COLOR] = [COLOR="blue"]780[/COLOR]

Then you can save it.

- Open SystemUI.apk/res/values/ids.xml and add this BLUE code (BLUE ONLY):

[COLOR="blue"]<item type="id" name="backgroundImageView">false</item>[/COLOR]
</resources>

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:

<?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">
[COLOR="Blue"]<com.simonoid.blur.BlurImageView android:id="@id/backgroundImageView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scaleType="centerCrop" />[/COLOR]
<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:

For Android version lower than 4.3, try to change capture screenshot method in BlurImageView.smali

Find and replace all android/view/SurfaceControl with android/view/Surface

HOW TO CHANGE BLUR RADIUS, OPACITY, go to POST #8