[Sony Cross-Device Development Themes and Apps] venkat kamesh:
Hello guys

i had got you a new tut :p

Which is Swipe on nav bar to sleep/lock

Lets start work :p

All you need is Deodexed Systemui.apk, settings.apk and Good patience ( if you dont have any of these then just dont try this )

Ok

1. Decompile SystemUI.apk

2. Now download this View attachment 3617808 and merge to your systemui.apk

3. Open com/android/systemui/statusbar/phone/NavigationBarView.smali

Look for this annotation

Lcom/android/systemui/statusbar/phone/NavigationBarView$OnVerticalChangedListener;,

Below that add this annotation

Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;,

Now look for

.field final mDisplay:Landroid/view/Display;

Below that add these definitions

.field private mDownTime:J

.field private mDownX:F

.field private mDownY:F

.field private mIsDown:Z

.field private mPowerManager:Landroid/os/PowerManager;

.field mSwipe2SleepActive:Z

Now look for this method ( this #1 post will have completely on this method only dont confuse )

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

in that method first Change .locals 4 to .locals 6

after this

const/4 v3, 0x0

add this

const/4 v4, 0x1

look for this line

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mImeSwitcherClickListener:Landroid/view/View$OnClickListener;

Below that add this

iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z

Look for this line

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDisplay:Landroid/view/Display;

Below that add this

const-string v1, "power"

invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v1

check-cast v1, Landroid/os/PowerManager;

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;

Now look for this line

iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mTaskSwitchHelper:Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;

Below that add this

invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V

Now look for this line

invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V

Replace the above line with this code

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v3, "navbar_swipe_to_sleep"

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

move-result v1

if-ne v1, v4, :cond_0

:goto_0
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z

.line 207
new-instance p1, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mHandler:Lcom/android/systemui/statusbar/phone/NavigationBarView$H;

invoke-direct {p1, p0, v1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/NavigationBarView;Landroid/os/Handler;)V

.line 208
.local p1, "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;->observe()V

Now in the same method you will find this return-void

Below that add this code

.end local p1 # "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
:cond_0
move v4, v2

.line 205
goto :goto_0

save and Continued in 2nd and 3rd post