本站长期提供ROM下载,可以定制多国语言刷机包和和刷机方案。点击这里给我发消息

CM10状态栏透明教程CM10半透明教程

ROM相关 半夏月 462℃ 0评论

CM10教程现在还很少,之前CM7教程,CM9教程很多在CM10上已经不通用了,CM10状态栏透明教程更是没有,搜遍整个网络终于找到了爷们狂醉写了一个CM10教程,就保存下来了,仅作收藏学习之用。下面我们就来看看CM10状态栏透明教程吧,也希望以后有更多的CM10教程。

首先反编译systemui.apk
1.打开layout-sw600dp\navigation_bar.xml
找到<com.android.systemui.statusbar.phone.NavigationBarView android:background=”#ff000000″ android:layout_width=”fill_parent” android:layout_height=”fill_parent”
修改android:background=”#ff000000″为android:background=”#70000000″
70是半透明,00是全透明,也可以是b0等..自己决定.
2.打开values\drawables.xml
找到    <item type=”drawable” name=”status_bar_background”>#ff000000</item> 修改值
找到    <item type=”drawable” name=”nav_bar_bg”>#ff000000</item> 修改值
找到    <item type=”drawable” name=”system_bar_background”>#ff000000</item> 修改值
找到    <item type=”drawable” name=”notification_icon_area_smoke”>#aa000000</item> 修改值
3.打开smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
找到.method private getNavigationBarLayoutParams()Landroid/view/WindowManager$LayoutParams; 将下面的
move v2, v1

move v5, v1
改成:
const/4 v5, -0x3

move v2, v1
找到.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;将下面的
.locals 9

.prologue
const/4 v2, 0x4

const/4 v8, -0x1

const/4 v7, 0x0

const/4 v1, 0x0

改成:
.locals 8

.prologue
const/4 v2, 0x4

const/4 v7, 0x0

const/4 v1, 0x0

找到:
iget v0, v0, Landroid/view/ViewGroup$LayoutParams;->width:I

if-ne v0, v8, :cond_3
改成:
iget v0, v0, Landroid/view/ViewGroup$LayoutParams;->width:I

const/4 v5, -0x1

if-ne v0, v5, :cond_3
找到:
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setBar(Lcom/android/systemui/statusbar/BaseStatusBar;)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

.line 488
:cond_1
:goto_2
iput v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPixelFormat:I
改成:
invoke-virtual {v0, p0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setBar(Lcom/android/systemui/statusbar/BaseStatusBar;)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

.line 488
:cond_1
:goto_2
const/4 v0, -0x3

iput v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPixelFormat:I

4.打开smali\com\android\systemui\statusbar\tablet\TabletStatusBar.smali文件
找到:
new-instance v0, Landroid/view/WindowManager$LayoutParams;

const/16 v3, 0x7e3

const v4, 0x800048

const/4 v5, 0x4
改成:
new-instance v0, Landroid/view/WindowManager$LayoutParams;

const/16 v3, 0x7e3

const v4, 0x800048

const/4 v5, -0x3
然后回编译进行替换.
另外还要然编译android.policy.jar文件
打开smali\com\android\internal\policy\impl\PhoneWindowManager.smali文件
找到:.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
将:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.locals 1
.parameter “systemRect”

.prologue
.line 2925
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I

iput v0, p1, Landroid/graphics/Rect;->left:I

.line 2926
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I

iput v0, p1, Landroid/graphics/Rect;->top:I

.line 2927
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I

iput v0, p1, Landroid/graphics/Rect;->right:I

.line 2928
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I

iput v0, p1, Landroid/graphics/Rect;->bottom:I

.line 2929
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;

invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I

move-result v0

.line 2931
:goto_0
return v0

.line 2930
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;

if-eqz v0, :cond_1

iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;

invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I

move-result v0

goto :goto_0

.line 2931
:cond_1
const/4 v0, 0x0

goto :goto_0
.end method
改成:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.locals 1
.parameter “systemRect”

.prologue
.line 2925
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I

iput v0, p1, Landroid/graphics/Rect;->left:I

.line 2926
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I

iput v0, p1, Landroid/graphics/Rect;->top:I

.line 2927
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I

iput v0, p1, Landroid/graphics/Rect;->right:I

.line 2928
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I

iput v0, p1, Landroid/graphics/Rect;->bottom:I

.line 2929
const/4 v0, 0x0

return v0
.end method
然后回编译.
最后将将修改好的systemui.apk和android.policy.jar文件替换到手机对应的目录并给予权限.
如果使用原生Trebuchet启动器不能实现效果,请使用第三方启动器,例如HoloLauncherHD等,CM10状态栏透明教程就完成了,感谢大家观看,如果想学习更多安卓教程学习ROM制作请关注我的博客,我会给大家分享更多更好的CM10教程。

 

全透明效果图

全透明效果图

半透明效果图

半透明效果图

 

转载请注明:半夏月 » CM10状态栏透明教程CM10半透明教程

喜欢 (0)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址