Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Tutorial]Lockscreen and Recent app shortcut, Notification text color on drop panel

OP kmokhtar79

22nd March 2013, 12:14 PM   |  #1  
kmokhtar79's Avatar
OP Senior Member
Flag Beijing
Thanks Meter: 5,725
 
2,241 posts
Join Date:Joined: Aug 2012
Donate to Me
More
How to add Lockscreen and Recent app shortcut on notification panel


Assuming know how to use Apk-Multi-Tools (I am using majdini repacked one) , decompile SystemUI and go to layout folder, seek for tw_status_bar_expanded_header.xml.

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="39.0dip" android:baselineAligned="false"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="#ffffffff" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:layout_marginTop="-3.0dip" android:singleLine="true" systemui:ampmSmall="true" />
    <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="#ffffffff" android:ellipsize="none" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="4.0dip" android:maxLines="2" />
    <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:visibility="gone" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
    <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
    <ImageView android:layout_width="1.0dip" android:layout_height="25.0dip" android:layout_marginTop="7.0dip" android:layout_marginBottom="7.0dip" android:src="@drawable/tw_quick_panel_plnm_setting_dv" />
    <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
     <ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
    </RelativeLayout>
</LinearLayout>
substitute it to

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="39.0dip" android:baselineAligned="false"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="#ffffffff" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:layout_marginTop="-3.0dip" android:singleLine="true" systemui:ampmSmall="true" />
    <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="#ffffffff" android:ellipsize="none" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="4.0dip" android:maxLines="2" />
    <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:visibility="gone" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
    <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:paddingLeft="2.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_toLeftOf="@id/back" android:contentDescription="@string/accessibility_recent" systemui:keyCode="187" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:paddingLeft="2.0dip" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lock" android:layout_toLeftOf="@id/settings_button" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
    <ImageView android:layout_width="1.0dip" android:layout_height="25.0dip" android:layout_marginTop="7.0dip" android:layout_marginBottom="7.0dip" android:src="@drawable/tw_quick_panel_plnm_setting_dv" />
    <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
     <ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
    </RelativeLayout>
</LinearLayout>

Red lines are for this mod. First line is for Recent Apps icon and the second one for LockScreen icon.

Also after modifying mentioned XML you need to add corresponding .png photo to drawable-xhdpi which is called ic_sysbar_lock.png for lockscreen (sensitive must be added) and ic_sysbar_recent.png for recent Apps which is already there in drawable-xhdpi and I just resized it.
Compile and done.
Good Luck


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now you can download it here:
This mod is made for ALL Sammy 4.1.2 JB base roms. If want to try please make a backup first.
New pack would only add this mod to your SystemUI and you can freely flash it while keeping all of you previous mods on SystemUI.
- Added Universal Pack for ALL Firmwares, one pack for both System and preload - Working on LSZ,LT4, LT5,... 11.5.2013
- Added Lock Screen and Recent Apps on notification panel


Last edited by kmokhtar79; 29th June 2013 at 11:52 AM.
The Following 31 Users Say Thank You to kmokhtar79 For This Useful Post: [ View ]
22nd March 2013, 12:52 PM   |  #2  
kmokhtar79's Avatar
OP Senior Member
Flag Beijing
Thanks Meter: 5,725
 
2,241 posts
Join Date:Joined: Aug 2012
Donate to Me
More
How to change Notification Background and Text Color on drop down panel:

Thanks majdini for his turorial but as my this theme is kinda associated together I have no choice to repeat first part for Notification background.

Notification Background color
A- First of all you need to make notification background independent (I call it) from systemui.apk so that the color can be changed by hex code in framework.
1- Go to SystemUI/smali/com/android/systemui/statusbar/phone/ folder and open PhoneStatusBar.smali and search for "-0x100". There will be two lines; change them from

Code:
const/high16 v15, -0x100
to
Code:
const/high16 v15, 0x0
there are two lines for -0x100, change theme both

2- Now go to framework-res/res/values/ folder and open drawables.xml and look for this line:

Code:
<item type="drawable" name="notification_item_background_color">#ff000000</item>
I changed it to
Code:
<item type="drawable" name="notification_item_background_color">#ffececec</item>

This was for the background part.

Notification Text color

B- So now we need to change the notification's text color that should be done in framework:
Just search for StatusBar in Style.xml and change it as you like. Following are my changes:

Code:
    <style name="TextAppearance.StatusBar.Title" parent="@style/TextAppearance.StatusBar">
        <item name="textStyle">bold</item>
    </style>
    <style name="TextAppearance.StatusBar.Icon" parent="@style/TextAppearance.StatusBar" />
    <style name="TextAppearance.StatusBar.EventContent" parent="@style/TextAppearance.StatusBar.EventContent">
        <item name="textSize">15.0dip</item>
        <item name="textColor">#ff2e2e2e</item>
    </style>
    <style name="TextAppearance.StatusBar.EventContent.Title" parent="@style/TextAppearance.StatusBar.EventContent.Title">
        <item name="textSize">20.0dip</item>
        <item name="textStyle">normal</item>
        <item name="textColor">##ff000000</item>
    </style>
    <style name="Theme.WithActionBar" parent="@style/Theme">
        <item name="windowActionBar">true</item>
The first #ff2e2e2e is for subtext's color (second row of notification)

Code:
    <style name="TextAppearance.StatusBar.Ticker" parent="@style/TextAppearance.StatusBar" />
    <style name="TextAppearance.StatusBar.EventContent.Line2" parent="@style/TextAppearance.StatusBar.EventContent">
        <item name="textSize">@dimen/notification_subtext_size</item>
    </style>
    <style name="TextAppearance.StatusBar.EventContent.Info" parent="@style/TextAppearance.StatusBar.EventContent">
        <item name="textSize">@dimen/notification_subtext_size</item>
        <item name="textColor">#ff2e2e2e</item>
    </style>
    <style name="TextAppearance.StatusBar.EventContent.Time" parent="@style/TextAppearance.StatusBar.EventContent.Time">
        <item name="textSize">15.0dip</item>
        <item name="textStyle">normal</item>
        <item name="textColor">#ff000000</item>
    </style>
    <style name="TextAppearance.StatusBar.EventContent.Emphasis" parent="@style/TextAppearance.StatusBar.EventContent">
        <item name="textColor">##ff2e2e2e</item>
    </style>
    <style name="TextAppearance.Small.CalendarViewWeekDayView" parent="@style/TextAppearance.Small">
        <item name="textStyle">bold</item>

Code:
    <style name="TextAppearance.DeviceDefault.StatusBar.EventContent.Title" parent="@style/TextAppearance.StatusBar.EventContent.Title">
        <item name="textSize">20.0dip</item>
        <item name="textStyle">normal</item>
        <item name="textColor">##ff000000</item>
So for these changes would result in this theme (only notification part)

Last edited by kmokhtar79; 26th June 2013 at 05:26 PM.
The Following 7 Users Say Thank You to kmokhtar79 For This Useful Post: [ View ]
22nd March 2013, 01:31 PM   |  #3  
cheyenne's Avatar
Senior Member
Thanks Meter: 57
 
363 posts
Join Date:Joined: Sep 2006
Donate to Me
More
Is it only for deodex ROM?
It'd be great to make it for Odex ROM too
22nd March 2013, 01:41 PM   |  #4  
kmokhtar79's Avatar
OP Senior Member
Flag Beijing
Thanks Meter: 5,725
 
2,241 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by cheyenne

Is it only for deodex ROM?
It'd be great to make it for Odex ROM too

You can make a backup and then rename/delete .odex file and then flash. This is an experimental way which I have been told in Arman theme and seems working.
The Following User Says Thank You to kmokhtar79 For This Useful Post: [ View ]
22nd March 2013, 02:07 PM   |  #5  
zai89's Avatar
Senior Member
Flag 515′N 1170′E Sabah
Thanks Meter: 1,069
 
1,040 posts
Join Date:Joined: Jul 2012
More
Re: [Mod]JB LSZ_Lock screen and Recent Apps on notification Panel
OT, what font do u use on screenshot?

Sent from my GT-N7000 using Tapatalk 2
22nd March 2013, 02:19 PM   |  #6  
kmokhtar79's Avatar
OP Senior Member
Flag Beijing
Thanks Meter: 5,725
 
2,241 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Re: [Mod]JB LSZ_Lock screen and Recent Apps on notification Panel
Quote:
Originally Posted by zai89

OT, what font do u use on screenshot?

Sent from my GT-N7000 using Tapatalk 2

It's called Caviar. So the font was more attention drawer than the mod

Sent from my GT-N7000 using Tapatalk HD
The Following User Says Thank You to kmokhtar79 For This Useful Post: [ View ]
23rd March 2013, 03:54 AM   |  #7  
Vibo7's Avatar
Junior Member
Flag Guayaquil
Thanks Meter: 2
 
25 posts
Join Date:Joined: Mar 2013
More
Re: [Mod]JB LSZ_Lock screen and Recent Apps on notification Panel
Quote:
Originally Posted by kmokhtar79

This mod is made base on LSZ base rom, about other frameworks I haven't test this zip may work or not. If want to try please make a backup first.

- Added Lock Screen and Recent Apps on notification panel





Download

Preload, System

Thanks! One question, what type letter using?

Enviado desde mi GT-N7000 usando Tapatalk 2
23rd March 2013, 05:31 AM   |  #8  
kmokhtar79's Avatar
OP Senior Member
Flag Beijing
Thanks Meter: 5,725
 
2,241 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by Vibo7

Thanks! One question, what type letter using?

Enviado desde mi GT-N7000 usando Tapatalk 2

Look at one post above. Caviar
23rd March 2013, 04:35 PM   |  #9  
Member
Flag Bangalore
Thanks Meter: 27
 
70 posts
Join Date:Joined: Jul 2009
More
Any chance we can get just the lock screen toggle on an existing status bar? I am running ultimate rom v5.2 with alliance mods for the various customisations. Only thing missing on that is a lock screen toggle like yours. Any way i can add it to that?

thanks
23rd March 2013, 05:14 PM   |  #10  
Vibo7's Avatar
Junior Member
Flag Guayaquil
Thanks Meter: 2
 
25 posts
Join Date:Joined: Mar 2013
More
Quote:
Originally Posted by kmokhtar79

Look at one post above. Caviar

Thanks friend, sorry, i missed.
Last edited by Vibo7; 23rd March 2013 at 05:18 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes