android2.2 2.3状态栏区别

终于升完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);
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值