[Asus Zenfone 4] bamzzz:
Hi all..

This guide is based on the Asus Zenfone 4S (T00Q) Lollipop firmware.

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:

- Understanding about APK compile/decompile

- APKTool

- Notepad++ (PC)

How:

Part AsusSystemUI:

1. Decompile AsusSystemUI.apk

2. Copy smali from guide to smali folder on systemui.. Overwrite existing smali..

3. Open res/layout/asus_status_bar_expanded_header.xml (Asus) or status_bar_expanded_header.xml (Other phone)

Find:

<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" />

Add this just above:

<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. Open res/values/ids.xml

Add this:

<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. Open res/values/strings.xml and add this:

<string name="status_bar_expanded_header_weather_format">%1$s - %2$s</string>

6. This step should not be applied !!! For Lollipop only, so that only appeared when fully expanded:

Open smali/com/android/systemui/statusbar/phone/StatusBarHeaderView.smali

Find:

# instance fields

Add this just below:

.field private mShowWeather:Z

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

Find:

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

Then find and change .locals 1 to .locals 2

Just above return-void add:

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

Find:

.method private updateVisibilities()V

Just above return-void add:

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

Just above .end method add:

:cond_semvak
const/16 v0, 0x8

goto :goto_boool

Find:

.method protected onFinishInflate()V

Just below invoke-super {p0}, Landroid/widget/RelativeLayout;->onFinishInflate()V add:

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;

Find:

.method public updateEverything()V

Just above return-void add:

invoke-static {}, Lcom/bamzzz/WeatherExpanded;->getVisibilities()Z

move-result v0

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

7. Open AndroidManifest.xml and add this:

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

8. Recompile SystemUI, don't forget to Sign and zipalign apk.

9. Copy LockClock.apk to /system/priv-app/LockClock/ and set permission to rw-r-r (644) then reboot you phone

10. Done

Part Settings:

Optional..!!! You can using ZenControl.apk or include preference into Settings.apk

Add Preference using ZenControl.apk :

1. Decompile ZenControl.apk

2. Open /res/xml/dropdown_prefs.xml and add this:

<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. Open res/values/strings.xml and add this:

<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 & Text)</string>
<string name="expanded_weather_temp_cond_style_title">Weather Condition Style</string>
<string name="expanded_weather_temp_cond_style_1_title">Condition & 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. Open res/values/arrays.xml and add this:

<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.

Adding Preference include settings:

Goto Post 2

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

Created by bamzzz@xda

fb.me/bamz4ever

http://xdaforums.com/member.php?u=4672359

ZenControl by Wuby986@xda & daxgirl@xda

http://xdaforums.com/android/apps-games/app-rom-control-app-devs-t3146567

CyanogenMOD Developers Team