【时间居中】不跟通知不跟图标重叠
下面我给大家一个时间居中不跟通知不跟状态栏图标重叠的代码
反编译SystemUIZte.apk 找到SystemUIZte\res\layout\msim_status_bar.xml这个文件
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<LinearLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true" >
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left"/>
<include android:id="@id/msim_signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/msim_signal_cluster_view" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left" />
</LinearLayout>
<LinearLayout android:layout_gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ff000000" android:paddingTop="0.0dip" android:singleLine="true" android:textStyle="bold" />
</LinearLayout>
<LinearLayout android:gravity="right" android:orientation="horizontal" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="1.0" >
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="0.0dip" />
</LinearLayout>
</LinearLayout>
复制代码下面的代码一般不用修改了,最多就改改间隔!!
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="1.0dip" android:animationCache="false"
>
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="1.0dip"
>
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip" android:paddingRight="10.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
复制代码
下面我给大家一个时间居中不跟通知不跟状态栏图标重叠的代码
反编译SystemUIZte.apk 找到SystemUIZte\res\layout\msim_status_bar.xml这个文件
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<LinearLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true" >
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left"/>
<include android:id="@id/msim_signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" layout="@layout/msim_signal_cluster_view" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left" />
</LinearLayout>
<LinearLayout android:layout_gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ff000000" android:paddingTop="0.0dip" android:singleLine="true" android:textStyle="bold" />
</LinearLayout>
<LinearLayout android:gravity="right" android:orientation="horizontal" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="1.0" >
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="0.0dip" />
</LinearLayout>
</LinearLayout>
复制代码下面的代码一般不用修改了,最多就改改间隔!!
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="1.0dip" android:animationCache="false"
>
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="1.0dip"
>
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip" android:paddingRight="10.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
复制代码