android2.2 2.3状态栏区别
2013-11-06 22:26
519 查看
终于升完2.3版本,感触很多。2.3把状态栏提到framework/package里面,虽然修改是方便了,但注意的是它的样式还是取的framework/core/res/res/value中的style.xml和themes.xml文件。
在thems.xml中有这样一段代码:
<style name="Theme"> <item name="colorForeground">@android:color/bright_foreground_dark</item> <item name="colorForegroundInverse">@android:color/bright_foreground_dark_inverse</item> <item name="colorBackground">@android:color/background_dark</item>
<item name="colorBackgroundCacheHint">?android:attr/colorBackground</item> <item name="disabledAlpha">0.5</item> <item name="backgroundDimAmount">0.6</item> <!-- Text styles --> <item name="textAppearance">@android:style/TextAppearance</item> <item name="textAppearanceInverse">@android:style/TextAppearance.Inverse</item>
<item name="textColorPrimary">@android:color/primary_text_dark</item>
..................
</styles>
它控制了上层所有UI显示的样式,想让你的产品更hold就要改这里的,里面颜色则对应color.xml。
状态栏下来框优化则在status_bar_expanded.xml,里面UI具体怎么用你懂的,不在这里详解。
status_bar_latest_event.xml这个文件我在这里详解一下:它就是状态栏下拉控制滚动文件,在2.3修改过这里。
<!-- 2.3代码-->
<com.android.systemui.statusbar.TrackingPatternView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" />
<!-- 2.3代码 --> <View android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:background="#ffffffff" />
只要细心看就能发现google,把原来TrackingPatternView去掉了,而TrackingPatternView就是用画笔去绘制一张图片,而2.3把这个工作交给了StatusBarService.java文件。
TrackingPatternView代码如下:
public TrackingPatternView(Context context, AttributeSet attrs){
super(context, attrs); mTexture = BitmapFactory.decodeResource(getResources(), R.drawable.statusbar_updown_background); mTextureWidth = mTexture.getWidth(); mTextureHeight = mTexture.getHeight();
mPaint = new Paint(); mPaint.setDither(false);
}
在thems.xml中有这样一段代码:
<style name="Theme"> <item name="colorForeground">@android:color/bright_foreground_dark</item> <item name="colorForegroundInverse">@android:color/bright_foreground_dark_inverse</item> <item name="colorBackground">@android:color/background_dark</item>
<item name="colorBackgroundCacheHint">?android:attr/colorBackground</item> <item name="disabledAlpha">0.5</item> <item name="backgroundDimAmount">0.6</item> <!-- Text styles --> <item name="textAppearance">@android:style/TextAppearance</item> <item name="textAppearanceInverse">@android:style/TextAppearance.Inverse</item>
<item name="textColorPrimary">@android:color/primary_text_dark</item>
..................
</styles>
它控制了上层所有UI显示的样式,想让你的产品更hold就要改这里的,里面颜色则对应color.xml。
状态栏下来框优化则在status_bar_expanded.xml,里面UI具体怎么用你懂的,不在这里详解。
status_bar_latest_event.xml这个文件我在这里详解一下:它就是状态栏下拉控制滚动文件,在2.3修改过这里。
<!-- 2.3代码-->
<com.android.systemui.statusbar.TrackingPatternView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" />
<!-- 2.3代码 --> <View android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:background="#ffffffff" />
只要细心看就能发现google,把原来TrackingPatternView去掉了,而TrackingPatternView就是用画笔去绘制一张图片,而2.3把这个工作交给了StatusBarService.java文件。
TrackingPatternView代码如下:
public TrackingPatternView(Context context, AttributeSet attrs){
super(context, attrs); mTexture = BitmapFactory.decodeResource(getResources(), R.drawable.statusbar_updown_background); mTextureWidth = mTexture.getWidth(); mTextureHeight = mTexture.getHeight();
mPaint = new Paint(); mPaint.setDither(false);
}
相关文章推荐
- Android2.2、2.3定制修改状态栏布局、背景、去除状态栏按键、添加状态栏按键
- android 2.2 2.3的区别
- Android 1.5 1.6 2.0 2.1 2.2 2.3 3.0的区别
- Android 1.5 1.6 2.0 2.1 2.2 2.3 3.0的区别
- android2.2 与 android2.3的区别
- Android2.2、2.3定制修改状态栏布局、背景、去除状态栏按键、添加状态栏按键
- Android2.2、2.3定制修改状态栏布局、背景、去除状态栏按键、添加状态栏按键
- android开发中遇到的2.2与2.3以上的区别
- Android 1.5 1.6 2.0 2.1 2.2 2.3 3.0,4.0的区别
- Android 1.5 1.6 2.0 2.1 2.2 2.3 3.0的区别 (转载)
- Android 1.5 1.6 2.0 2.1 2.2 2.3 3.0的区别概要
- android2.3 gps 调用流程以及与android2.2 gps的一些区别
- Android2.2和2.3有什么区别
- Android 2.2和2.3 的wm8976的驱动解析
- Ubuntu10.10下配置Android开发环境 及 2.2,2.3 SDK下载
- StatusBar (状态栏)的架构(Android 2.3)
- android1.5、1.6、2.1、2.2各版本的区别
- Android 2.3状态栏中添加menu,home和back快捷键
- 在Android 2.3状态栏中添加menu,home和back快捷键的方法
- android2.2 、 android2.3 sd卡挂载