Selasa, 26 Juni 2012

Smooth scroll mod

Add - This tweak will be included in CM7 officially. Editing smali manually will not needed. So you can find the option in performance setting. Thanks cyanogenmod team! (But other stock based roms still can do this like 'Sense','Blur','Touchwiz',etc)

- Some android applications have some lag when they scroll.

I found in logcat that garbage collector is working to much when I do some scroll in application.
I googled about it and found the 'scrollingcache' function inside android making problem.
Some application developers recommend disable 'scrollingcache' in app's internal config.
But not all applications have disabled scrollingcache.
So the mod I'll do will disable the scrollingcache throughout the Android OS.
All apps will have no problem with scrollingcache.
I've had scrolling improvements with facebook,playerpro,poweramp,gallery apps , etc.
It is simillar with volume step mod but different value to change.

Here's what you have to modify:
1. Open the framework/android/widget/AbsListView.smali with text editor.
2. Search through 'ScrollingCache' and change it.

Code:
.method private createScrollingCache()V
.registers 3

.prologue
const/4 v1, 0x1
change to

Code:
.method private createScrollingCache()V
.registers 3

.prologue
const/4 v1, 0x0
and

.line 649
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
change to

Code:
.line 649
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
and

Code:
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "enabled"
change to

Code:
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "no"
3. Press the text editor's save button if you finished.

C. Finishing steps.

1. Come back to baksmali manager window.
2. Press 2 to smali.
3. Wait. (It will create classes.dex file after finish)
4. Open the framework.jar file with 7zip.
5. Overwrite the classes.dex file inside the framework.jar.
(You can just drag&drop the classes.dex file to 7zip window.)

Tidak ada komentar :

Posting Komentar