Android的移植 - 状态栏定制 [英] Android porting - Status Bar customization

查看:144
本文介绍了Android的移植 - 状态栏定制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想修改android的状态栏图标。该文件,statusbar_background.9.png是要修改。 1。但可能有人建议我如何使它透明? 至于定制,可以调整我们的状态栏宽度相对大小?是指,根据屏幕上的图标present多少? 我修改文件/frameworks/base/packages/systemui/src/com/android/systemui/statusbar/statusbarservice.java

Hi I am trying to modify the statusbar icon in android. The file, statusbar_background.9.png is to modified. 1. But could some one suggest me how to make it transparent? As for the customization, can we resize status bar width to a relative size? means,based on number of icons present on the screen? I am modifying the file /frameworks/base/packages/systemui/src/com/android/systemui/statusbar/statusbarservice.java

请给我一些建议 谢谢 抗体

Please give me some suggestion Thanks Ab

推荐答案

最后,我发现我的问题的答案。
我改变了以下内容:
安卓背景=@可绘制/ statusbar_background

Finally I found the answer for my question.
I changed the following:
android:background="@drawable/statusbar_background"
to

android:background="@android:color/transparent"

/framework/base/packages/systemui/res/statusbar.xml 文件。

有关调整状态栏需要做到以下几点: 修改 StatusbarService.java 保护无效addStatusBarView()函数文件与以下内容:

For resizing the status bar need to do the following: modify the protected void addStatusBarView() function in StatusbarService.java file with the following:

WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                //abhi 17 mar ViewGroup.LayoutParams.MATCH_PARENT,
                mwidth, //specify the width of statusbar.. 
                height,
                WindowManager.LayoutParams.TYPE_STATUS_BAR,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING,

                PixelFormat.TRANSPARENT
                );
        // abhi 15 march lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
        lp.gravity = Gravity.TOP | Gravity.LEFT;
        lp.setTitle("StatusBar");
        //lp.gravity = Gravity.CENTER;//abhi 18 march
        lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar;
        lp.x = 25; // to move status bar to x position
        WindowManagerImpl.getDefault().addView(view, lp);

.....
}

这篇关于Android的移植 - 状态栏定制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆