Searching...
Thứ Tư, 6 tháng 1, 2016

Hướng dẫn mod Stt bar 3 dòng

11:45
Mod stt bar 3 dòng cũng tương tự mod 2 dòng
Các bạn chú ý kĩ và coppy code đúng chỗ là được

HD mod stt3 3 dòng .... by <K.T.H.B.T>

(1) Mở rộng thanh bar... (framework-res.apk) (xem ảnh1)


Decompie framework-res.apk

Theo đưòng dẫn framework-res/res/values/dimens.xml

Tìm dòng code:
    <dimen name="status_bar_height">25.0dip</dimen>
Sửa thành:
    <dimen name="status_bar_height">60.0dip</dimen>

Tiếp tục tìm dòng code:
    <dimen name="status_bar_icon_size">24.0dip</dimen>
và sửa thành:
    <dimen name="status_bar_icon_size">20.0dip</dimen>

Lưu lại

Recompie framework-res

(2) chia dòng stt3 làm 3 dòng (SystemUI.apk)

Decompie SystemUI.apk

Kiểu mình hướng dẫn ở đây là chia stt3 thành 3 khúc 1 khúc sẽ có 3 tầng nhé...(hơi khó hiểu chút...)

Theo đưòng dẫn SystemUI/res/layout/status_bar.xml(gemini_status_bar.xml)(tw_status_bar.xml) tuỳ dòng máy mở và sửa


(A) Ta bắt đầu với khúc 1 bên trái nhé:

Tuỳ từng file stt3 nó khác nhau đại khái là đặt cụm chia dòng khúc 1 ở dòng số 7  hoặc dòng 8
cũng có thể là dòng 6 của status_bar.xml (mình làm bài hd trên máy LG nhé) (xem hình)

Tìm code:
    <com.lge.systemui.StatusBarLinearLayout android:orientation="horizontal" android:id="@id/icons" android:tag="NO_R2L" android:paddingLeft="1.0dip" android:paddingRight="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
Đặt cụm code này ngay dưới nó (thụt vào 4 dấu cách)
        <LinearLayout android:gravity="left" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="60.0dip" android:layout_weight="1.0">
            <LinearLayout android:gravity="left|center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này đặt code icon cho dòng 1 bên trái
            </LinearLayout>
            <LinearLayout android:gravity="left|center" android:orientation="horizontal" android:id="@id/stt3trai2" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này đặt code icon cho dong 2 bên trái
            </LinearLayout>
            <LinearLayout android:gravity="left|center" android:orientation="horizontal" android:id="@id/stt3trai3" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này đặt code icon cho dòng 3 bên trái
            </LinearLayout>
        </LinearLayout>

(B) và tiếp theo là khúc 2 giữa nhé
đặt cụm code này ngat bên dưới cụm 1 bên trái ở đây mình để 2 code đồng hồ kim ở trên và đồng hồ số ở dưới (xem hình)

   
kiếm 3 file ảnh đồng hồ lần lượt là a_clock.png , a_hour.png , a_minute.png , cho vào SystemUI/res/drawable-xhdpi ,hdpi,xxhdpi tuỳ máy nhé...

        <LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/stt3giua" android:layout_width="fill_parent" android:layout_height="60.0dip" android:layout_weight="1.0">
            <LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/stt3giua1" android:layout_width="fill_parent" android:layout_height="40.0dip" android:layout_weight="1.0">
                <AnalogClock android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:dial="@drawable/a_clock" android:hand_hour="@drawable/a_hour" android:hand_minute="@drawable/a_minute" android:layout_centerVertical="true" />
            </LinearLayout>
            <LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/stt3giua2" android:layout_width="80.0dip" android:layout_height="20.0dip" android:layout_weight="1.0">
                <DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
            </LinearLayout>
        </LinearLayout>


ban nào ko muốn hiện đồng hồ số thì xoá code: <DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" ......
và thêm vào chỗ đó code gì thì tuỳ ý...

(C) rồi giờ đến khúc 3 bên phải nhé
đặ cụm code này vào dưới cụm 2 giữa nhé (xem hình)



        <LinearLayout android:gravity="right" android:orientation="vertical" android:id="@id/stt3phai" android:layout_width="fill_parent" android:layout_height="60.0dip" android:layout_weight="1.0">
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/stt3phai1" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này để code icon tầng 1 bên phải
            </LinearLayout>
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/stt3phai2" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này để code icon tầng 2 bên phải
            </LinearLayout>
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/stt3phai3" android:layout_width="fill_parent" android:layout_height="20.0dip" android:layout_weight="1.0">
                chỗ này để code icon tầng 3 bên phải
            </LinearLayout>
        </LinearLayout>


rồi đật code chia dòng đã xong giờ đến lúc cắt các code icon vào vị trí mà mình muốn nó hiển thị nhé

hd nhận biết các code icon sơ lược như sau:

code thông báo: dựa vào từ (IconMerger) này để nhận biết
    <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:tag="NO_R2L" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" />

code sóng: dựa và đoạn code này (<include android:id="@id/signal_cluster"...) để nhận biết
<include android:id="@id/signal_cluster" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />

code đồng hồ số:
    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
code đồng hồ số có giây (thêm vào stt3 gốc ko có)
    <DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />

code pin : dựa vào đoạn code (<ImageView android:id="@id/battery"....) để nhận biết code bên trên code pin là chũ % của pin nhé...
    <TextView android:textSize="13.0dip" android:textColor="#f2f2f2f2" android:gravity="center_vertical" android:id="@id/level_percent" android:tag="NO_R2L" android:paddingLeft="2.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:id="@id/battery" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />

code icon rung+chuông: dựa vào đoạn code (<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons"....) để nhận biết
    <LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />


Tiếp tục theo đường dẫn SystemUI/res/values/ids.xml mở và thêm code bên dưới và cuối ids.xml (xem hình)

    <item type="id" name="stt3trai">false</item>
    <item type="id" name="stt3trai1">false</item>
    <item type="id" name="stt3trai2">false</item>
    <item type="id" name="stt3trai3">false</item>
    <item type="id" name="stt3giua">false</item>
    <item type="id" name="stt3giua1">false</item>
    <item type="id" name="stt3giua2">false</item>
    <item type="id" name="stt3phai">false</item>
    <item type="id" name="stt3phai1">false</item>
    <item type="id" name="stt3phai2">false</item>
    <item type="id" name="stt3phai3">false</item>
Xong 

Recompie SystemUI 

dùng 7zip coppy META-INF và AndroiManifest.xml  từ file gốc qua file mới build

song cho vào root/system  sét permision 0644 rồi chuyển SystemUI.apk vào root/system/app (hoặc priv-app) còn framework-res.apk vào root/system/framework





Next
This is the most recent post.
Bài đăng Cũ hơn

1 nhận xét: