Or Continue to Thread: [Guide]How To add Brightness s…
Find Your Device:
25th April 2014, 02:49 PM   |  #1  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Hii,

Now I Tells You How To add Brightness slider + Speed Meter.

This Guide Only For Galaxay Y Duos [GT-S6102]


First Decompile SystemUI.apk

Read My Post On XDA About Recompiling,Decompiling Apk

After recompiling

Add These Files here Which i Given Below




PHP Code:
 SystemUI/smali/com/lidroid/systemui/quickpanel/BrightnessSlider$BrightnessSettingsObserver

 SystemUI
/smali/com/lidroid/systemui/quickpanel/BrightnessSlider.smali


 SystemUI
/smali/com/android/systemui/statusbar/SlideBrightness$1.smali

 SystemUI
/smali/com/android/systemui/statusbar/SlideBrightness$2.smali

 SystemUI
/smali/com/android/systemui/statusbar/SlideBrightness.smali

 SystemUI
/smali/com/android/systemui/statusbar/DataTrafik$1.smali

 SystemUI
/smali/com/android/systemui/statusbar/DataTrafik$2.smali

 SystemUI
/smali/com/android/systemui/statusbar/DataTrafik.smali 

Smali Portion Done...!!!

Move Next __>>>



PHP Code:
 Add brightness_seekbar.xml Here

 SystemUI
/res/drawable/brightness_seekbar.xml 


PHP Code:
 Add These Pngs Here

 SystemUI
/res/drawable-ldpi/brightness_bg

 SystemUI
/res/drawable-ldpi/quickpanel_brightness_icon 


PHP Code:
 Add qp_brightness.xml quickpanel_brightness_settings.xml here

 SystemUI
/res/layout/qp_brightness.xml

 SystemUI
/res/layout/quickpanel_brightness_settings.xml 


You Done...!!! Now Edit xml files

PHP Code:
Open This xml  status_bar_expanded.xml

 SystemUI
/res/layout/status_bar_expanded.xml 

*---------------------------------------------------------------------------------------------*


"Add This Code" Below Scroll View

*---------------------------------------------------------------------------------------------*
PHP Code:
<LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
     <include 
layout="@layout/qp_brightness" />
 </
LinearLayout

*---------------------------------------------------------------------------------------------*


After Adding it Looks Like:-


PHP Code:
<?xml version="1.0" encoding="utf-8"?>
 <com.android.systemui.statusbar.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
        <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:overScrollMode="ifContentScrolls">
            <com.android.systemui.statusbar.NotificationLinearLayout android:orientation="vertical" android:id="@id/notificationLinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
                    <com.android.systemui.statusbar.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:onClick="settingsButton" />
                    <com.android.systemui.statusbar.RecentAppButton android:textSize="10.0dip" android:id="@id/recent_app_button" android:background="@drawable/btn_recent_app" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:layout_toLeftOf="@id/clear_all_button" />
                    <Button android:textSize="15.0sp" android:id="@id/clear_all_button" android:layout_width="48.0dip" android:layout_height="48.0dip" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" style="@style/Clear.Buttons" />
                </LinearLayout>
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
                    <include layout="@layout/qp_brightness" />
                </LinearLayout>
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false" />
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/noNotificationsTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_no_notifications_title" />
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/ongoingTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_ongoing_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/ongoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/latestTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_latest_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            </com.android.systemui.statusbar.NotificationLinearLayout>
        </ScrollView>
        <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
    </FrameLayout>
</com.android.systemui.statusbar.ExpandedView>



*---------------------------------------------------------------------------------------------*

PHP Code:
In Same Folder "layout" folder open This xml file


 SystemUI
/res/layout/status_bar_expanded_dual_sim.xml 
*---------------------------------------------------------------------------------------------*


Add This Code:-

PHP Code:
<LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
      <include 
layout="@layout/qp_brightness" />
 </
LinearLayout

*---------------------------------------------------------------------------------------------*


Below this line:-

PHP Code:
</com.android.systemui.statusbar.quickpanel.QuickSim2ButtonLayout>
 </
LinearLayout
*---------------------------------------------------------------------------------------------*

After Adding it look



PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
        <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:overScrollMode="ifContentScrolls">
            <com.android.systemui.statusbar.NotificationLinearLayout android:orientation="vertical" android:id="@id/notificationLinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
                    <com.android.systemui.statusbar.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
                    <ImageView android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:onClick="settingsButton" />
                    <com.android.systemui.statusbar.RecentAppButton android:textSize="10.0dip" android:id="@id/recent_app_button" android:background="@drawable/btn_recent_app" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center" android:layout_toLeftOf="@id/clear_all_button" />
                    <Button android:textSize="15.0sp" android:id="@id/clear_all_button" android:layout_width="48.0dip" android:layout_height="48.0dip" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" style="@style/Clear.Buttons" />
                </LinearLayout>
                <LinearLayout android:orientation="horizontal" android:id="@id/quickpanel_dualsim_layout" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="46.0px">
                    <com.android.systemui.statusbar.quickpanel.QuickSim1ButtonLayout android:gravity="center_horizontal" android:layout_gravity="center_vertical" android:orientation="vertical" android:id="@id/QuickSim1ButtonLayout" android:background="@drawable/quickpanel_simbutton_selector_bg" android:focusable="true" android:clickable="true" android:layout_width="84.0px" android:layout_height="25.0px" android:layout_marginLeft="28.0px" android:layout_marginRight="7.5px" android:layout_weight="1.0">
                        <ImageView android:id="@id/QuickSim1ButtonImage" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="0.0dip" android:src="@drawable/quick_btn_g_1" />
                        <TextView android:textSize="7.0px" android:textColor="#ff33b5e5" android:gravity="center" android:id="@id/QuickSim1ButtonText" android:paddingBottom="2.0px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/quickpanel_sim1_text" />
                    </com.android.systemui.statusbar.quickpanel.QuickSim1ButtonLayout>
                    <com.android.systemui.statusbar.quickpanel.QuickSim2ButtonLayout android:gravity="center_horizontal" android:layout_gravity="center_vertical" android:orientation="vertical" android:id="@id/QuickSim2ButtonLayout" android:background="@drawable/quickpanel_simbutton_selector_bg" android:focusable="true" android:clickable="true" android:layout_width="84.0px" android:layout_height="25.0px" android:layout_marginLeft="7.5px" android:layout_marginRight="28.0px" android:layout_weight="1.0">
                        <ImageView android:id="@id/QuickSim2ButtonImage" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="0.0dip" android:src="@drawable/quick_btn_g_2" />
                        <TextView android:textSize="7.0px" android:textColor="#ff33b5e5" android:gravity="center" android:id="@id/QuickSim2ButtonText" android:paddingBottom="2.0px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/quickpanel_sim2_text" />
                    </com.android.systemui.statusbar.quickpanel.QuickSim2ButtonLayout>
                </LinearLayout>
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
                    <include layout="@layout/qp_brightness" />
                </LinearLayout>
                <LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false">
                    <LinearLayout android:layout_gravity="center_vertical" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0">
                        <LinearLayout android:orientation="horizontal" android:id="@id/carrierLabel1" android:layout_width="wrap_content" android:layout_height="wrap_content">
                            <ImageView android:id="@id/carrierLabel1Image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="3.0dip" android:src="@drawable/stat_sim_gsm_1" />
                            <com.android.systemui.statusbar.CarrierLabel android:textSize="14.659973dip" android:textColor="#ffffffff" android:paddingBottom="1.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />
                        </LinearLayout>
                        <LinearLayout android:orientation="horizontal" android:id="@id/carrierLabel2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="1.0dip">
                            <ImageView android:id="@id/carrierLabel2Image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="3.0dip" android:src="@drawable/stat_sim_gsm_2" />
                            <com.android.systemui.statusbar.CarrierLabel2 android:textSize="14.659973dip" android:textColor="#ffffffff" android:paddingBottom="1.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_marginTop="1.0dip" android:layout_weight="1.0" />
                        </LinearLayout>
                    </LinearLayout>
                </LinearLayout>
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/noNotificationsTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_no_notifications_title" />
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/ongoingTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_ongoing_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/ongoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                <TextView android:textSize="17.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/latestTitle" android:background="#ff293945" android:paddingLeft="5.0dip" android:layout_width="fill_parent" android:layout_height="26.0dip" android:text="@string/status_bar_latest_events_title" />
                <LinearLayout android:orientation="vertical" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            </com.android.systemui.statusbar.NotificationLinearLayout>
        </ScrollView>
        <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
    </FrameLayout>
</com.android.systemui.statusbar.ExpandedView>




*---------------------------------------------------------------------------------------------*


PHP Code:
Now Open this xml files its in layout folder:-


 
SystemUI/res/layout/qp_brightness.xml


 open it
...!!! 
*---------------------------------------------------------------------------------------------*


Add This Line:-

PHP Code:
<com.android.systemui.statusbar.DataTrafik android:textSize="14.0sp" android:textStyle="bold" android:textColor="#ffffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:singleLine="true" android:shadowColor="#00000000" android:shadowDx="0.0" android:shadowDy="1.0" android:shadowRadius="1.0" /> 
*---------------------------------------------------------------------------------------------*


Above this line:-

PHP Code:
<ImageView android:gravity="center_vertical" android:id="@*android:id/icon" android:layout_width="40.0dip" android:layout_height="40.0dip" android:layout_marginLeft="4.0dip" android:src="@drawable/quickpanel_brightness_icon" /> 
*---------------------------------------------------------------------------------------------*


After Adding it Looks Like:-


PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<com.lidroid.systemui.quickpanel.BrightnessSlider android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content"
  xmlns:android="http://schemas.android.com/apk/res/android">
   <com.android.systemui.statusbar.DataTrafik android:textSize="14.0sp" android:textStyle="bold" android:textColor="#ffffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:singleLine="true" android:shadowColor="#00000000" android:shadowDx="0.0" android:shadowDy="1.0" android:shadowRadius="1.0" />
    <ImageView android:gravity="center_vertical" android:id="@*android:id/icon" android:layout_width="40.0dip" android:layout_height="40.0dip" android:layout_marginLeft="4.0dip" android:src="@drawable/quickpanel_brightness_icon" />
    <SeekBar android:tag="slider" android:paddingLeft="10.0dip" android:paddingRight="10.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10.0dip" android:layout_marginRight="15.0dip" android:layout_weight="1.0" />
</com.lidroid.systemui.quickpanel.BrightnessSlider>

*---------------------------------------------------------------------------------------------*


PHP Code:
Add This Code in ids.xml

 SystemUI
/res/values/ids.xml 
*--------------------------------------------------------------------------------------------

PHP Code:
 Add This Code Above </resourcesThis

 
<item type="id" name="automatic">false</item>
 <
item type="id" name="title">false</item>
 <
item type="id" name="brightness">false</item
*--------------------------------------------------------------------------------------------

After Adding it looks:-


PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="id" name="dischargetext">false</item>
    <item type="id" name="scroll">false</item>
    <item type="id" name="padding">false</item>
    <item type="id" name="subtitle">false</item>
    <item type="id" name="level_percent">false</item>
    <item type="id" name="image">false</item>
    <item type="id" name="quickpanel_quick_settings">false</item>
    <item type="id" name="quickpanel_wifi_btn_icon">false</item>
    <item type="id" name="quickpanel_wifi_btn_text">false</item>
    <item type="id" name="quickpanel_bt_btn_icon">false</item>
    <item type="id" name="quickpanel_bt_btn_text">false</item>
    <item type="id" name="quickpanel_gps_btn_icon">false</item>
    <item type="id" name="quickpanel_gps_btn_text">false</item>
    <item type="id" name="quickpanel_sound_btn_icon">false</item>
    <item type="id" name="quickpanel_sound_btn_text">false</item>
    <item type="id" name="quickpanel_rotation_btn_icon">false</item>
    <item type="id" name="quickpanel_rotation_btn_text">false</item>
    <item type="id" name="quickpanel_data_btn_icon">false</item>
    <item type="id" name="quickpanel_data_btn_text">false</item>
    <item type="id" name="icons">false</item>
    <item type="id" name="notificationIcons">false</item>
    <item type="id" name="statusIcons">false</item>
    <item type="id" name="ticker">false</item>
    <item type="id" name="tickerIcon">false</item>
    <item type="id" name="tickerText">false</item>
    <item type="id" name="date">false</item>
    <item type="id" name="status_bar_call_ongoing_text">false</item>
    <item type="id" name="status_bar_call_ongoing_duration">false</item>
    <item type="id" name="notificationLinearLayout">false</item>
    <item type="id" name="clear_all_button">false</item>
    <item type="id" name="noNotificationsTitle">false</item>
    <item type="id" name="ongoingTitle">false</item>
    <item type="id" name="ongoingItems">false</item>
    <item type="id" name="latestTitle">false</item>
    <item type="id" name="latestItems">false</item>
    <item type="id" name="quickpanel_dualsim_layout">false</item>
    <item type="id" name="QuickSim1ButtonLayout">false</item>
    <item type="id" name="QuickSim1ButtonImage">false</item>
    <item type="id" name="QuickSim1ButtonText">false</item>
    <item type="id" name="QuickSim2ButtonLayout">false</item>
    <item type="id" name="QuickSim2ButtonImage">false</item>
    <item type="id" name="QuickSim2ButtonText">false</item>
    <item type="id" name="carrierLabel1">false</item>
    <item type="id" name="carrierLabel1Image">false</item>
    <item type="id" name="carrierLabel2">false</item>
    <item type="id" name="carrierLabel2Image">false</item>
    <item type="id" name="number">false</item>
    <item type="id" name="content">false</item>
    <item type="id" name="close">false</item>
    <item type="id" name="recent_app_button">false</item>
    <item type="id" name="automatic">false</item>
    <item type="id" name="title">false</item>
    <item type="id" name="brightness">false</item>
</resources>

*--------------------------------------------------------------------------------------------

PHP Code:
Add This Code in string.xml

 SystemUI
/res/values/string.xml 
*--------------------------------------------------------------------------------------------

PHP Code:
Add This Code Above </resourcesThis


 
<string name="brightness_settings_automatic" />
 <
string name="brightness_settings_title" /> 

*--------------------------------------------------------------------------------------------

After Adding it looks:-


PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_label">Status Bar</string>
    <string name="status_bar_clear_all_button">Clear</string>
    <string name="status_bar_no_notifications_title">No notifications</string>
    <string name="status_bar_ongoing_events_title">Ongoing</string>
    <string name="status_bar_latest_events_title">Notifications</string>
    <string name="battery_low_title">Please connect charger</string>
    <string name="battery_low_subtitle">The battery is getting low:</string>
    <string name="battery_low_percent_format">%d%% or less remaining</string>
    <string name="battery_low_why">Battery use</string>
    <string name="usb_accessory_permission_prompt">Allow the application %1$s to access the USB accessory?</string>
    <string name="usb_device_confirm_prompt">Open %1$s when this USB device is connected?</string>
    <string name="usb_accessory_confirm_prompt">Open %1$s when this USB accessory is connected?</string>
    <string name="usb_accessory_uri_prompt">No installed applications work with this USB accessory. Learn more about this accessory at %1$s</string>
    <string name="title_usb_accessory">USB accessory</string>
    <string name="label_view">View</string>
    <string name="always_use_accessory">Use by default for this USB accessory</string>
    <string name="quickpanel_wifi_text">Wi-Fi</string>
    <string name="quickpanel_bluetooth_text">B/T</string>
    <string name="quickpanel_gps_text">GPS</string>
    <string name="quickpanel_sound_text">Sound</string>
    <string name="quickpanel_sound_vibration_text">"Sound
Vibration"</string>
    <string name="quickpanel_silent_text">Silent</string>
    <string name="quickpanel_vibration_text">Vibration</string>
    <string name="quickpanel_rotation_text">"Auto
rotation"</string>
    <string name="quickpanel_error_text">Error</string>
    <string name="quickpanel_dc_text">Data</string>
    <string name="quickpanel_dc_on">"Turning
On"</string>
    <string name="quickpanel_dc_off">"Turning
Off"</string>
    <string name="capital_on">ON</string>
    <string name="capital_off">OFF</string>
    <string name="lowbattery">Battery low. Recharge phone soon to keep using</string>
    <string name="critical_lowbattery">Battery critically low. Plug phone in now to keep using</string>
    <string name="dischargetitle">Info</string>
    <string name="dischargebattery">Charging paused. Battery temperature too high or too low</string>
    <string name="fullchargetitle">Info</string>
    <string name="fullchargebattery">"Battery fully charged.
Unplug charger"</string>
    <string name="wifi_in_airplane_mode">In Flight mode</string>
    <string name="quickpanel_sim1_text">SIM 1</string>
    <string name="quickpanel_sim2_text">SIM 2</string>
    <string name="brightness_settings_automatic" />
    <string name="brightness_settings_title" />
</resources>
Files Link:- https://www.dropbox.com/s/n37cfrs1i9...40kat.zip?dl=0
Last edited by kartik verma; 18th September 2014 at 03:06 PM.
The Following User Says Thank You to kartik verma For This Useful Post: [ View ]