Loading...

[GUIDE] Expanded Weather Panel

July 06, 2017 6 Comments
 Kali ini saya akan membaginan guide cyanogenmod yg ada diheader, tested asus zenfone 4s.

Screenshot:
expandedweather

expandedweather

expandedweather

expandedweather

expandedweather

expandedweather


Feature:
Display/Hide weather
Weather style (Text only/Icon only/Icon & Text)
Show/Hide Condition and or temperature text
Weather Text color
Weather Text size
Weather Text font style
Weather icon color
Weather icon size
Condition icon style (Monochrome/Colored/VCloud)
Adv text customization (shadow color, radius, etc)

Requirement:
  • - Mengerti compile/decompile APK
  • - APKTool
  • - Notepad++ (PC)
  • - Bahan:  
  1. Guide Expanded Weather Panel.zip
  2. ZenControl.apk 
  3. LockClock.apk 


How:
Part AsusSystemUI:
1. Decompile AsusSystemUI.apk
2. Letakkan smali yg dari guide ke tempat masing".. Timpah aja smali yg sudah ada..
3. Buka res/layout/asus_status_bar_expanded_header.xml (Asus) atau status_bar_expanded_header.xml (Other phone)
   Cari: <Button android:textSize="@dimen/asus_notification_clear_all_text_size" android:textColor="@color/asus_notification_clear_all_text_color" android:id="@id/clear_all_button" android:background="@drawable/ic_notify_clear" android:layout_width="wrap_content" android:layout_height="@dimen/asus_notification_clear_all_height" android:text="@string/status_bar_clear_all_button" android:layout_alignParentBottom="true" android:contentDescription="@string/accessibility_clear_all" android:fontFamily="sans-serif" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true" />
   Tambahkan diatasnya:
  
    <com.bamzzz.WeatherExpanded android:id="@id/weather_expanded" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true">
        <LinearLayout android:id="@id/weather_container" android:layout_gravity="center_vertical" android:orientation="vertical" android:background="@drawable/ripple_drawable" android:layout_width="wrap_content" android:layout_height="wrap_content">
            <TextView android:textSize="12.0dip" android:textColor="#ff737373" android:gravity="right" android:id="@id/weather_line_1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:importantForAccessibility="noHideDescendants" />
            <TextView android:textSize="12.0dip" android:textColor="#ff737373" android:gravity="right" android:id="@id/weather_line_2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:importantForAccessibility="noHideDescendants" />
        </LinearLayout>
        <ImageView android:id="@id/weather_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@null" android:scaleType="fitXY" android:layout_toRightOf="@id/weather_container" />
    </com.bamzzz.WeatherExpanded>

4. Buka res/values/ids.xml
   Tambahkan:
    <item type="id" name="weather_expanded">false</item>
    <item type="id" name="weather_container">false</item>
    <item type="id" name="weather_line_1">false</item>
    <item type="id" name="weather_line_2">false</item>
    <item type="id" name="weather_image">false</item>

5. Buka res/values/strings.xml
   Tambahkan:
    <string name="status_bar_expanded_header_weather_format">%1$s - %2$s</string>

6. Step ini tidak harus diterapkan !!! Buat Lolli aja, supaya hanya visible pas full expanded aja:

   Buka smali/com/android/systemui/statusbar/phone/StatusBarHeaderView.smali
   Cari:
    # instance fields

   Tambahkan dibawahnya:
    .field private mShowWeather:Z

    .field private final mWeatherExpanded:Lcom/bamzzz/WeatherExpanded;

   Cari:
    .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

   Ubah .locals 1 jadi .locals 2

   Diatas return-void tambahkan:
    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/bamzzz/ComotID;->init(Ljava/lang/String;Landroid/content/Context;)V

   Cari:
    .method private updateVisibilities()V
  
   Diatas return-void tambahkan:
    iget-object v3, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mWeatherExpanded:Lcom/bamzzz/WeatherExpanded;

    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mExpanded:Z

    if-eqz v0, :cond_semvak

    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mShowWeather:Z

    if-eqz v0, :cond_semvak

    const/4 v0, 0x0

    :goto_boool
    invoke-virtual {v3, v0}, Lcom/bamzzz/WeatherExpanded;->setVisibility(I)V
  
   Diatas .end method tambahkan:
    :cond_semvak
    const/16 v0, 0x8

    goto :goto_boool
  
   Cari:
    .method protected onFinishInflate()V
  
   Dibawah invoke-super {p0}, Landroid/widget/RelativeLayout;->onFinishInflate()V tambahkan:
    const-string v0, "weather_expanded"

    const-string v1, "id"

    invoke-static {v0, v1}, Lcom/bamzzz/ComotID;->Get(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/bamzzz/WeatherExpanded;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mWeatherExpanded:Lcom/bamzzz/WeatherExpanded;
  
   Cari:
    .method public updateEverything()V
  
   Diatas return-void tambahkan:
    invoke-static {}, Lcom/bamzzz/WeatherExpanded;->getVisibilities()Z

    move-result v0

    iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mShowWeather:Z
  

7. Buka AndroidManifest.xml dan tambahkan:

    <uses-permission android:name="com.cyanogenmod.lockclock.permission.READ_WEATHER"/>

8. Recompile UI nya, jgn lupa di Sign dan zipalign.
9. Copy LockClock.apk ke /system/priv-app/LockClock/ dan set permission rw-r-r (644)
10. Selesai


Part Settings:

Optional!!! Pilih salah satu, menggunakan ZenControl.apk atau dimasukin ke Settings.apk

Add Preference using ZenControl.apk :

1. Decompile ZenControl.apk

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

    <PreferenceScreen android:title="@string/expanded_weather_title" android:summary="@string/expanded_weather_summary">
        <PreferenceCategory android:title="@string/expanded_weather_title" />
        <SwitchPreference
            android:defaultValue="false"
            android:title="@string/expanded_show_weather_title"
            android:key="expanded_show_weather"
            android:summaryOn="@string/expanded_weather_show"
            android:summaryOff="@string/expanded_weather_hide" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/expanded_weather_style_entries"
            android:title="@string/expanded_weather_style_title"
            android:key="expanded_weather_style"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_style_values" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/expanded_weather_temp_cond_style_entries"
            android:title="@string/expanded_weather_temp_cond_style_title"
            android:key="expanded_weather_temp_cond_style"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_temp_cond_style_values" />
        <com.wubydax.romcontrol.prefs.ColorPickerPreference
            android:title="@string/expanded_weather_text_color_title"
            android:key="expanded_weather_text_color"
            android:defaultValue="\#ffcccccc"
            android:dependency="expanded_show_weather"
            alphaSlider="true" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/expanded_weather_text_fontstyle_entries"
            android:title="@string/expanded_weather_text_fontstyle_title"
            android:key="expanded_weather_text_fontstyle"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_text_fontstyle_values" />
        <com.wubydax.romcontrol.prefs.SeekBarPreference
            android:icon="@null"
            android:max="21"
            android:title="@string/expanded_weather_text_size_title"
            android:key="expanded_weather_text_size"
            android:defaultValue="12"
            android:dependency="expanded_show_weather"
            min="0"
            unitsRight="dip" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:defaultValue="1"
            android:key="dropdown_weather_condition_icon"
            android:title="@string/expanded_weather_condition_icon_title"
            android:dialogTitle="@string/expanded_weather_condition_icon_dlg_title"
            android:entries="@array/expanded_weather_condition_icon_entries"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_condition_icon_values" />
        <SwitchPreference
            android:defaultValue="false"
            android:key="expanded_weather_colorize_all_icons"
            android:title="@string/expanded_weather_colorize_all_icons_title"
            android:dependency="expanded_show_weather"
            android:summary="@string/expanded_weather_colorize_all_icons_summary" />
        <com.wubydax.romcontrol.prefs.ColorPickerPreference
            android:title="@string/expanded_weather_icon_color_title"
            android:key="expanded_weather_icon_color"
            android:defaultValue="\#ffcccccc"
            android:dependency="expanded_show_weather"
            alphaSlider="true" />
        <com.wubydax.romcontrol.prefs.SeekBarPreference
            android:icon="@null"
            android:max="100"
            android:title="@string/expanded_weather_icon_size_title"
            android:key="expanded_weather_icon_size"
            android:defaultValue="50"
            android:dependency="expanded_show_weather"
            min="0"
            unitsRight="px" />
        <PreferenceScreen android:title="@string/expanded_weather_text_adv_custom_title">
            <PreferenceCategory android:title="@string/expanded_weather_text_adv_custom_title" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_r_title"
                android:key="expanded_weather_text_shadow_r"
                android:defaultValue="1"
                min="0"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_x_title"
                android:key="expanded_weather_text_shadow_x"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_y_title"
                android:key="expanded_weather_text_shadow_y"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.wubydax.romcontrol.prefs.ColorPickerPreference
                android:title="@string/expanded_weather_text_shadow_c_title"
                android:key="expanded_weather_text_shadow_c"
                android:defaultValue="\#89000000"
                alphaSlider="true" />
        </PreferenceScreen>
    </PreferenceScreen>

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

    <string name="expanded_weather_title">Expanded Weather Panel</string>
    <string name="expanded_weather_summary">Enable various weather text options in expanded/dropdown</string>
    <string name="expanded_show_weather_title">Display Weather</string>
    <string name="expanded_weather_show">Show</string>
    <string name="expanded_weather_hide">Hide</string>
    <string name="expanded_weather_style_title">Weather Style</string>
    <string name="expanded_weather_style_1_title">Text only</string>
    <string name="expanded_weather_style_2_title">Icon only</string>
    <string name="expanded_weather_style_3_title">Both (Icon &amp; Text)</string>
    <string name="expanded_weather_temp_cond_style_title">Weather Condition Style</string>
    <string name="expanded_weather_temp_cond_style_1_title">Condition &amp; Temperature</string>
    <string name="expanded_weather_temp_cond_style_2_title">Temperature only</string>
    <string name="expanded_weather_temp_cond_style_3_title">Condition only</string>
    <string name="expanded_weather_text_color_title">Weather Text Color</string>
    <string name="expanded_weather_text_fontstyle_title">Weather Text Style</string>
    <string name="expanded_weather_text_size_title">Weather Text Size</string>
    <string name="expanded_weather_icon_color_title">Weather Icon Color</string>
    <string name="expanded_weather_condition_icon_title">Condition icon</string>
    <string name="expanded_weather_condition_icon_dlg_title">Coose an icon for displaying the weather condition</string>
    <string name="expanded_weather_condition_icon_monochrome_title">Monochrome</string>
    <string name="expanded_weather_condition_icon_colored_title">Colored</string>
    <string name="expanded_weather_condition_icon_vclouds_title">VClouds</string>
    <string name="expanded_weather_colorize_all_icons_title">Colorize all icons</string>
    <string name="expanded_weather_colorize_all_icons_summary">Enable to colorize all icons, disable to colorize only the monochrome icons</string>
    <string name="expanded_weather_icon_size_title">Weather Icon Size</string>
    <string name="expanded_weather_font_normal">Normal</string>
    <string name="expanded_weather_font_italic">Italic</string>
    <string name="expanded_weather_font_bold">Bold</string>
    <string name="expanded_weather_font_bold_italic">Bold Italic</string>
    <string name="expanded_weather_font_light">Light</string>
    <string name="expanded_weather_font_light_italic">Light Italic</string>
    <string name="expanded_weather_font_thin">Thin</string>
    <string name="expanded_weather_font_thin_italic">Thin Italic</string>
    <string name="expanded_weather_font_condensed">Condensed</string>
    <string name="expanded_weather_font_condensed_italic">Condensed Italic</string>
    <string name="expanded_weather_font_condensed_light">Condensed Light</string>
    <string name="expanded_weather_font_condensed_light_italic">Condensed Light Italic</string>
    <string name="expanded_weather_font_condensed_bold">Condensed Bold</string>
    <string name="expanded_weather_font_condensed_bold_italic">Condensed Bold Italic</string>
    <string name="expanded_weather_font_medium">Medium</string>
    <string name="expanded_weather_font_medium_italic">Medium Italic</string>
    <string name="expanded_weather_font_black">Black</string>
    <string name="expanded_weather_font_black_italic">Black Italic</string>
    <string name="expanded_weather_text_adv_custom_title">Adv Text Customization</string>
    <string name="expanded_weather_text_shadow_r_title">Shadow radius</string>
    <string name="expanded_weather_text_shadow_x_title">Shadow Dx</string>
    <string name="expanded_weather_text_shadow_y_title">Shadow Dy</string>
    <string name="expanded_weather_text_shadow_c_title">Shadow color</string>

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

    <string-array name="expanded_weather_style_entries">
        <item>@string/expanded_weather_style_1_title</item>
        <item>@string/expanded_weather_style_2_title</item>
        <item>@string/expanded_weather_style_3_title</item>
    </string-array>
    <string-array name="expanded_weather_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_temp_cond_style_entries">
        <item>@string/expanded_weather_temp_cond_style_1_title</item>
        <item>@string/expanded_weather_temp_cond_style_2_title</item>
        <item>@string/expanded_weather_temp_cond_style_3_title</item>
    </string-array>
    <string-array name="expanded_weather_temp_cond_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_condition_icon_entries">
        <item>@string/expanded_weather_condition_icon_monochrome_title</item>
        <item>@string/expanded_weather_condition_icon_colored_title</item>
        <item>@string/expanded_weather_condition_icon_vclouds_title</item>
    </string-array>
    <string-array name="expanded_weather_condition_icon_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_text_fontstyle_entries">
        <item>@string/expanded_weather_font_normal</item>
        <item>@string/expanded_weather_font_italic</item>
        <item>@string/expanded_weather_font_bold</item>
        <item>@string/expanded_weather_font_bold_italic</item>
        <item>@string/expanded_weather_font_light</item>
        <item>@string/expanded_weather_font_light_italic</item>
        <item>@string/expanded_weather_font_thin</item>
        <item>@string/expanded_weather_font_thin_italic</item>
        <item>@string/expanded_weather_font_condensed</item>
        <item>@string/expanded_weather_font_condensed_italic</item>
        <item>@string/expanded_weather_font_condensed_light</item>
        <item>@string/expanded_weather_font_condensed_light_italic</item>
        <item>@string/expanded_weather_font_condensed_bold</item>
        <item>@string/expanded_weather_font_condensed_bold_italic</item>
        <item>@string/expanded_weather_font_medium</item>
        <item>@string/expanded_weather_font_medium_italic</item>
        <item>@string/expanded_weather_font_black</item>
        <item>@string/expanded_weather_font_black_italic</item>
    </string-array>
    <string-array name="expanded_weather_text_fontstyle_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>

5. Recompile ZenControl..

6. Install ZenControl seperti apk normal


Add Preference include settings:

1. Terapkan guide ane sebelumnya: http://forum.xda-developers.com/zenfone-4/themes-apps/guide-easy-preference-control-t3317849

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

    <PreferenceScreen android:title="@string/expanded_weather_title" android:summary="@string/expanded_weather_summary">
        <SwitchPreference
            android:defaultValue="false"
            android:title="@string/expanded_show_weather_title"
            android:key="expanded_show_weather"
            android:summaryOn="@string/expanded_weather_show"
            android:summaryOff="@string/expanded_weather_hide" />
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:entries="@array/expanded_weather_style_entries"
            android:title="@string/expanded_weather_style_title"
            android:key="expanded_weather_style"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_style_values" />
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:entries="@array/expanded_weather_temp_cond_style_entries"
            android:title="@string/expanded_weather_temp_cond_style_title"
            android:key="expanded_weather_temp_cond_style"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_temp_cond_style_values" />
        <com.android.settings.bamzzz.prefs.ColorPickerPreference
            android:title="@string/expanded_weather_text_color_title"
            android:key="expanded_weather_text_color"
            android:defaultValue="\#ffcccccc"
            android:dependency="expanded_show_weather"
            alphaSlider="true" />
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:entries="@array/expanded_weather_text_fontstyle_entries"
            android:title="@string/expanded_weather_text_fontstyle_title"
            android:key="expanded_weather_text_fontstyle"
            android:defaultValue="0"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_text_fontstyle_values" />
        <com.android.settings.bamzzz.prefs.SeekBarPreference
            android:icon="@null"
            android:max="21"
            android:title="@string/expanded_weather_text_size_title"
            android:key="expanded_weather_text_size"
            android:defaultValue="12"
            android:dependency="expanded_show_weather"
            min="0"
            unitsRight="dip" />
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:defaultValue="1"
            android:key="dropdown_weather_condition_icon"
            android:title="@string/expanded_weather_condition_icon_title"
            android:dialogTitle="@string/expanded_weather_condition_icon_dlg_title"
            android:entries="@array/expanded_weather_condition_icon_entries"
            android:dependency="expanded_show_weather"
            android:entryValues="@array/expanded_weather_condition_icon_values" />
        <SwitchPreference
            android:defaultValue="false"
            android:key="expanded_weather_colorize_all_icons"
            android:title="@string/expanded_weather_colorize_all_icons_title"
            android:dependency="expanded_show_weather"
            android:summary="@string/expanded_weather_colorize_all_icons_summary" />
        <com.android.settings.bamzzz.prefs.ColorPickerPreference
            android:title="@string/expanded_weather_icon_color_title"
            android:key="expanded_weather_icon_color"
            android:defaultValue="\#ffcccccc"
            android:dependency="expanded_show_weather"
            alphaSlider="true" />
        <com.android.settings.bamzzz.prefs.SeekBarPreference
            android:icon="@null"
            android:max="100"
            android:title="@string/expanded_weather_icon_size_title"
            android:key="expanded_weather_icon_size"
            android:defaultValue="50"
            android:dependency="expanded_show_weather"
            min="0"
            unitsRight="px" />
        <PreferenceScreen android:title="@string/expanded_weather_text_adv_custom_title">
            <com.android.settings.bamzzz.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_r_title"
                android:key="expanded_weather_text_shadow_r"
                android:defaultValue="1"
                min="0"
                unitsRight="" />
            <com.android.settings.bamzzz.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_x_title"
                android:key="expanded_weather_text_shadow_x"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.android.settings.bamzzz.prefs.SeekBarPreference
                android:icon="@null"
                android:max="5"
                android:title="@string/expanded_weather_text_shadow_y_title"
                android:key="expanded_weather_text_shadow_y"
                android:defaultValue="0"
                min="-5"
                unitsRight="" />
            <com.android.settings.bamzzz.prefs.ColorPickerPreference
                android:title="@string/expanded_weather_text_shadow_c_title"
                android:key="expanded_weather_text_shadow_c"
                android:defaultValue="\#89000000"
                alphaSlider="true" />
        </PreferenceScreen>
    </PreferenceScreen>

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

    <string name="expanded_weather_title">Expanded Weather Panel</string>
    <string name="expanded_weather_summary">Enable various weather text options in expanded/dropdown</string>
    <string name="expanded_show_weather_title">Display Weather</string>
    <string name="expanded_weather_show">Show</string>
    <string name="expanded_weather_hide">Hide</string>
    <string name="expanded_weather_style_title">Weather Style</string>
    <string name="expanded_weather_style_1_title">Text only</string>
    <string name="expanded_weather_style_2_title">Icon only</string>
    <string name="expanded_weather_style_3_title">Both (Icon &amp; Text)</string>
    <string name="expanded_weather_temp_cond_style_title">Weather Condition Style</string>
    <string name="expanded_weather_temp_cond_style_1_title">Condition &amp; Temperature</string>
    <string name="expanded_weather_temp_cond_style_2_title">Temperature only</string>
    <string name="expanded_weather_temp_cond_style_3_title">Condition only</string>
    <string name="expanded_weather_text_color_title">Weather Text Color</string>
    <string name="expanded_weather_text_fontstyle_title">Weather Text Style</string>
    <string name="expanded_weather_text_size_title">Weather Text Size</string>
    <string name="expanded_weather_icon_color_title">Weather Icon Color</string>
    <string name="expanded_weather_condition_icon_title">Condition icon</string>
    <string name="expanded_weather_condition_icon_dlg_title">Coose an icon for displaying the weather condition</string>
    <string name="expanded_weather_condition_icon_monochrome_title">Monochrome</string>
    <string name="expanded_weather_condition_icon_colored_title">Colored</string>
    <string name="expanded_weather_condition_icon_vclouds_title">VClouds</string>
    <string name="expanded_weather_colorize_all_icons_title">Colorize all icons</string>
    <string name="expanded_weather_colorize_all_icons_summary">Enable to colorize all icons, disable to colorize only the monochrome icons</string>
    <string name="expanded_weather_icon_size_title">Weather Icon Size</string>
    <string name="expanded_weather_font_normal">Normal</string>
    <string name="expanded_weather_font_italic">Italic</string>
    <string name="expanded_weather_font_bold">Bold</string>
    <string name="expanded_weather_font_bold_italic">Bold Italic</string>
    <string name="expanded_weather_font_light">Light</string>
    <string name="expanded_weather_font_light_italic">Light Italic</string>
    <string name="expanded_weather_font_thin">Thin</string>
    <string name="expanded_weather_font_thin_italic">Thin Italic</string>
    <string name="expanded_weather_font_condensed">Condensed</string>
    <string name="expanded_weather_font_condensed_italic">Condensed Italic</string>
    <string name="expanded_weather_font_condensed_light">Condensed Light</string>
    <string name="expanded_weather_font_condensed_light_italic">Condensed Light Italic</string>
    <string name="expanded_weather_font_condensed_bold">Condensed Bold</string>
    <string name="expanded_weather_font_condensed_bold_italic">Condensed Bold Italic</string>
    <string name="expanded_weather_font_medium">Medium</string>
    <string name="expanded_weather_font_medium_italic">Medium Italic</string>
    <string name="expanded_weather_font_black">Black</string>
    <string name="expanded_weather_font_black_italic">Black Italic</string>
    <string name="expanded_weather_text_adv_custom_title">Adv Text Customization</string>
    <string name="expanded_weather_text_shadow_r_title">Shadow radius</string>
    <string name="expanded_weather_text_shadow_x_title">Shadow Dx</string>
    <string name="expanded_weather_text_shadow_y_title">Shadow Dy</string>
    <string name="expanded_weather_text_shadow_c_title">Shadow color</string>

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

    <string-array name="expanded_weather_style_entries">
        <item>@string/expanded_weather_style_1_title</item>
        <item>@string/expanded_weather_style_2_title</item>
        <item>@string/expanded_weather_style_3_title</item>
    </string-array>
    <string-array name="expanded_weather_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_temp_cond_style_entries">
        <item>@string/expanded_weather_temp_cond_style_1_title</item>
        <item>@string/expanded_weather_temp_cond_style_2_title</item>
        <item>@string/expanded_weather_temp_cond_style_3_title</item>
    </string-array>
    <string-array name="expanded_weather_temp_cond_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_condition_icon_entries">
        <item>@string/expanded_weather_condition_icon_monochrome_title</item>
        <item>@string/expanded_weather_condition_icon_colored_title</item>
        <item>@string/expanded_weather_condition_icon_vclouds_title</item>
    </string-array>
    <string-array name="expanded_weather_condition_icon_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="expanded_weather_text_fontstyle_entries">
        <item>@string/expanded_weather_font_normal</item>
        <item>@string/expanded_weather_font_italic</item>
        <item>@string/expanded_weather_font_bold</item>
        <item>@string/expanded_weather_font_bold_italic</item>
        <item>@string/expanded_weather_font_light</item>
        <item>@string/expanded_weather_font_light_italic</item>
        <item>@string/expanded_weather_font_thin</item>
        <item>@string/expanded_weather_font_thin_italic</item>
        <item>@string/expanded_weather_font_condensed</item>
        <item>@string/expanded_weather_font_condensed_italic</item>
        <item>@string/expanded_weather_font_condensed_light</item>
        <item>@string/expanded_weather_font_condensed_light_italic</item>
        <item>@string/expanded_weather_font_condensed_bold</item>
        <item>@string/expanded_weather_font_condensed_bold_italic</item>
        <item>@string/expanded_weather_font_medium</item>
        <item>@string/expanded_weather_font_medium_italic</item>
        <item>@string/expanded_weather_font_black</item>
        <item>@string/expanded_weather_font_black_italic</item>
    </string-array>
    <string-array name="expanded_weather_text_fontstyle_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>

5. Compile Settings. Selesai.


NB: Dilarang mengubah nama smali atau path smali yang ada didalam guide ini tanpa izin ane !!!
Attention: Don't rename or modify path of smali from this guide without my permissions !!!

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

My Thread @XDA

Created by bamzzz@xda
fb.me/bamz4ever

ZenControl by Wuby986@xda & daxgirl@xda

CyanogenMOD Developers Team

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

/*
 * Copyright (C) 2015 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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

[GUIDE] Header Machine

July 06, 2017 1 Comment
 Header machine asus zenfone 4s

Screenshot:
headermachine

headermachine

headermachine

headermachine

headermachine


Feature:
Header BG with option (Default, Color, BG Picker, Timer/Omni)
Header BG Timer/Omni style (Default, Modern, Poly)
Header BG alpha
Header BG animation
Enable/disable blur BG
Add options to set date for Idul Fitri, Idul Adha and birthday
Add Blur BG preview

Requirement:
- Mengerti compile/decompile APK
- APKTool
- Notepad++ (PC)
- Bahan: Download

Step:
Part AsusSystemUI:
1. Decompile AsusSystemUI.apk
2. Letakkan smali dan res yg dari guide ke tempat masing".. Timpah aja bila yg sudah ada..
3. Buka AndroidManifest.xml
   Cari:
        <activity android:excludeFromRecents="true" android:name="com.android.keyguard.KeyguardIntruderView" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
            </intent-filter>
        </activity>

   Tambahkan dibawahnya:
        <activity android:theme="@android:style/Theme.Holo" android:label="Header Machine Preference" android:icon="@null" android:name="com.bamzzz.prefs.HeaderMachineActivity" android:excludeFromRecents="true" android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

4. Buka res/layout/asus_status_bar_expanded_header.xml (Asus) atau status_bar_expanded_header.xml (Other phone)
   Cari:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.StatusBarHeaderView android:layout_gravity="@integer/notification_panel_layout_gravity" android:id="@id/header" android:background="@null" android:paddingBottom="@dimen/asus_quicksetting_panel_header_padding_bottom" android:focusable="true" android:clickable="true" android:layout_width="@dimen/notification_panel_width" android:layout_height="@dimen/asus_status_bar_header_height" android:baselineAligned="false" android:paddingStart="@dimen/notification_side_padding" android:paddingEnd="@dimen/notification_side_padding"
  xmlns:android="http://schemas.android.com/apk/res/android">
 
   Tambahkan tepat dibawahnya:
    <com.bamzzz.HeaderMachine android:id="@id/header_machine"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:scaleType="fitXY"
        android:adjustViewBounds="true" />

   Asus Only:
   Cari:
   <Button android:textSize="@dimen/asus_notification_clear_all_text_size" android:textColor="@color/asus_notification_clear_all_text_color" android:id="@id/clear_all_button" android:background="@drawable/ic_notify_clear" android:layout_width="wrap_content" android:layout_height="@dimen/asus_notification_clear_all_height" android:text="@string/status_bar_clear_all_button" android:layout_alignParentBottom="true" android:contentDescription="@string/accessibility_clear_all" android:fontFamily="sans-serif" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true" />
   Lalu tambahkan: android:layout_marginBottom="@dimen/asus_quicksetting_panel_header_padding_bottom"
   Hingga menjadi:
   <Button android:layout_marginBottom="@dimen/asus_quicksetting_panel_header_padding_bottom" android:textSize="@dimen/asus_notification_clear_all_text_size" android:textColor="@color/asus_notification_clear_all_text_color" android:id="@id/clear_all_button" android:background="@drawable/ic_notify_clear" android:layout_width="wrap_content" android:layout_height="@dimen/asus_notification_clear_all_height" android:text="@string/status_bar_clear_all_button" android:layout_alignParentBottom="true" android:contentDescription="@string/accessibility_clear_all" android:fontFamily="sans-serif" android:layout_marginEnd="@dimen/asus_quicksetting_button_margin_right" android:layout_alignParentEnd="true" />

5. Buka res/values/ids.xml
   Tambahkan:
    <item type="id" name="header_machine">false</item>
    <item type="id" name="header_machine_layout">false</item>
    <item type="id" name="header_machine_time_title">false</item>
    <item type="id" name="header_machine_idul_fitri_text">false</item>
    <item type="id" name="header_machine_idul_fitri_button">false</item>
    <item type="id" name="header_machine_idul_adha_text">false</item>
    <item type="id" name="header_machine_idul_adha_button">false</item>
    <item type="id" name="header_machine_birthday_text">false</item>
    <item type="id" name="header_machine_birthday_button">false</item>
    <item type="id" name="header_machine_background_title">false</item>
    <item type="id" name="header_machine_background_content">false</item>
    <item type="id" name="header_machine_checkBlur">false</item>
    <item type="id" name="header_machine_background_button_pick">false</item>
    <item type="id" name="header_machine_background_button_set">false</item>
    <item type="id" name="header_machine_tip_text">false</item>

6. Step ini tidak harus diterapkan !!! Khusus Asus Zenfone, berfungsi untuk menghilangkan background default atau bawaan tema:

   Buka smali/com/android/systemui/statusbar/phone/StatusBarHeaderView.smali
   Cari:
    # instance fields

   Tambahkan dibawahnya:
    .field private mHeaderMachine:I

   Cari:
    .method private setImageViewDrawable()V

   Kemudian cari:
    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackground(Landroid/graphics/drawable/Drawable;)V

   Tambahkan diatasnya:
    iget v8, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

    const/4 v9, 0x0

    if-ne v8, v9, :cond_brut

    const-string v8, "BamzzzHeaderMachine"

    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

    const-string v10, "Header Machine disable -> "

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    iget v10, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

   Cari lagi yang tadi:
    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackground(Landroid/graphics/drawable/Drawable;)V

   Lalu tambahkan dibawahnya:
    goto :goto_brutt

    :cond_brut
    const-string v8, "BamzzzHeaderMachine"

    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

    const-string v10, "Header Machine enable -> "

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    iget v10, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v8, 0x0

    invoke-virtual {p0, v8}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setBackgroundResource(I)V

    :goto_brutt

   Cari:
    .line 199
    .local v8, "paddingBottom":I
    const/4 v12, 0x0

    invoke-virtual {p0, v7, v12, v7, v8}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setPaddingRelative(IIII)V

    .line 200
    return-void
  
   Diatasnya tambahkan:
    const/4 v8, 0x0

   Cari:
    .method public updateEverything()V

   Diatas return-void tambahkan:
    invoke-static {}, Lcom/bamzzz/HeaderMachine;->getVisibilities()I

    move-result v0

    iput v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->mHeaderMachine:I

    invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/StatusBarHeaderView;->setImageViewDrawable()V

7. Recompile UI nya, jgn lupa di Sign dan zipalign. Push & Reboot.

8. Selesai


Part Settings:

Optional!!! Pilih salah satu, menggunakan ZenControl.apk (Lollipop only) atau dimasukin ke Settings.apk

Add Preference using ZenControl.apk :

1. Decompile ZenControl.apk

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

    <PreferenceScreen android:title="@string/header_machine_title" android:summary="@string/header_machine_summary">
        <PreferenceCategory android:title="@string/header_machine_title" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/header_machine_style_entries"
            android:title="@string/header_machine_style_title"
            android:key="header_machine_style"
            android:defaultValue="3"
            android:entryValues="@array/header_machine_style_values" />
        <com.wubydax.romcontrol.prefs.MyListPreference
            android:entries="@array/header_machine_bg_style_entries"
            android:title="@string/header_machine_bg_style_title"
            android:key="header_machine_bg_style"
            android:defaultValue="1"
            android:entryValues="@array/header_machine_bg_style_values" />
        <com.wubydax.romcontrol.prefs.ColorPickerPreference
            android:title="@string/header_machine_color_title"
            android:key="header_machine_color"
            android:defaultValue="\#00000000"
            alphaSlider="true" />
        <com.wubydax.romcontrol.prefs.SeekBarPreference
            android:icon="@null"
            android:max="255"
            android:title="@string/header_machine_bg_alpha_title"
            android:key="header_machine_bg_image_alpha"
            android:defaultValue="100"
            min="0"
            unitsRight="" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:title="@string/header_machine_bg_animated_title"
            android:key="header_machine_bg_animated"
            android:summaryOn="@string/header_machine_enable"
            android:summaryOff="@string/header_machine_disable" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:title="@string/header_machine_bg_image_blur_title"
            android:key="header_machine_bg_image_blur"
            android:summaryOn="@string/header_machine_enable"
            android:summaryOff="@string/header_machine_disable" />
        <PreferenceScreen
            android:summary="@string/header_machine_preference_summary"
            android:title="@string/header_machine_preference_title">
            <intent
                android:targetClass="com.bamzzz.prefs.HeaderMachineActivity"
                android:targetPackage="com.android.systemui" />
        </PreferenceScreen>
    </PreferenceScreen>

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

    <string name="header_machine_title">Header Machine</string>
    <string name="header_machine_summary">Enable various bg options in expanded header</string>
    <string name="header_machine_style_title">Header Machine Style</string>
    <string name="header_machine_style_1_title">Default</string>
    <string name="header_machine_style_2_title">Color</string>
    <string name="header_machine_style_3_title">Custom Image</string>
    <string name="header_machine_style_4_title">Timer (OMNI)</string>
    <string name="header_machine_bg_style_title">Timer Background Style</string>
    <string name="header_machine_bg_style_1_title">Default</string>
    <string name="header_machine_bg_style_2_title">Modern</string>
    <string name="header_machine_bg_style_3_title">Poly HD</string>
    <string name="header_machine_color_title">Header Color</string>
    <string name="header_machine_bg_alpha_title">Header BG Alpha</string>
    <string name="header_machine_bg_animated_title">BG Animated</string>
    <string name="header_machine_bg_image_blur_title">Blur BG</string>
    <string name="header_machine_enable">Enable</string>
    <string name="header_machine_disable">Disable</string>
    <string name="header_machine_preference_title">Header Machine Preference</string>
    <string name="header_machine_preference_summary">Set Header Machine Date and Custom Image Background</string>

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

    <string-array name="header_machine_bg_style_entries">
        <item>@string/header_machine_bg_style_1_title</item>
        <item>@string/header_machine_bg_style_2_title</item>
        <item>@string/header_machine_bg_style_3_title</item>
    </string-array>
    <string-array name="header_machine_bg_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="header_machine_style_entries">
        <item>@string/header_machine_style_1_title</item>
        <item>@string/header_machine_style_2_title</item>
        <item>@string/header_machine_style_3_title</item>
        <item>@string/header_machine_style_4_title</item>
    </string-array>
    <string-array name="header_machine_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
    </string-array>

5. Recompile ZenControl..

6. Install ZenControl seperti apk normal


Add Preference include settings:

1. Terapkan guide ane sebelumnya: http://forum.xda-developers.com/zenfone-4/themes-apps/guide-easy-preference-control-t3317849

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

    <PreferenceScreen android:title="@string/header_machine_title" android:summary="@string/header_machine_summary">
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:entries="@array/header_machine_style_entries"
            android:title="@string/header_machine_style_title"
            android:key="header_machine_style"
            android:defaultValue="3"
            android:entryValues="@array/header_machine_style_values" />
        <com.android.settings.bamzzz.prefs.MyListPreference
            android:entries="@array/header_machine_bg_style_entries"
            android:title="@string/header_machine_bg_style_title"
            android:key="header_machine_bg_style"
            android:defaultValue="1"
            android:entryValues="@array/header_machine_bg_style_values" />
        <com.android.settings.bamzzz.prefs.ColorPickerPreference
            android:title="@string/header_machine_color_title"
            android:key="header_machine_color"
            android:defaultValue="\#00000000"
            alphaSlider="true" />
        <com.android.settings.bamzzz.prefs.SeekBarPreference
            android:icon="@null"
            android:max="255"
            android:title="@string/header_machine_bg_alpha_title"
            android:key="header_machine_bg_image_alpha"
            android:defaultValue="100"
            min="0"
            unitsRight="" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:title="@string/header_machine_bg_animated_title"
            android:key="header_machine_bg_animated"
            android:summaryOn="@string/header_machine_enable"
            android:summaryOff="@string/header_machine_disable" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:title="@string/header_machine_bg_image_blur_title"
            android:key="header_machine_bg_image_blur"
            android:summaryOn="@string/header_machine_enable"
            android:summaryOff="@string/header_machine_disable" />
        <PreferenceScreen
            android:summary="@string/header_machine_preference_summary"
            android:title="@string/header_machine_preference_title">
            <intent
                android:targetClass="com.bamzzz.prefs.HeaderMachineActivity"
                android:targetPackage="com.android.systemui" />
        </PreferenceScreen>
    </PreferenceScreen>

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

    <string name="header_machine_title">Header Machine</string>
    <string name="header_machine_summary">Enable various bg options in expanded header</string>
    <string name="header_machine_style_title">Header Machine Style</string>
    <string name="header_machine_style_1_title">Default</string>
    <string name="header_machine_style_2_title">Color</string>
    <string name="header_machine_style_3_title">Custom Image</string>
    <string name="header_machine_style_4_title">Timer (OMNI)</string>
    <string name="header_machine_bg_style_title">Timer Background Style</string>
    <string name="header_machine_bg_style_1_title">Default</string>
    <string name="header_machine_bg_style_2_title">Modern</string>
    <string name="header_machine_bg_style_3_title">Poly HD</string>
    <string name="header_machine_color_title">Header Color</string>
    <string name="header_machine_bg_alpha_title">Header BG Alpha</string>
    <string name="header_machine_bg_animated_title">BG Animated</string>
    <string name="header_machine_bg_image_blur_title">Blur BG</string>
    <string name="header_machine_enable">Enable</string>
    <string name="header_machine_disable">Disable</string>
    <string name="header_machine_preference_title">Header Machine Preference</string>
    <string name="header_machine_preference_summary">Set Header Machine Date and Custom Image Background</string>

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

    <string-array name="header_machine_bg_style_entries">
        <item>@string/header_machine_bg_style_1_title</item>
        <item>@string/header_machine_bg_style_2_title</item>
        <item>@string/header_machine_bg_style_3_title</item>
    </string-array>
    <string-array name="header_machine_bg_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>
    <string-array name="header_machine_style_entries">
        <item>@string/header_machine_style_1_title</item>
        <item>@string/header_machine_style_2_title</item>
        <item>@string/header_machine_style_3_title</item>
        <item>@string/header_machine_style_4_title</item>
    </string-array>
    <string-array name="header_machine_style_values" translatable="false">
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
    </string-array>

5. Compile Settings. Selesai.


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

NB: Dilarang mengubah nama smali atau path smali yang ada didalam guide ini tanpa izin ane !!!

Attention: Don't rename or modify path of smali from this guide without my permissions !!!

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

Header Machine demo video: https://youtu.be/TaFGTlTdrMI

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

Created by bamzzz@xda
fb.me/bamz4ever

ZenControl by Wuby986@xda & daxgirl@xda
Idea from StatusBar Header Machine and some drawables and some methods from OmniROM Project

Thanks to SyahrulLail for idea of Date picker preference

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

/*
 *  Copyright (C) 2015 The OmniROM Project
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

 =========================================================================
Notepad++ 7.4.2

Notepad++ 7.4.2

July 05, 2017 Add Comment
Notepad ++ adalah gratis (seperti dalam "free speech" dan juga seperti pada "free beer") editor kode sumber dan pengganti Notepad yang mendukung beberapa bahasa. Berjalan di lingkungan MS Windows, penggunaannya diatur oleh Lisensi GPL.

Berdasarkan komponen pengeditan kuat Scintilla, Notepad ++ ditulis di C ++ dan menggunakan API Win32 murni dan STL yang menjamin kecepatan eksekusi lebih tinggi dan ukuran program yang lebih kecil. Dengan mengoptimalkan rutinitas sebanyak mungkin tanpa kehilangan keramahan pengguna, Notepad ++ mencoba mengurangi emisi karbon dioksida dunia. Bila menggunakan daya CPU kurang, PC dapat mencekik dan mengurangi konsumsi daya, sehingga menghasilkan lingkungan yang lebih hijau.

Notepad++ banyak digunakan untuk memodifikasi file text, smali, java, xml, dll yg sering dibutuhkan dalam dunia modding android.

Download:
https://notepad-plus-plus.org/repository/7.x/7.4.2/npp.7.4.2.Installer.exe

Homepage:
https://notepad-plus-plus.org/

[GUIDE] Relayout Traffic ThinkingBridge

July 05, 2017 2 Comments
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


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

[GUIDE] Easy Preference Control / ZenControl

July 05, 2017 Add Comment
Kali ini saya akan membagikan tutorial untuk membuat preference yg sangat dibutuhkan buat user android yg suka ngoprek. perngganti rom control yg include settings. 

Feature:
  • PreferenceScreen
  • SeekBarPreference
  • ColorPickerPreference
  • MyListPreference
  • SwitchPreference
  • CheckBoxPreference
  • MyEditTextPreference
  • FilePreference
  • and many more..
Spoiler for screenshot:
zencontrol

zencontrol

zencontrol

zencontrol



Caranya:
1. Download bahannya disini:
https://drive.google.com/open?id=0ByJzmx4k7dMYRHZZOC1uWE5mNk0
2. Decompile Settings.apk
3. Copy folder smali dari guide
4. Copy folder res ke folder res ente
5. Buka AndroidManifest.xml.
   Cari

    <uses-permission android:name="android.permission.REBOOT"/>, tambahkan dibawahnya:

    <uses-permission android:name="android.permission.FORCE_STOP_PACKAGES" />

   Scroll ke line paling bawah.. tambahkan ini diatas </application>

    <activity android:label="@string/zen_control_title" android:name="com.android.settings.bamzzz.ZenControl" />

6. Buka res/xml/dashboard_categories.xml (Lollipop) atau res/xml/settings_headers.xml (JB)
   Tambahkan ini dibawah "<dashboard-category android:id="@id/system_section" ..." atau dimanapun ente suka

        <dashboard-tile android:icon="@drawable/ic_settings_zencontrol" android:id="@id/zen_control" android:title="@string/zen_control_title" android:fragment="com.android.settings.bamzzz.ZenControl" />

7. Buka res/values/attrs.xml dan tambahkan:

    <attr name="colorPrimary" format="color" />
    <attr name="colorPrimaryDark" format="color" />
    <attr name="colorAccent" format="color" />
    <declare-styleable name="ThumbnailListPreference">
        <attr name="drawableArray" format="reference" />
        <attr name="entryList" format="reference" />
        <attr name="entryValuesList" format="reference" />
        <attr name="entryDefault" format="string" />
    </declare-styleable>

8. Buka res/values/colors.xml dan tambahkan:

    <color name="colorAccent">#ffff4081</color>
    <color name="colorPrimary">#ff3f51b5</color>
    <color name="colorPrimaryDark">#ff303f9f</color>

9. Buka res/values/dimens.xml dan tambahkan:

    <dimen name="button_size">30.0dip</dimen>

10. Buka res/values/ids.xml dan tambahkan:

    <item type="id" name="zen_control">false</item>
    <item type="id" name="appIcon">false</item>
    <item type="id" name="linearLayout">false</item>
    <item type="id" name="appName">false</item>
    <item type="id" name="appPackage">false</item>
    <item type="id" name="imageView">false</item>
    <item type="id" name="color_picker_view">false</item>
    <item type="id" name="text_hex_wrapper">false</item>
    <item type="id" name="hex_val">false</item>
    <item type="id" name="old_color_panel">false</item>
    <item type="id" name="new_color_panel">false</item>
    <item type="id" name="fileSwitch">false</item>
    <item type="id" name="searchApp">false</item>
    <item type="id" name="appsList">false</item>
    <item type="id" name="progressBar">false</item>
    <item type="id" name="iconForApp">false</item>
    <item type="id" name="seekBarPrefUnitsRight">false</item>
    <item type="id" name="seekBarPrefValue">false</item>
    <item type="id" name="seekBarPrefUnitsLeft">false</item>
    <item type="id" name="seekBarPrefBarContainer">false</item>
    <item type="id" name="seekBarPrefSeekBar">false</item>
    <item type="id" name="thumbnailRadioButton">false</item>
    <item type="id" name="thumbnailImage">false</item>
    <item type="id" name="thumbnailText">false</item>
    <item type="id" name="thumbnailListView">false</item>
    <item type="id" name="thumbnailIcon">false</item>

11. Buka res/values/strings.xml dan tambahkan:

    <string name="zen_control_title">Zen Control™</string>
    <string name="ok">OK</string>
    <string name="app_reboot_required_title">App Reboot Required</string>
    <string name="app_reboot_required_message">%1$s reboot is required for the changes to take effect.\n\nReboot now?</string>
    <string name="dialog_color_picker">Color Picker</string>
    <string name="press_color_to_apply">Press on Color to apply</string>

12. Buka smali/com/android/settings/bamzzz/prefs/ColorPickerPreference.smali
   Cari 0x1020018 #type="id" name="widget_frame"
   Cocokkan dengan public id ente yg di framework-res

13. Buka smali/com/android/settings/bamzzz/prefs/FilePreference.smali
   Cari 0x1020010 #type="id" name="summary"
   Cocokkan dengan public id ente yg di framework-res

14. Tinggal edit res/xml/zen_control.xml untuk menambahkan preference baru,
gk perlu edit smali. Tinggal ikutin contohnya aja.

15. Selesai.

NB: Dilarang merubah nama smali dan struktur folder nya tanpa seizin dari ane..!!!

Sekian. Wassalam.

Keep oprek. Salam bootloop.

WORK JB 4.1.2 ++

XDA Thread: Here

Created by bamzzz@xda
fb.me/bamz4ever

ZenControl by Wuby986@xda & daxgirl@xda