[GUIDE] Relayout Traffic ThinkingBridge

July 05, 2017
Kali ini saya akan share cara memuat traffic text di statusbar, asalnya dari ThinkingBridge github, ane relayout dibikin buat dua style, kasih warna, size, dan sebagainya biar lebih matching,, hehe..

Spoiler for screenshot:
traffic

traffic





Feature:
Change Traffic Style (Single, Dual)
Change Traffic alignment (hide/left/right)
Change Traffic color
Change Traffic size
Change Traffic font
Advanced text customization

Requirement:
- Understanding about APK compile/decompile
- APKTool
- Notepad++ (PC)

- Bahan: https://drive.google.com/open?id=0ByJzmx4k7dMYY3hzOGdvM243SWs

How:

Part SystemUI:
1. Decompile AsusSystemUI.apk
2. Letakkan smali yg ada di folder smali ke tempatnya masing".. Overwrite aja smali yg dh ada..
3. -Buka statusbar.xml yg ada di folder res/layout
   -Cari <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" ...
   -Tambahkan dibawahnya:
    <com.android.systemui.statusbar.policy.Traffic android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="left|center" android:id="@id/Traffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="3.0dip" android:paddingEnd="3.0dip" />

4. -Buka system_icons.xml yg ada di folder res/layout
   -Cari <ImageView android:id="@id/wifi_direct" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
   -Tambahkan dibawahnya:
    <com.android.systemui.statusbar.policy.TrafficBamz android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="right|center" android:id="@id/Traffic2" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="3.0dip" android:paddingEnd="3.0dip" />

5. -Buka ids.xml yg ada di folder res/values
   -Scroll ke line paling bawah, tambahkan diatas </resources> :

    <item type="id" name="Traffic">false</item>
    <item type="id" name="Traffic2">false</item>

6. -Buka styles.xml yg ada di folder res/values
   -Scroll ke line paling bawah, tambahkan diatas </resources> :
  
    <style name="TextAppearance.StatusBar.Traffic" parent="@android:style/TextAppearance.StatusBar.Icon">
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:textSize">14.0dip</item>
        <item name="android:shadowColor">#89000000</item>
        <item name="android:shadowDx">0.0</item>
        <item name="android:shadowDy">0.0</item>
        <item name="android:shadowRadius">1.5</item>
        <item name="android:fontFamily">roboto-bold</item>
    </style>

7. Recompile
8. Selesai.. siap di push UI nya

Part ZenControl:
1. Decompile ZenControl..

2. Buka dan tambahkan script dibawah ini di /res/xml/ui_prefs.xml

    <PreferenceScreen android:title="@string/network_traffic_title" android:summary="@string/network_traffic_summary">
        <PreferenceCategory android:title="@string/sb_traffic_title" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/sb_traffic_entries"
            android:title="@string/sb_traffic_align_title"
            android:key="status_bar_traffic_position"
            android:defaultValue="1"
            android:entryValues="@array/sb_traffic_values" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/sb_traffic_line_entries"
            android:title="@string/sb_traffic_line_title"
            android:key="status_bar_traffic_line"
            android:defaultValue="1"
            android:entryValues="@array/sb_traffic_line_values" />
        <com.wubydax.romcontrol.prefs.ColorPickerPreference
            android:title="@string/sb_traffic_color_title"
            android:key="status_bar_traffic_color"
            android:defaultValue="\#ffffffff"
            alphaSlider="true" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/sb_traffic_font_style_entries"
            android:title="@string/sb_traffic_font_title"
            android:key="status_bar_traffic_font"
            android:defaultValue="0"
            android:entryValues="@array/traffic_font_style_values" />
        <com.wubydax.romcontrol.prefs.SeekBarPreference
            android:icon="@null"
            android:max="23"
            android:title="@string/sb_traffic_size_title"
            android:key="status_bar_traffic_size"
            android:defaultValue="16"
            min="5"
            unitsRight="dp" />
        <PreferenceScreen android:title="@string/sb_traffic_adv_custom_title">
            <PreferenceCategory android:title="@string/sb_traffic_adv_custom_title" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="10"
                android:title="@string/sb_traffic_shadow_r_title"
                android:key="status_bar_traffic_shadow_r"
                android:defaultValue="1"
                min="0"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/sb_traffic_shadow_x_title"
                android:key="status_bar_traffic_shadow_x"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/sb_traffic_shadow_y_title"
                android:key="status_bar_traffic_shadow_y"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.ColorPickerPreference
                android:title="@string/sb_traffic_shadow_c_title"
                android:key="status_bar_traffic_shadow_c"
                android:defaultValue="\#89000000"
                alphaSlider="true" />
        </PreferenceScreen>
    </PreferenceScreen>

3. Buka dan tambahkan script dibawah ini di res/values/strings.xml

    <string name="network_traffic_title">Network traffic</string>
    <string name="network_traffic_summary">Enable various network traffic options in statusbar</string>
    <string name="sb_traffic_title">Traffic ThinkingBridge</string>
    <string name="sb_traffic_align_title">Traffic alignment</string>
    <string name="sb_traffic_color_title">Traffic color</string>
    <string name="sb_traffic_size_title">Traffic size</string>
    <string name="sb_traffic_font_title">Traffic font</string>
    <string name="sb_traffic_line_title">Traffic style</string>
    <string name="sb_traffic_right">Right</string>
    <string name="sb_traffic_left">Left</string>
    <string name="sb_traffic_dont_show">"Don't Show"</string>
    <string name="sb_traffic_font_normal">Normal</string>
    <string name="sb_traffic_font_italic">Italic</string>
    <string name="sb_traffic_font_bold">Bold</string>
    <string name="sb_traffic_font_bold_italic">Bold Italic</string>
    <string name="sb_traffic_font_light">Light</string>
    <string name="sb_traffic_font_light_italic">Light Italic</string>
    <string name="sb_traffic_font_thin">Thin</string>
    <string name="sb_traffic_font_thin_italic">Thin Italic</string>
    <string name="sb_traffic_font_condensed">Condensed</string>
    <string name="sb_traffic_font_condensed_italic">Condensed Italic</string>
    <string name="sb_traffic_font_condensed_light">Condensed Light</string>
    <string name="sb_traffic_font_condensed_light_italic">Condensed Light Italic</string>
    <string name="sb_traffic_font_condensed_bold">Condensed Bold</string>
    <string name="sb_traffic_font_condensed_bold_italic">Condensed Bold Italic</string>
    <string name="sb_traffic_font_medium">Medium</string>
    <string name="sb_traffic_font_medium_italic">Medium Italic</string>
    <string name="sb_traffic_font_black">Black</string>
    <string name="sb_traffic_font_black_italic">Black Italic</string>
    <string name="sb_traffic_adv_custom_title">Adv Text Customization</string>
    <string name="sb_traffic_shadow_r_title">Shadow radius</string>
    <string name="sb_traffic_shadow_x_title">Shadow Dx</string>
    <string name="sb_traffic_shadow_y_title">Shadow Dy</string>
    <string name="sb_traffic_shadow_c_title">Shadow color</string>

4. Buka dan tambahkan script dibawah ini di res/values/arrays.xml

    <string-array name="sb_traffic_font_style_entries">
        <item>@string/sb_traffic_font_normal</item>
        <item>@string/sb_traffic_font_italic</item>
        <item>@string/sb_traffic_font_bold</item>
        <item>@string/sb_traffic_font_bold_italic</item>
        <item>@string/sb_traffic_font_light</item>
        <item>@string/sb_traffic_font_light_italic</item>
        <item>@string/sb_traffic_font_thin</item>
        <item>@string/sb_traffic_font_thin_italic</item>
        <item>@string/sb_traffic_font_condensed</item>
        <item>@string/sb_traffic_font_condensed_italic</item>
        <item>@string/sb_traffic_font_condensed_light</item>
        <item>@string/sb_traffic_font_condensed_light_italic</item>
        <item>@string/sb_traffic_font_condensed_bold</item>
        <item>@string/sb_traffic_font_condensed_bold_italic</item>
        <item>@string/sb_traffic_font_medium</item>
        <item>@string/sb_traffic_font_medium_italic</item>
        <item>@string/sb_traffic_font_black</item>
        <item>@string/sb_traffic_font_black_italic</item>
    </string-array>
    <string-array name="traffic_font_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
        <item>5</item>
        <item>6</item>
        <item>7</item>
        <item>8</item>
        <item>9</item>
        <item>10</item>
        <item>11</item>
        <item>12</item>
        <item>13</item>
        <item>14</item>
        <item>15</item>
        <item>16</item>
        <item>17</item>
    </string-array>
    <string-array name="sb_traffic_line_entries" translatable="false">
        <item>Single</item>
        <item>Dual</item>
    </string-array>
    <string-array name="sb_traffic_line_values" translatable="false">
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="sb_traffic_entries" translatable="false">
        <item>@string/sb_traffic_dont_show</item>
        <item>@string/sb_traffic_left</item>
        <item>@string/sb_traffic_right</item>
    </string-array>
    <string-array name="sb_traffic_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>

5. Recompile ZenControl..

6. Install ZenControl seperti apk normal, push/copy AsusSystemUI.apk ke /system/priv-app/AsusSystemUI/

7. Selesai.


NB: Kenapa ane gk kasih jadi aja zenControlnya.. krna akan ada guide selanjutnya menggunakan zencontrol.
Kalo sekiranya ribet pake app pihak ketiga (ZenControl), trus mau di integrate di Settings, silahkan aja berkreasi sndri
Kurang dan lebihnya ane minta maaf.. semoga sukses.. Keep oprek.. Salam Bootloop ^_^

XDA Thread: Here

========================================================================


Created by bamzzz@xda
fb.me/bamz4ever

ZenControl by Wuby986@xda & daxgirl@xda


========================================================================

Artikel Terkait

Previous
Next Post »

2 comments

Write comments
Rekjezt
AUTHOR
July 6, 2017 at 7:05 AM delete

buat xiaomi mn😂😂😂

Reply
avatar
bamzzz
AUTHOR
July 6, 2017 at 7:26 AM delete

Blm dibuat mas.. hehe

Reply
avatar

Silahkan tinggalkan komentar EmoticonEmoticon