[Android General] tdunham:
[Guide How-to] Remove Quickconnect & Sfind from Pulldown

This removes the Quickconnect & Sfind shortcuts from the pulldown.

SystemUI.apk layouts edit:

res/layout/status_bar_expanded.xml

Deleted this entire section from status_bar_expanded.xml

[COLOR="Red"]<LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/finder_connect_button_padding_right" android:paddingTop="@dimen/finder_connect_button_padding_top" android:paddingRight="@dimen/finder_connect_button_padding_left" android:paddingBottom="@dimen/finder_connect_button_padding_bottom" android:layout_width="fill_parent" android:layout_height="wrap_content">
<Button android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:id="@id/sfinder_button_big" android:background="@drawable/tw_quick_panel_sfinder_qconnect_button" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_marginRight="10.0dip" android:text="@string/accessibility_sfinder_button" android:layout_weight="0.5" android:fontFamily="sec-roboto-light" />
<Button android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:id="@id/qconnect_button_big" android:background="@drawable/tw_quick_panel_sfinder_qconnect_button" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_marginLeft="10.0dip" android:text="@string/accessibility_qconnect_button" android:layout_weight="0.5" android:fontFamily="sec-roboto-light" />
</LinearLayout>
<View android:id="@id/sfinder_qconnect_divider" android:background="@drawable/notification_bottom_line" android:layout_width="fill_parent" android:layout_height="1.0dip" />
</LinearLayout>[/COLOR]

. .

However, removing Quickconnect & Sfind activates the Sfind shortcut in the statusbar pulldown. The next guide show us how to hide it.

[Guide How-to] Remove/Hide Sfind shortcut from StatusBar

This will hide the Sfind shortcut that appears in the statusbar when Quickpanel & Sfind are removed from the dropdown.

SystemUI.apk layouts edit:

res/layout/status_bar_expanded_header.xml

Change every 'dip' value indicated in RED

<ImageView android:id="@id/sfinder_button" android:background="@drawable/ic_notify_button_bg" android:paddingLeft="[COLOR="Red"]0.0dip[/COLOR]" android:paddingTop="@dimen/button_holder_margin_top" android:paddingRight="[COLOR="Red"]0.0dip[/COLOR]" android:paddingBottom="@dimen/button_holder_margin_bottom" android:focusable="true" android:layout_width="[COLOR="Red"]0.0dip[/COLOR]" android:layout_height="fill_parent" android:src="@drawable/tw_quickpanel_icon_search" android:scaleType="center" android:layout_alignParentLeft="true" android:contentDescription="@string/accessibility_sfinder_button" />
<ImageView android:id="@id/expanded_divider_1" android:background="@color/quickpanel_button_divider_color" android:layout_width="[COLOR="Red"]0.0dip[/COLOR]" android:layout_height="fill_parent" android:layout_marginTop="@dimen/button_holder_divider_margin_top" android:layout_marginBottom="@dimen/button_holder_divider_margin_bottom" android:layout_toRightOf="@id/sfinder_button" />

. .

[Guide How-to] USE A CUSTOM IMAGE FOR THE PULLDOWN BACKGROUND

This modification allows us to use a png image for the pulldown background.

SystemUI.apk layout edit:

res/layout/status_bar_expanded.xml

Line 2 change the background to point to an image file.

Change is indicated in RED

<com.android.systemui.statusbar.phone.NotificationPanelView android:id="@id/notification_panel" [COLOR="Red"]android:background="@drawable/tw_custom_bg[/COLOR]" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_panel_margin_left"

Note

:

PNG image filename is tw_custom_bg.png. Give it whatever name you like.

Notice the .png file extension is not placed in the xml code.

The image file must be placed in one of the drawable folders before you recompile (res/drawable-xxhdpi).

[Guide How-to] ADD RECENT APPS TO THE PULLDOWN STATUSBAR

This will add a recent apps shortcut to the pulldown statusbar.

Download the png image file attached at the bottom of this post and insert it into SystemUI.apk/res/drawable-xxhdpi.

SystemUI.apk layout edit:

res/layout/status_bar_expanded_header.xml

Insert new line in BLUE:

<ImageView android:id="@id/expanded_divider_2" android:background="@color/quickpanel_button_divider_color" android:visibility="gone" android:layout_width="1.0dip" android:layout_height="fill_parent" android:layout_marginTop="@dimen/button_holder_divider_margin_top" android:layout_marginBottom="@dimen/button_holder_divider_margin_bottom" android:layout_toLeftOf="@id/edit_button_holder" />
[COLOR="Blue"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:paddingLeft="1.0dip" android:paddingRight="2.0dip" android:layout_width="35.0dip" android:layout_height="fill_parent" android:src="@drawable/ic_notify_recent" android:scaleType="center" android:layout_toLeftOf="@id/expanded_divider_2" android:contentDescription="@string/accessibility_recent" systemui:keyCode="187" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
[/COLOR] <FrameLayout android:id="@id/edit_button_holder" android:layout_width="@dimen/button_holder_width" android:layout_height="fill_parent" android:layout_toLeftOf="@id/expanded_divider_3">

NOTE:

You might also need to hide the Sfind shortcut in the pulldown statusbar using the above guide.

[Guide How-to] Enable Flashlight Toggle Android L

This will allow you to enable the native flashlight toggle.

SecSettings.apk smali edit:

smali\com\android\settings\NotificationPanelMenu.smali

Add new lines in BLUE to the bottom of the following method BEFORE the return-void (check to make sure they don't already exist) and make sure code matches surrounding values:

.method private makeConvertPanelName()V
.
.
.
[COLOR="Blue"] const-string v1, "Flashlight"

const-string v2, "notification_panel_flashlight"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

iget-object v0, p0, Lcom/android/settings/NotificationPanelMenu;->mConvertPanelItemstring:Ljava/util/HashMap;

const-string v1, "notification_panel_flashlight"

const-string v2, "Flashlight"

invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

iget-object v0, p0, Lcom/android/settings/NotificationPanelMenu;->mConvertPanelItemstring:Ljava/util/HashMap;
[/COLOR]
return-void
.end method

SecSettings.apk strings.xml edit:

res/values/strings.xml

Check for following string in BLUE and add if it to the bottom (before </resources> if it does not already exist:

[COLOR="Blue"]<string name="notification_panel_flashlight">Flashlight</string>
[/COLOR]</resources>

ADD NEW ICON FROM FLASHLIGHT RESOURCES AT BOTTOM OF THIS POST!

SystemUI.apk smali edit:

Delete the line in RED and add the new lines in BLUE

This is a very large method. Search the method for the surrounding code and make sure the new code matches surrounding variables.

smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali

.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.
.
.
iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCarrierLabel:Landroid/widget/TextView;

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClearAll:Landroid/widget/TextView;

invoke-virtual {v3, v4, v5}, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->setCarrierView(Landroid/widget/TextView;Landroid/widget/TextView;)V

:cond_d
:goto_7
[COLOR="Red"]const/4 v3, 0x0[/COLOR]
[COLOR="Blue"]new-instance v3, Lcom/android/systemui/statusbar/policy/FlashlightController;

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-direct {v3, v4}, Lcom/android/systemui/statusbar/policy/FlashlightController;-><init>(Landroid/content/Context;)V
[/COLOR]
move-object/from16 v0, p0

iput-object v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mFlashlightController:Lcom/android/systemui/statusbar/policy/FlashlightController;

new-instance v3, Lcom/android/systemui/statusbar/policy/AccessibilityController;

SystemUI.apk/res/strings.xml edit:

Add new line in BLUE near bottom of xml:

[COLOR="Blue"]<string name="quickpanel_flashlight_text">Flashlight</string>[/COLOR]
</resources>

Optional smali edit if you want to use custom icons for flashlight:

Add icons from zip located at the bottom of this post, compile and decompile to get new values for the two icons highlighted in BLUE below that will be in the new res/values/public.xml.

smali\com\android\systemui\qs\tiles\FlashlightTile.smali

.method protected handleUpdateState(Lcom/android/systemui/qs/QSTile$BooleanState;Ljava/lang/Object;)V
.
.
.
iput-object v1, p1, Lcom/android/systemui/qs/QSTile$BooleanState;->label:Ljava/lang/String;

iget-boolean v1, p1, Lcom/android/systemui/qs/QSTile$BooleanState;->value:Z

if-eqz v1, :cond_6

const v1, 0x[COLOR="Blue"]7f0206e8[/COLOR] ## tw_quick_panel_icon_flashlight_on

:goto_2
iput v1, p1, Lcom/android/systemui/qs/QSTile$BooleanState;->iconId:I

iget-boolean v1, p1, Lcom/android/systemui/qs/QSTile$BooleanState;->value:Z

if-eqz v1, :cond_7

const v0, 0x7f0c0278

:goto_3
iget-object v1, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mContext:Landroid/content/Context;

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

move-result-object v1

iput-object v1, p1, Lcom/android/systemui/qs/QSTile$BooleanState;->contentDescription:Ljava/lang/String;

return-void

:cond_4
iget-object v1, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mHandler:Lcom/android/systemui/qs/QSTile$H;

iget-object v2, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mRecentlyOnTimeout:Ljava/lang/Runnable;

invoke-virtual {v1, v2}, Lcom/android/systemui/qs/QSTile$H;->removeCallbacks(Ljava/lang/Runnable;)V

iget-object v1, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mHandler:Lcom/android/systemui/qs/QSTile$H;

iget-object v2, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mRecentlyOnTimeout:Ljava/lang/Runnable;

iget-wide v4, p0, Lcom/android/systemui/qs/tiles/FlashlightTile;->mWasLastOn:J

add-long/2addr v4, v8

invoke-virtual {v1, v2, v4, v5}, Lcom/android/systemui/qs/QSTile$H;->postAtTime(Ljava/lang/Runnable;J)Z

goto :goto_0

:cond_5
const/4 v1, 0x0

goto :goto_1

:cond_6
const v1, 0x[COLOR="Blue"]7f0206e7[/COLOR] ## tw_quick_panel_icon_flashlight_on
goto :goto_2

:cond_7
const v0, 0x7f0c0277

goto :goto_3
.end method

Finally, the Flashlight string must be added to the SQL settings database.

You can use the flashable zip located here:

http://xdaforums.com/showpost.php?p=58768266&postcount=415