[2-in-1 TUT][MOD][PORT] Swipe To Remove Notification for Froyo [Updated - 24/2/13] - Galaxy 3 Themes and Apps

Swipe-to-remove Notification for Froyo​
Well I finally figure it all out. It looks simple, but it took me nearly two months to finish this. This should work in other Froyo phones as well.
Disclaimer: I take no responsibility whatsoever. This is based on stock XXJPS framework, but it should also work with others.
To developers and themers, you are free to use this in your ROM, but please post a link to this thread and give proper credits to me and hansip87.
Credits/Thanks:
Big thanks to hansip87 for the original guide and for helping me.
Big thanks to marcellusbe for porting CM6. Can't make this without those codes.
Thanks to Arjav23 and kyrillos13 for some help.
Step 1
Click to expand...
Click to collapse
a. Decompile "framework-res.apk"
b. Download "swipe-framework-res.zip" and extract those two files to "/res/anim/"
c. Open "/res/layout/status_bar_latest_event.xml"
Now change the "<LinearLayout" to "<com.android.server.status.LatestItemContainer" like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="65.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.server.status.LatestItemView android:id="@id/content" android:background="@drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" />
<View android:background="@drawable/divider_horizontal_bright" android:layout_width="fill_parent" android:layout_height="1.0sp" />
</LinearLayout>
to this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<[B]com.android.server.status.LatestItemContainer [/B]android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="65.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.server.status.LatestItemView android:id="@id/content" android:background="@drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" />
<View android:background="@drawable/divider_horizontal_bright" android:layout_width="fill_parent" android:layout_height="1.0sp" />
</[B]com.android.server.status.LatestItemContainer[/B]>
d. Now the IDs for "slide_out_left_basic.xml" and "slide_out_right_basic.xml", so basically, compile it and then decompile it again.
e. Open "/res/value/public.xml" in Notepad++ and you should get something like this:
Code:
<public type="anim" name="slide_out_left_basic" id="[B]0x010a0048[/B]" />
<public type="anim" name="slide_out_right_basic" id="[B]0x010a0049[/B]" />
You may have a different ID depending on the ROM you're using, so just keep a note of it.
Step 2
Click to expand...
Click to collapse
a. Decompile "services.jar"
b. Download "swipe-services.zip" and extract all three files to "/out/com/android/server/status/"
(If you already have the JB mods installed, then change "StatusBarService$41.smali" to "StatusBarService$42.smali".)
c. Open "LatestItemContainer$1.smali" and find this line:
Code:
.line 47
const v1,[B] 0x10a0049[/B]
(This code refers to the "slide_out_right_basic.xml" ID, so if you have a different one, just change it)
And this line:
Code:
.line 49
:cond_3c
const v1, [B]0x10a0048[/B]
(This one refers to the "slide_out_left_basic.xml" ID, so if you have a different one, just change it)
Save and close.
d. Open "/out/com/android/server/status/StatusBarService.smali"
Find this line:
Code:
invoke-virtual {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
and below "move-result-object v17", remove these following line:
Code:
.line 1346
.local v17, row:Landroid/view/View;
then paste these lines:
Code:
[B] check-cast v17, Lcom/android/server/status/LatestItemContainer;
.line 1346
.local v17, row:Lcom/android/server/status/LatestItemContainer;
iget-boolean v4, v15, Lcom/android/server/status/NotificationData;->clearable:Z
if-eqz v4, :cond_ae
.line 1600
new-instance v4, Lcom/android/server/status/StatusBarService$41;
move-object v0, v4
move-object/from16 v1, p0
move-object v2, v15
invoke-direct {v0, v1, v2}, Lcom/android/server/status/StatusBarService$41;-><init>(Lcom/android/server/status/StatusBarService;Lcom/android/server/status/NotificationData;)V
move-object/from16 v0, v17
move-object v1, v4
invoke-virtual {v0, v1}, Lcom/android/server/status/LatestItemContainer;->setOnSwipeCallback(Ljava/lang/Runnable;)V
.line 1606
:cond_ae[/B]
const v4, 0x1020002
move-object/from16 v0, v17
move v1, v4
[B]invoke-virtual {v0, v1}, Lcom/android/server/status/LatestItemContainer;->findViewById(I)Landroid/view/View;[/B]
(remember, "StatusBarService$41")
Find this line:
Code:
invoke-virtual {v0, v1}, Landroid/view/View;->setDrawingCacheEnabled(Z)V
change to:
Code:
invoke-virtual {v0, v1}, Lcom/android/server/status/LatestItemContainer;->setDrawingCacheEnabled(Z)V
e. Open "/out/com/android/server/status/StatusBarService$NotificationCallbacks.smali" and add this code above "onNotificationClick"
Code:
.method public abstract onNotificationClear(Ljava/lang/String;Ljava/lang/String;I)V
.end method
f. Open "/out/com/android/server/NotificationManagerService$1.smali" and also add these codes above "onNotificationClick"
Code:
.method public onNotificationClear(Ljava/lang/String;Ljava/lang/String;I)V
.registers 10
.parameter "pkg"
.parameter "tag"
.parameter "id"
.prologue
.line 346
iget-object v0, p0, Lcom/android/server/NotificationManagerService$1;->this$0:Lcom/android/server/NotificationManagerService;
const/4 v4, 0x0
const/16 v5, 0x40
move-object v1, p1
move-object v2, p2
move v3, p3
#calls: Lcom/android/server/NotificationManagerService;->cancelNotification(Ljava/lang/String;Ljava/lang/String;III)V
invoke-static/range {v0 .. v5}, Lcom/android/server/NotificationManagerService;->access$500(Lcom/android/server/NotificationManagerService;Ljava/lang/String;Ljava/lang/String;III)V
.line 347
return-void
.end method
g. Save everything, compile, and you're finished
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
NOTE (if you have JB mod installed): Tricky part is the smali numbering. You can't only change the file number, you also need to change the codes inside StatusBarService.smali to refer to it. Remember, $41 to $42. DO NOT GET BOTH MIXED UP!

JellyBean Styled Notification Drawer​
Disclaimer: I take no responsibility whatsoever. Please note that this tutorial is for "deodex-ed" frameworks only. If your current ROM is "odex-ed", then deodex it using this method or just grab a copy of a deodex-ed theme. And if you want this in a custom ROM you like, then I suggest you to ask the developer to apply these features themselves.
To developers and themers, you are free to use this in your ROM or Theme, but please give proper credits.
Credits/Thanks:
AChep & petrukgrinder for developing and creating a guide.
Jason-EX (me) for changing the code for Galaxy 3.
Requirement:
APK Multi-Tool for de-compiling and compiling APKs.
Smali/Baksmali for de-compiling and compiling JARs.
Notepad++ for editing XML and SMALI files.
Adobe Photoshop or GIMP for editing framework images (optional).
A copy of "twframework-res.apk" and "services.jar" from "/system/framework/".
And a backup copy of those two framework files.
How to de-compile and compile APK and JAR files
Click to expand...
Click to collapse
For APKs,
1. Download APK Multi-Tool from here. (Skip this part if you already have "APK Manager" or APKTool".)
2. Extract and run "Setup.exe". (Skip this part if you already have "APK Manager" or APKTool".)
3. Place the file needed for this mod in "place-apk-here-for-modding".
4. Decompile it (no.9), and start editing files needed.
5. After that, set compression level to "0" (no.21), then compile (no.11).
For JARs,
1. Download Smali/Baksmali from here.
2. Cut and paste them to a directory that is easy to get access (I recommend "C:/").
3. Place the required file to be edit to the same directory.
4. Now type in command prompt: "cd\" (enter) "cd /directory/".
5. To de-compile, type: "java -jar baksmali.jar -x for-modding.jar -o out".
6. To compile, type: "java -jar smali.jar -x out -o classes.dex".
7. Then replace the classes.dex with the original JAR file that you want to edit.
Adding Time and Date
Click to expand...
Click to collapse
1. De-compile "services.jar".
2. Download "JB-time-date.zip" from attachment, then extract both files to "/out/com/android/server/status/".
3. Compile "services.jar".
4. De-compile "twframework-res.apk" then open "twframework-res/res/layout/status_bar_expanded.xml".
Add this code above the first "<LinearLayout"
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
6. Save and compile "twframework-res.apk"
Adding Clear button
Click to expand...
Click to collapse
1. Download "JB-clear-btn.zip" from attachment below.
2. Decompile "twframework-res.apk"
3. Extract "JB-clear-btn.zip" and copy those two images to "/res/drawable-ldpi/"
4. Copy "btn_clear.xml" to "/res/drawable"
5. Open "/res/layout/status_bar_expanded.xml"
Find this code added from the Time and Date:
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
Then add this code:
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
[B]<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
</LinearLayout>[/B]
</RelativeLayout>
And remove this code:
Code:
<Button android:textSize="14.0sp" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginTop="5.0dip" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" style="?android:attr/buttonStyleSmall" />
6. Open "/res/value/styles.xml"
Paste this code at the end of the file:
Code:
<style name="Btn.Clear" parent="@*android:style/Widget.Button">
<item name="android:textColor">#ffffffff</item>
<item name="android:gravity">center</item>
<item name="android:background">@drawable/btn_clear</item>
<item name="android:clickable">true</item>
</style>
7. Save everything and compile "twframework-res.apk"
Adding Settings shortcut button
Click to expand...
Click to collapse
1. Download "JB-settings-btn.zip" from attachment below.
2. Decompile "twframework-res.apk" and open "/res/layout/status_bar_expanded.xml"
Find the code added from Clear button
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
</LinearLayout>
</RelativeLayout>
Then add these two lines:
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@*android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
[B]<View android:visibility="invisible" android:layout_width="1.0dip" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/settings_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" />[/B]
</LinearLayout>
</RelativeLayout>
3. Open "/res/value/ids.xml" and add this code at the end of the file:
Code:
<item type="id" name="settings_button">false</item>
4. Open "/res/value/strings.xml" and add this code at the end of the file:
Code:
<string name="accessibility_settings_button">System settings.</string>
4. Extract the two images from "JB-settings-btn.zip" and paste it in "/res/drawable-ldpi/", then extract "ic_notify_quicksettings.xml" and paste it in "/res/drawable/".
5. Now you'll have to compile "twframework-res.apk" and decompile it again
6. Open "/res/value/public.xml" and find this line:
Code:
<public type="id" name="settings_button" id="[B]0x02040061[/B]" />
(Keep a note of the ID value)
7. Decompile "services.jar" and open "/out/com/android/server/status/StatusBarServices.smali"
8. Find this line:
Code:
.field mScrollView:Landroid/widget/ScrollView;
Then paste these two lines below:
Code:
.field mSettingsBut:Landroid/view/View;
.field private mSettingsButListener:Landroid/view/View$OnClickListener;
9. Find this line:
Code:
iput-object v0, p0, Lcom/android/server/status/StatusBarService;->mStopTracing:Ljava/lang/Runnable;
Then paste these lines below:
Code:
.line 4000
new-instance v0, Lcom/android/server/status/StatusBarService$41;
invoke-direct {v0, p0}, Lcom/android/server/status/StatusBarService$41;-><init>(Lcom/android/server/status/StatusBarService;)V
iput-object v0, p0, Lcom/android/server/status/StatusBarService;->mSettingsButListener:Landroid/view/View$OnClickListener;
10. Find this line:
Code:
iput v7, p0, Lcom/android/server/status/StatusBarService;->mEdgeBorder:I
Then paste these lines below:
Code:
.line 611
const v7, 0x2040061
invoke-virtual {v1, v7}, Lcom/android/server/status/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v7
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSettingsBut:Landroid/view/View;
.line 612
iget-object v7, p0, Lcom/android/server/status/StatusBarService;->mSettingsBut:Landroid/view/View;
iget-object v8, p0, Lcom/android/server/status/StatusBarService;->mSettingsButListener:Landroid/view/View$OnClickListener;
invoke-virtual {v7, v8}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
(Change the ID if you got a different one)
Code:
.line 611
const v7, [B]0x2040061[/B]
11. Now extract "StatusBarServices$41" from "JB-settings-btn" and paste it in "/out/com/android/server/status/"
12. Compile both "twframework-res.apk" and "services.jar"
Hiding the Status Bar when expanded
Click to expand...
Click to collapse
1. Grab a "framework-res.apk" and de-compile it
2. Go to "/res/layout/status_bar.xml"
3. Find the "DateView" code at the bottom of the file:
Code:
<com.android.server.status.DateView
Remove the whole line and replace it with this code:
Code:
<com.android.server.status.DateView android:textSize="0.00999999dip" android:textStyle="normal" android:textColor="#ff000000" android:gravity="center" android:id="@id/date" android:background="@color/black" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" />

Adding Carrier Label
Click to expand...
Click to collapse
1. Decompile "services.jar"
2. Download "JB-carrier-label.zip" from attachment and extract those files to "/out/com/android/server/status/"
3. Save and compile "services.jar"
4. Decompile "twframework-res.apk" and open "/res/layout/status_bar_tracking.xml"
5. Find this line:
Code:
<com.android.server.status.CloseDragHandle android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="wrap_content">
Then paste this line below:
Code:
<com.android.server.status.CarrierLabel android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center_horizontal" android:background="@drawable/status_bar_background" android:paddingBottom="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" />
6. Then open "/res/layout/status_bar_expanded.xml" and find this code:
Code:
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_gravity="center_vertical" android:orientation="vertical" 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">
<TextView android:textAppearance="?android:textAppearanceMedium" android:textColor="@color/tw_color001" android:layout_gravity="center_vertical" android:id="@id/plmnLabel" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceMedium" android:textColor="@color/tw_color001" android:layout_gravity="center_vertical" android:id="@id/spnLabel" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<Button android:textSize="14.0sp" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginTop="5.0dip" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" style="?android:attr/buttonStyleSmall" />
</LinearLayout>
And change the height of the first "Linear Layout" to "0.0dip":
Code:
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="[B]0.0dip[/B]">
<LinearLayout android:layout_gravity="center_vertical" android:orientation="vertical" 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">
<TextView android:textAppearance="?android:textAppearanceMedium" android:textColor="@color/tw_color001" android:layout_gravity="center_vertical" android:id="@id/plmnLabel" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceMedium" android:textColor="@color/tw_color001" android:layout_gravity="center_vertical" android:id="@id/spnLabel" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<Button android:textSize="14.0sp" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="75.0dip" android:layout_height="wrap_content" android:layout_marginTop="5.0dip" android:layout_marginRight="6.0dip" android:text="@string/status_bar_clear_all_button" style="?android:attr/buttonStyleSmall" />
</LinearLayout>
7. Save and compile "twframework-res.apk"
Making the Tracking Bar clickable
Click to expand...
Click to collapse
1. Decompile "twframework-res.apk" and open "/res/layout/status_bar_tracking.xml"
2. Replace the whole "<ImageView" code with:
Code:
<ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/status_bar_tracker" android:scaleType="fitXY" style="@style/Closer.bar" />
3. Download "JB-pressed-tracker.zip" from attachment below, and extract "status_bar_tracker.xml" to "/res/drawable/"
4. Open "/res/value/styles.xml" and add these code at the end of the file:
Code:
<style name="Closer.bar" parent="@android:style/Widget.Button">
<item name="android:gravity">center</item>
<item name="android:background">@drawable/status_bar_close_on</item>
<item name="android:clickable">true</item>
</style>
5. Now create a image in "/res/drawable-ldpi/" and name it "status_bar_close_pressed.png"
Examples:
"status_bar_close_on.png"
"status_bar_close_pressed.png"
Adding that little space between the notifications
Click to expand...
Click to collapse
1. Decompile "framework-res.apk"
2. Open "/res/layout/status_bar_latest_event.xml"
3. You'll see this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.server.status.LatestItemContainer android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="65.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.server.status.LatestItemView android:id="@id/content" android:background="@drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" />
<View android:background="@drawable/something" android:layout_width="fill_parent" android:layout_height="1.0sp" />
</com.android.server.status.LatestItemContainer>
change it to this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.server.status.LatestItemContainer android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="68.0sp"
xmlns:android="http://schemas.android.com/apk/res/android">
<View android:background="@null" android:layout_width="fill_parent" android:layout_height="4.0sp" />
<com.android.server.status.LatestItemView android:id="@id/content" android:background="@drawable/status_bar_item_background" android:paddingRight="6.0sp" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="64.0sp" />
</com.android.server.status.LatestItemContainer>

Optional Customization
Click to expand...
Click to collapse
Moving Time and Date layout below the Toggle Buttons
Click to expand...
Click to collapse
If you've finish all the guide from the first post, then you should end up with something like this in "/res/layout/status_bar_expanded.xml":
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@*android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
<View android:visibility="invisible" android:layout_width="1.0dip" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/settings_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" />
</LinearLayout>
</RelativeLayout>
<LinearLayout android:orientation="vertical" android:id="@id/quickpanel_container" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:background="@drawable/status_bar_background" android:layout_width="fill_parent" android:layout_height="50.0dip" android:layout_weight="1.0">
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_wifi_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_wifi_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_data_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_data_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_bt_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_bluetooth_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_gps_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_gps_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_sound_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_silent_off" android:layout_weight="1.0" android:soundEffectsEnabled="false" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_orientation_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_orientation_off" android:layout_weight="1.0" />
</LinearLayout>
</LinearLayout>
Now, to move it below the Toggle Buttons, just move the whole "Relative Layout" below the "Linear Layout".
Code:
<LinearLayout android:orientation="vertical" android:id="@id/quickpanel_container" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:background="@drawable/status_bar_background" android:layout_width="fill_parent" android:layout_height="50.0dip" android:layout_weight="1.0">
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_wifi_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_wifi_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_data_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_data_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_bt_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_bluetooth_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_gps_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_gps_off" android:layout_weight="1.0" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_sound_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_silent_off" android:layout_weight="1.0" android:soundEffectsEnabled="false" />
<TextView android:textSize="0.0dip" android:textColor="@color/tw_color002" android:gravity="center" android:id="@id/quickpanel_orientation_btn" android:background="@null" android:paddingTop="1.0dip" android:paddingBottom="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawableTop="@drawable/quick_panel_icon_orientation_off" android:layout_weight="1.0" />
</LinearLayout>
</LinearLayout>
[B] <RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@*android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
<View android:visibility="invisible" android:layout_width="1.0dip" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/settings_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" />
</LinearLayout>
</RelativeLayout>[/B]
Moving the Settings Shortcut Button to the right
Click to expand...
Click to collapse
If you follow the Settings Shortbut Button guide from the first post, you'll end up with this in "/res/layout/status_bar_expanded.xml":
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@*android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
<View android:visibility="invisible" android:layout_width="1.0dip" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/settings_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" />
</LinearLayout>
</RelativeLayout>
To move it to the left (like in JB 4.1.x), just change it like the following:
Code:
<RelativeLayout android:orientation="horizontal" android:background="@color/tw_color002" android:layout_width="fill_parent" android:layout_height="47.0dip">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true">
<com.android.server.status.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
[B]<ImageView android:layout_gravity="center_vertical" android:id="@id/settings_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" /> [/B]
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true">
<Button android:textColor="@*android:color/transparent" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_clear_all_button" style="@style/Btn.Clear" />
</LinearLayout>
</RelativeLayout>
Note: If you're a developer or a themer, you can change it however you like. And if you find more optional tweaks, please feel free to post it here.

could you pls also post a short tut on how to decompile services.jar and twframework-res.apk

Arjav23 said:
could you pls also post a short tut on how to decompile services.jar and twframework-res.apk
Click to expand...
Click to collapse
Done!

Great work jason
Gonna implement this in pkh.

Everything ready

shwetanklal said:
Great work jason
Gonna implement this in pkh.
Click to expand...
Click to collapse
That would be fantastic
you read my mind!

good one jason puru.... nice guide

You Sir - are keeping this community alive! SUPER THANKS!

Update. Some short guides for optional customization

noob here. i am not able to decompile jar. its showing some error.

srgudhka said:
noob here. i am not able to decompile jar. its showing some error.
Click to expand...
Click to collapse
Put your Smali/Baksmali de-compiler and compiler with "services.jar", then in command prompt, type:
cd\
cd /directory/
java -jar baksmali.jar -x services.jar -o out
You shouldn't get any problem.

i did just that... gonna try everything again.
again. it saying unexpected top level exception. zip file services.jar does not contain dex file.

srgudhka said:
i did just that... gonna try everything again.
again. it saying unexpected top level exception. zip file services.jar does not contain dex file.
Click to expand...
Click to collapse
Every services.jar has a classes.dex in it.
EDIT: You have to install Java JDK

Jason-EX said:
Every services.jar has a classes.dex in it.
EDIT: You have to install Java JDK
Click to expand...
Click to collapse
i already had that installed. am getting still same errors.

srgudhka said:
i already had that installed. am getting still same errors.
Click to expand...
Click to collapse
Alright, check this one: http://www.youtube.com/watch?v=9h8kzHTp6fA

there is not classes.dex inside services.jar.

srgudhka said:
there is not classes.dex inside services.jar.
Click to expand...
Click to collapse
which rom are you using? and from where did you get the service.jar?

Related

[TUT] How To Center The Clock On The Statusbar..And Other XML Mods As Well!

*** THIS THREAD IS CLOSING!! ***​
*** CLICK HERE: http://forum.xda-developers.com/general/xda-university/xml-101-xml-modding-easy-t2929816 FOR THE NEW ONE! ***
This is a TICKLEFISH TUTORIAL!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​
How To Center The Clock On The Statusbar
(***BEFORE YOU DO ANY MODDING, MAKE SURE YOU MAKE A NANDROID BACKUP!!***)
Centering the clock on the statusbar is easy. Stopping it from clashing with other things is a little bit harder.
I originally posted here with a long method of fixing this. The problem was, although it worked, it worked for my particular requirements and my particular resolution. Since then I've found a few different ways of doing it and doing it better.
Previously I posted here with four Methods to center the clock. Each one was slightly harder to do than the previous one but was slightly better. After working out the fourth Method, I realised that two of the others were a little redundant and were just causing confusion.
So I've rewritten this post again. Again. This is now the perfect way to center the clock in the statusbar and anybody can do it if they know how. So read on to find out how!
To begin, we need to decompile SystemUI.apk. I would suggest using Tickle My Android, a decompiling tool which has won international acclaim and which can be found at tinyurl.com/ticklemyandroid.
Once you've decompiled the apk, edit res\layout\status_bar.xml
I suggest using Notepad++ for this but you can even use just ordinary Notepad if you're feeling brave.
I'm going to show you to properly center the clock using the xml found in stock Sony Timescape ICS but the principles can be applied to pretty much any rom on any device.
This is the stock code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left|center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Busy, isn't it? It gets worse..the code for KitKat is even busier!
But don't worry. Most of the code we can leave untouched. All we care about is this bit:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left|center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
This is the "@id/icons" LinearLayout, which contains all the icons we normally see on the statusbar, and the first line of the "@id/ticker" LinearLayout, which displays the notification texts.
This sort of setup will be on most, if not all roms. The id might be different, you might have "@id/status_bar_contents" or something similar instead, but it'll still be the same idea.
Found out where those bits are? Well, let's do this thing!
The Simple Method​
This was first pointed out to me by @serajr, so big thanks to him.
The Simple Method is very simple, very quick and is very easy to do if you've never edited Android xml before.
First, we take the clock and put it in the first line before the "@id/icons" LinearLayout. We need to do this because centering anything in a LinearLayout is possible, but a little complicated..as you'll see in the next method!
We'll need to change the width of the space the clock goes into and the positioning within it. Or, in other words, we need to do this:
Code:
[COLOR=red]<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />[/COLOR]
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
So far so good, but there is a problem.
All the contents of the "@id/icons" LinearLayout are pushed out of the top of the screen when a notification comes in..but the clock now isn't part of that, so it won't and we get overlapping.
To fix this, we need to add a background to the "@id/ticker" LinearLayout. This will cover up the clock when there's a new notification and we get no overlapping. We'll use the same background as the normal statusbar, defined at the top of the xml, but you could make it anything if you want to be artistic.
So the new code looks like this:
Code:
[COLOR=red]<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />[/COLOR]
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout [COLOR=red]android:background="@drawable/status_bar_background"[/COLOR] android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
This is very quick to do but it doesn't work with a transparent statusbar, since the background would be then transparent and won't blank out the clock.
So it won't work for KitKat either...
Plus, if you want to be fussy, it's not quite a perfect fix as the clock doesn't actually move and the other icons do which can look a little strange.
So that's why there's a second Method we could use instead..
The Best Method​
This is a bit more involved but is the very best way to center the clock. Or anything else. In fact, it's a brilliant way to arrange your statusbar so you can move anything anywhere.
The Best Method splits the icons LinearLayout into three unique areas, making it very easy to decide what you want where.
What we do is we use this basic layout:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:id="@+id/Status_Bar_Left_Side" android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
[COLOR="Red"]<!-- HERE ARE ALL THE CODES FOR THE ITEMS ON THE LEFT SIDE OF THE STATUSBAR -->[/COLOR]
</LinearLayout>
[COLOR="Red"]<!-- HERE ARE ALL THE CODES FOR THE ITEMS IN THE CENTER OF THE STATUSBAR -->[/COLOR]
<RelativeLayout android:id="@+id/Status_Bar_Right_Side" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:id="@+id/Inside_Status_Bar_Right_Side" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
[COLOR="red"]<!-- HERE ARE ALL THE CODES FOR THE ITEMS ON THE RIGHT SIDE OF THE STATUSBAR -->[/COLOR]
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Make sense? No? Well, don't worry. There is a logic behind all this. Even if it's not obvious.
This Method basically divides the statusbar into just two individual areas. Because those areas have the same 'weight' as each other, they take up exactly the same amount of space as each other. Meaning that whatever goes between those two areas, as long as it doesn't have a weight of 1 or more, will be essentially pushed into the exact center of the statusbar.
So, what we do next is apply this Method to our code from above to create:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
[COLOR="Red"]<LinearLayout android:id="@+id/Status_Bar_Left_Side" android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0"> [/COLOR]
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
[COLOR="red"]</LinearLayout>[/COLOR]
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true"/>
[COLOR="red"]<RelativeLayout android:id="@+id/Status_Bar_Right_Side" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:id="@+id/Inside_Status_Bar_Right_Side" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">[/COLOR]
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
[COLOR="red"]</LinearLayout>
</RelativeLayout>[/COLOR]
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
You might need to adjust some of the attributes on some of the lines to get it all to work but otherwise it's actually all pretty simple.
And that's it. Those are the two methods. Hopefully this will give you a better understanding of what all this code actually means and put you on the road to creating your own mods.
Now you need to save the file and recompile the app. Depending on which tool you're using to recompile, you may need to do something else to let the app work on your phone (this is the "Recompile With Original Signature" option in Tickle My Android, by the way).
Push it or flash it back to your phone...and enjoy!
Too many smilies
Sent from my Walkie-talkie
Great, keep modding !
Try this way:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
[B][COLOR="Red"]<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal|center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />[/COLOR][/B]
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" [B][COLOR="Red"]android:background="@drawable/status_bar_background"[/COLOR][/B] android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
See red changes from original, try it!
Love them, thanks for the Brilliant App .
How to edit xml files?
Please help me. This is how status_bar.xml looks like when I open it in Notepad++. I'm on Windows 7. Why is it so? Should I install some other software?
I couldn't even copy paste the contents here as code
Sudanminipro said:
Please help me. This is how status_bar.xml looks like when I open it in Notepad++. I'm on Windows 7. Why is it so? Should I install some other software?
View attachment 1193378
I couldn't even copy paste the contents here as code
Click to expand...
Click to collapse
This is compiled xml file, you need to decompile systemui.apk with apktool to get human readable xml.
serajr said:
This is compiled xml file, you need to decompile systemui.apk with apktool to get human readable xml.
Click to expand...
Click to collapse
I'm not able to decompile SystemUI.apk. ApkManager gives me the following error
Code:
--------------------------------------------------------------------------
|12-Jul-12 -- 19:56:23.48|
--------------------------------------------------------------------------
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)
Could Not Find E:\mini pro\Apk_Manager_5.0.2\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find E:\mini pro\Apk_Manager_5.0.2\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f0a000e dimen/status_bar_icon_drawing_size, config=-v13
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
Where am I going wrong?
Sudanminipro said:
I'm not able to decompile SystemUI.apk. ApkManager gives me the following error
Code:
--------------------------------------------------------------------------
|12-Jul-12 -- 19:56:23.48|
--------------------------------------------------------------------------
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)
Could Not Find E:\mini pro\Apk_Manager_5.0.2\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find E:\mini pro\Apk_Manager_5.0.2\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f0a000e dimen/status_bar_icon_drawing_size, config=-v13
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
Where am I going wrong?
Click to expand...
Click to collapse
Try this:
http://forum.xda-developers.com/showpost.php?p=28619804&postcount=21
serajr said:
Try this:
http://forum.xda-developers.com/showpost.php?p=28619804&postcount=21
Click to expand...
Click to collapse
Got a different error log this time
Code:
--------------------------------------------------------------------------
|12-Jul-12 -- 20:55:33.19|
--------------------------------------------------------------------------
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)
Could Not Find E:\mini pro\Apk_Manager_5.0.2_ICS_APKTool\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find E:\mini pro\Apk_Manager_5.0.2_ICS_APKTool\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Sudan\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x0108073f
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010a010b
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:59)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:56)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
I have replaced 1.apk in apktool directory with my current framework.
serajr said:
Great, keep modding !
Try this way:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
[B][COLOR=red]<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal|center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />[/COLOR][/B]
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" [B][COLOR=red]android:background="@drawable/status_bar_background"[/COLOR][/B] android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
See red changes from original, try it!
Click to expand...
Click to collapse
Ah, very clever! I was obsessed with keeping the clock in the LinearLayout and didn't even consider this.
Sudanminipro said:
Got a different error log this time
Code:
--------------------------------------------------------------------------
|12-Jul-12 -- 20:55:33.19|
--------------------------------------------------------------------------
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)
Could Not Find E:\mini pro\Apk_Manager_5.0.2_ICS_APKTool\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find E:\mini pro\Apk_Manager_5.0.2_ICS_APKTool\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Sudan\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x0108073f
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010a010b
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:59)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:56)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
I have replaced 1.apk in apktool directory with my current framework.
Click to expand...
Click to collapse
Can you share your framework-res.apk and SystemUI.apk? I'll try them on my setup and see if I can find out what's going wrong.
Ticklefish said:
Ah, very clever! I was obsessed with keeping the clock in the LinearLayout and didn't even consider this.
Click to expand...
Click to collapse
Could you help me with decompiling systemui,apk.. I've posted the error log that I'm getting in the previous post
EDIT: Was finally able to decompile systemui.apk using the method posted HERE . will edit status_bar.xml now. Thanks for the mod. Hope I don't get any errors while compiling:fingers-crossed:
Dear bro Ticklefish or Serajr
can you upload mod of SystemUI.apk for us??
sorry if I request it, coz my laptop had broken so i can't mod apk files for now :crying:
thanks :fingers-crossed:
knightazura said:
Dear bro Ticklefish or Serajr
can you upload mod of SystemUI.apk for us??
sorry if I request it, coz my laptop had broken so i can't mod apk files for now :crying:
thanks :fingers-crossed:
Click to expand...
Click to collapse
Ok... get it!
http://forum.xda-developers.com/showpost.php?p=28519713&postcount=1
knightazura said:
Dear bro Ticklefish or Serajr
can you upload mod of SystemUI.apk for us??
sorry if I request it, coz my laptop had broken so i can't mod apk files for now :crying:
thanks :fingers-crossed:
Click to expand...
Click to collapse
I would, but my SystemUI.apk is heavily modded. The centered clock isn't the only thing that's different to stock. I'm happy to do this to your SystemUI.apk if you feel like sharing..
serajr said:
Great, keep modding !
Try this way:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
[B][COLOR="Red"]<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal|center" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />[/COLOR][/B]
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:visibility="gone" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" />
<ImageView android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_gravity="center_vertical" />
<LinearLayout android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" [B][COLOR="Red"]android:background="@drawable/status_bar_background"[/COLOR][/B] android:paddingLeft="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:animationCache="false">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingTop="2.0dip">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
See red changes from original, try it!
Click to expand...
Click to collapse
Ticklefish said:
Ah, very clever! I was obsessed with keeping the clock in the LinearLayout and didn't even consider this.
Click to expand...
Click to collapse
@both of you: which one I should follow?? :crying:
or I could combine both of your tuts on single xml??
serajr said:
Ok... get it!
http://forum.xda-developers.com/showpost.php?p=28519713&postcount=1
Click to expand...
Click to collapse
yea!! thank you very much
Ticklefish said:
I would, but my SystemUI.apk is heavily modded. The centered clock isn't the only thing that's different to stock. I'm happy to do this to your SystemUI.apk if you feel like sharing..
Click to expand...
Click to collapse
oh, so~
just the clock
thanks for your attention n want help me :fingers-crossed:
this https://www.box.com/s/ce71c4897adc84d9ed56
@Ticklefish
Can you move the signal bar to the left side of statusbar?
I tried this http://forum.xda-developers.com/showthread.php?t=1361715 but when I open the arrays.xml , in the item, I didn't see like the tutorial shown, just found some number in the <item></item>
*Sorry for my bad english
physcodelic said:
@both of you: which one I should follow??
or I could combine both of your tuts on single xml??
Click to expand...
Click to collapse
you can copy the entire code posted by seraj and replace it with its
Please do not quote the whole page please. It make the webpage hard to read especially in xda app
Sent from my ST25i using xda premium

[GUIDE][MOD][SYSTEMUI] How to add 0.00KB/s meter on statusbar GB/ICS/JB 10-08-2013

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
UPDATE NEW SMALI FILES AND LINES ON 2ND POST *TEST AND WORK ON FROYO ROM, GB ROM & MTK DEVICE
I just wanna share how to add speed meter (0.00k/s) data on statusbar simple and fastway
1.Basic knowledge how to compile/decompile using Apktool/Apkmanager/
Tickle My Android(I try it and so easy) Credits to Ticklefish
2.Brain and brave :laugh:
MOD LIST
@[STRIKE]Dzol Cp[/STRIKE] @Ticklefish *IF HE'S NOT BUSY
- *please pm/ed your name to me if you interested being an X-Mod in this thread.
Method :
-Download smali.zip attachment and extract it
-Decompile your SystemUI.apk
-In your smali,,copy/paste extract file
systemUi/smali/here = smali/fx/heriawan
-Then go to res/layout/status_bar.xml and add this line (copy from here)
Code:
<fx.heriawan.Kecepatan android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="left|center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
-Example
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
[COLOR="Red"]<fx.heriawan.Kecepatan android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="left|center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
-Save and close file.
-Then open res/values/styles.xml
edit this at the end of line or you can copy/paste from here
Code:
<style name="TextAppearance.StatusBar.Kecil" parent="@style/TextAppearance.StatusBar.Clock">
<item name="android:textSize">14.0dip</item>
<item name="android:textColor">#ffffffff</item>
</style>
</resources>
-Save and close file.
-Recompile back your SystemUi.apk..
-And let me know the result :good:
Status_bar.xml for SCREENSHOT
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="3.0dip" android:paddingRight="3.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:layout_gravity="left|center" android:id="@id/battery_text" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" style="@style/StatusBarNotificationText" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" />
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
<DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
[COLOR="Red"]<fx.heriawan.Kecepatan android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="left|center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
CREDITS TO : REPENCIS For his 0.00k/s smali files
CREDITS TO : ROMWIZ For his nice video tutorial
CREDITS TO : TICKLEFISH For his AWESOME Tools
CREDITS TO : SANJAY KUMAR For his FROYO tutorial
CREDITS TO : BLUE SHARKY For his fix SystemUI FC's tutorial
CREDITS TO : SIEUAN For MTK Devices mod
CREDITS TO : TABOO5200 For latest version - Modified smali's
Not modded for any user anymore *Can check with @Ticklefish Please include your device name and android version if you want Me to Re-Mod your SystemUI
*Try to upload here via XDA attachment uploader and not to link to any download server out of XDA unless there is no more option
New Smali files/lines
NEW SMALI FILES AND LINES
This new smali will show the KB/s meter only appear when you have data or wifi connection
NEW VERSION *MODIFIED SMALI'S - TEST ONLY ON GB
http://forum.xda-developers.com/showpost.php?p=48333101&postcount=793
FOR FROYO ROM
http://forum.xda-developers.com/showthread.php?t=2400335
FOR GB ROM
http://forum.xda-developers.com/showpost.php?p=44893138&postcount=191
FOR MTK DEVICE
http://forum.xda-developers.com/showpost.php?p=45963193&postcount=682
FIX FC FOR JB
http://forum.xda-developers.com/showpost.php?p=45710770&postcount=636
Copy this line to res/layout/status_bar.xml
Code:
<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:singleLine="true" />
this line to add in res/values/ids.xml
Code:
<item type="id" name="traffic">false</item>
and this one as usual res/values/styles.xml
Code:
<style name="TextAppearance.StatusBar.Traffic" parent="@style/TextAppearance.StatusBar.Clock">
<item name="android:textSize">14.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
<item name="android:textAllCaps">false</item>
</style>
Status_bar.xml for SCREENSHOT
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_custom_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ViewFlipper android:id="@id/status_bar_flipper" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true">
<ImageView android:gravity="right|center" android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:layout_gravity="left|center" android:id="@id/battery_text" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" style="@style/StatusBarNotificationText" />
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</LinearLayout>
</LinearLayout>
<DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" />
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
[COLOR="Blue"] <com.android.systemui.statusbar.policy.Traffic android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="right|center" android:id="@id/traffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" /> [/COLOR]
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</LinearLayout>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="@*android:dimen/status_bar_height" android:layout_alignParentLeft="true">
<DigitalClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
<com.serajr.dataspeedmeter.DataSpeedMeter android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="center" android:id="@id/data_speed_meter" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<View android:layout_width="8.0dip" android:layout_height="fill_parent" />
<include android:id="@id/signal_cluster_2" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<View android:layout_width="4.0dip" android:layout_height="fill_parent" />
</LinearLayout>
</RelativeLayout>
</ViewFlipper>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
biopsin said:
New smali : Works even better, no more traffic spam in catlog..excellent work!
Click to expand...
Click to collapse
copy the smali files to this
smali/com/android/systemui/statusbar/policy/here[/SIZE]
*Please include your device name and android version if you want Me to Re-Mod your SystemUI
*Try to upload here via XDA attachment uploader and not to link to any download server out of XDA unless there is no more option
Ticklefish said:
Yup, that's pretty much it.
framework-res.apk is what I call a "resource apk". It contains information that is needed to be able to decompile certain system apk's.
To make matters more confusing, the creator of apktool (the tool used by most people to decompile apk files) calls these sort of files "framework apk's".
Hopefully you'll start experimenting with decompiling apk's yourself before too long and you'll understand what this is all about. I was a newbie when I registered here and none of this made any sense to me at all! But keep with it, and it will all become second nature to you.
Click to expand...
Click to collapse
Re: [MOD][TUT] How to add 0.00k/s meter on statusbar ICS/JB
Lol funny i was just going to start à thread asking how todo that thanks alot will try it soon!
Btw do you know how to add cpu usage on statusbar?
Envoyé depuis mon SK17i
better tutorial please not everyone is developer or programer :/
thank you
Thanks. That works.
View attachment 1837281
Anyone can add cwm zip add 0.00k/s meter on statusbar
Upload your SystemUI.apk here,,maybe i can help
dhana999 said:
Anyone can add cwm zip add 0.00k/s meter on statusbar
Click to expand...
Click to collapse
dzolcp said:
Upload your SystemUI.apk here,,maybe i can help
Click to expand...
Click to collapse
Here please..
dzolcp said:
Upload your SystemUI.apk here,,maybe i can help
Click to expand...
Click to collapse
This is my SystemUI plz help me bro
I only have status_bar.xml into layout folder and there is no such line as
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Diaz1999 said:
Here please..
Click to expand...
Click to collapse
Im so sorry Master 3 types apktool and all k/s mod i try and all give me an error :blur:
my suggest to try from here :
http://forum.xda-developers.com/showthread.php?t=2129247
dhana999 said:
This is my SystemUI plz help me bro
Click to expand...
Click to collapse
Here you go Master
http://www.mediafire.com/?4p6rstamyk3pfns
jokamaciek said:
I only have status_bar.xml into layout folder and there is no such line as
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Kecil" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<LinearLayout android:gravity="right|center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stat_no_sim" android:paddingLeft="4.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Click to expand...
Click to collapse
Upload your SystemUI.apk here and i'l give a try
Here you go Master
http://www.mediafire.com/?4p6rstamyk3pfns
Thanks :good:
Would be better if would only appear when data/wifi is turned ON..
Thanks anyways..
Re: [MOD][TUT] How to add 0.00k/s meter on statusbar ICS/JB
Hello
Run on Xperia z
Tks
Xperia Tapatalked
Re: [MOD][TUT] How to add 0.00k/s meter on statusbar ICS/JB
You can share your systemui.apk? The one in the picture? This very good! Please
Google translator xD
Enviado Desde Mi Live with Walkman
Here you go Brov!! :good:
http://www.mediafire.com/?9678v0t28d8ec2s
Some more Mod by me
http://forum.xda-developers.com/showthread.php?t=2129247
joznathan said:
You can share your systemui.apk? The one in the picture? This very good! Please
Google translator xD
Enviado Desde Mi Live with Walkman
Click to expand...
Click to collapse
Sorry little bit out of topic..how to port from mdpi to hdpi ???
Re: [MOD][TUT] How to add 0.00k/s meter on statusbar ICS/JB
b1716tl said:
Sorry little bit out of topic..how to port from mdpi to hdpi ???
Click to expand...
Click to collapse
If you using mdpi app to hdpi phones, that's OK
And if you using hdpi app to mdpi phones, that might buggy like my Timescape
via XDA for Timescape™
Tried, failed
Compiles the application very well, but doesnot start the SystemUI after reboot..
Uploading my systemUI, please do the need full, or tell me where I am wrong...
Please..please....create a tutorial how to make 5 osb icon like this :fingers-crossed:

[MOD][Guide]How to change lockscreen clock position in real time

[MOD][Guide]How to change lockscreen clock position in real time
Before modding do a Nandroid Backup
With this mod you can change lockscreen weather widget position too if activated
Thanks to @Goldie for his special threadhttp://forum.xda-developers.com/galaxy-s2/development-derivatives/guide-understanding-creating-smali-mods-t2488033
To achieve you need:
SecSettings.apk
framework-res.apk
android.policy.jar
tool for decompile and compile like apktool 1.5.2;
tool for text edit like notepad++:
Start with SecSettings.apk:
Decompile SecSettings.apk ,go in res/xml ,open with text editor display_settings.xml and add the red lines
Code:
<CheckBoxPreference android:persistent="false" android:title="@string/display_saving" android:key="power_saving_mode" android:summary="@string/display_saving_mode_summary" />
<CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />
[COLOR="Red"]<PreferenceCategory android:title="@string/lockscreen_options">
<PreferenceScreen android:title="@string/lockscreen_clock_position">
<ListPreference android:entries="@array/lockscreen_clock_position_entries" android:title="@string/lockscreen_clock_position" android:key="clock_position" android:summary="@string/lockscreen_clock_position_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/lockscreen_clock_position_values" />
</PreferenceScreen>
</PreferenceCategory>[/COLOR]
Go in res/value open with text editor arrays.xml and add at the end the red lines
Code:
[COLOR="Red"] <string-array name="lockscreen_clock_position_entries">
<item>At Top-Left</item>
<item>At Center-Left</item>
<item>At Bottom-Left</item>
<item>At Top-Center</item>
<item>At Center-Center</item>
<item>At Top-Right</item>
</string-array>
<string-array name="lockscreen_clock_position_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>[/COLOR]
Go in res/value open with text editor strings.xml and add at the end this lines
Code:
<string name="lockscreen_options">Lockscreen Options</string>
<string name="lockscreen_clock_position">Clock Position</string>
<string name="lockscreen_clock_position_summary">Choose the position of the clock</string>
Go in smali\com\android\settings\DisplaySettings.smali file and add the following lines in RED
Code:
.field private final mIntentReceiver:Landroid/content/BroadcastReceiver;
.field private mKeyBacklightmode:Landroid/preference/CheckBoxPreference;
[COLOR="Red"]
.field private mLockClockPos:Landroid/preference/ListPreference;
[/COLOR]
field private mMultiWindowModeObserver:Landroid/database/ContentObserver;
.field private mMultiWindowPref:Landroid/preference/CheckBoxPreference;
In the same file find .method public onCreate and add the following lines in RED
Code:
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 424
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v12, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"]
const-string v12, "clock_position"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mLockClockPos:Landroid/preference/ListPreference;
const-string v12, "clock_position"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mLockClockPos:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mLockClockPos:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V [/COLOR]
.line 426
In the same file find .method public onPreferenceChange then find this code and add the red lines ,in blue line some explanation
Code:
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_clockpos[/COLOR] [COLOR="Blue"]change this from cond_2 to cond_clockpos[/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
in the same method find this code and add the red lines
Code:
.line 1100
const-string v1, "DisplaySettings"
const-string v3, "CONTEXTUALPAGE_SWITCH_CHANGED changed = false"
invoke-static {v1, v3}, Landroid/util/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_7
:cond_11
move-wide v0, v4
goto/16 :goto_3
[COLOR="Red"]
:cond_clockpos
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mLockClockPos:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "clock_position"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4 [/COLOR]
.end method
Save all changes and compile SecSettings
framework-res.apk part
Decompile framework-res.apk go in res/layout and open keyguard_circlelock_main.xml file find and change the following line
from this
Code:
<FrameLayout android:id="@id/circle_lockscreen_clock" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" />
to this
Code:
<FrameLayout android:id="@id/circle_lockscreen_clock" android:layout_width="fill_parent" android:layout_height="[COLOR="Red"]match_parent[/COLOR]" android:layout_alignParentTop="true" />
save changes then go in res/layout-hdpi and open keyguard_circlelock_clockwidget.xml file and replace whole file with the following lines
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/clock_root" android:paddingTop="4.0dip" android:paddingBottom="6.0dip" android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<view android:gravity="center" android:id="@id/clock_emergency" android:layout_width="fill_parent" android:layout_height="17.0dip" class="com.android.internal.policy.impl.sec.ClockWidget$EmergencyCall">
<TextView android:textSize="12.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_emergency_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.25" />
</view>
<view android:id="@id/clock_clock" android:layout_width="match_parent" android:layout_height="match_parent" class="com.android.internal.policy.impl.sec.ClockWidget$Clock">
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/clock_time_and_date" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="4.0dip">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:gravity="center" android:id="@id/clock_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true">
<ImageView android:id="@id/zzz_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_time_dot" />
<ImageView android:id="@id/zzz_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/clock_time" android:layout_alignBottom="@id/clock_time">
<TextView android:textSize="23.0dip" android:textColor="#fff8f8f8" android:id="@id/zzz_ampm" android:paddingLeft="3.0dip" android:paddingBottom="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
</RelativeLayout>
<TextView android:textSize="20.0dip" android:textStyle="bold" android:textColor="#fff6f7c9" android:gravity="bottom|center" android:id="@id/zzz_date_month" android:layout_width="wrap_content" android:layout_height="24.0dip" android:layout_marginTop="2.0dip" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
<view android:gravity="center" android:id="@id/clock_charge" android:paddingTop="5.0dip" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="24.0dip" class="com.android.internal.policy.impl.sec.ClockWidget$Charge">
<ImageView android:id="@id/clock_charge_icon" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_charging" />
<ImageView android:id="@id/clock_cmas_icon" android:paddingRight="3.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_cmas" />
<TextView android:textSize="17.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/clock_charge_text" android:layout_width="wrap_content" android:layout_height="24.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" />
</view>
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/dualClock_time_and_date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="14.0dip">
<LinearLayout android:orientation="vertical" android:id="@id/dual_clock_local" android:layout_width="160.0dip" android:layout_height="wrap_content">
<TextView android:textSize="18.0dip" android:textColor="#ffdcdcdc" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_local_locale" android:layout_width="fill_parent" android:layout_height="22.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@id/zzz_local_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_local_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_local_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_dual_time_dot" />
<ImageView android:id="@id/zzz_local_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_local_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="17.0dip" android:textColor="#fff8f8f8" android:ellipsize="none" android:gravity="bottom" android:layout_gravity="bottom" android:id="@id/local_am_pm" android:layout_width="wrap_content" android:layout_height="29.0dip" android:layout_marginBottom="3.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<TextView android:textSize="20.0dip" android:textColor="#fff6f7c9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_local_date_month" android:layout_width="fill_parent" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:id="@id/dual_clock_home" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:paddingBottom="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_home" />
<TextView android:textSize="18.0dip" android:textColor="#ffdcdcdc" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_home_locale" android:layout_width="fill_parent" android:layout_height="22.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@id/zzz_home_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_home_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_home_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_dual_time_dot" />
<ImageView android:id="@id/zzz_home_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_home_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="17.0dip" android:textColor="#fff8f8f8" android:ellipsize="none" android:gravity="bottom" android:layout_gravity="bottom" android:id="@id/home_am_pm" android:layout_width="wrap_content" android:layout_height="29.0dip" android:layout_marginBottom="3.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<TextView android:textSize="20.0dip" android:textColor="#fff6f7c9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_home_date_month" android:layout_width="fill_parent" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
</LinearLayout>
</LinearLayout>
<view android:orientation="vertical" android:id="@id/clock_weather" android:paddingTop="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" class="com.android.internal.policy.impl.sec.ClockWidget$Weather">
<TextView android:textSize="16.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_weather_no_service" android:padding="15.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" />
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/clock_weather_data_box" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:gravity="top" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:textSize="39.0dip" android:typeface="sans" android:textColor="#fff9f9f9" android:gravity="bottom" android:id="@id/clock_weather_temp" android:layout_width="wrap_content" android:layout_height="44.0dip" android:layout_marginTop="3.0dip" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
<ImageView android:id="@id/clock_weather_temp_unit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_celsius" />
<ImageView android:id="@id/clock_weather_icon" android:layout_width="83.0dip" android:layout_height="49.0dip" android:scaleType="fitXY" />
</LinearLayout>
<TextView android:textSize="23.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/clock_weather_city" android:layout_width="wrap_content" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" android:marqueeRepeatLimit="marquee_forever" />
<ImageView android:id="@id/clock_weather_logo_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_weather_logo" />
</LinearLayout>
</view>
</LinearLayout>
</view>
</LinearLayout>
Save all changes and compile framework-res
android.policy.jar part
Decompile android.policy.jar and go in com/android/internal/policy/impl/sec and open ClockWidget$Clock.smali file , find the following method .method protected onFinishInflate()V and add the red lines
Code:
.method protected onFinishInflate()V
.registers [COLOR="Red"]7[/COLOR]
.prologue
const/4 v1, 0x1
.line 994
invoke-super {p0}, Landroid/widget/FrameLayout;->onFinishInflate()V
.line 996
const v0, 0x10202ca
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/sec/ClockWidget$Clock;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout;
[COLOR="Red"]
iget-object v2, p0, Lcom/android/internal/policy/impl/sec/ClockWidget$Clock;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "clock_position"
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
const v3, 0x1
if-eq v2, v3, :cond_0
const v3, 0x2
if-eq v2, v3, :cond_1
const v3, 0x3
if-eq v2, v3, :cond_2
const v3, 0x4
if-eq v2, v3, :cond_3
const v3, 0x5
if-eq v2, v3, :cond_4
const/16 v4, 0x70
goto:goto_set
:cond_0
const/16 v4, 0x10
goto:goto_set
:cond_1
const/16 v4, 0x50
goto:goto_set
:cond_2
const/16 v4, 0x01
goto:goto_set
:cond_3
const/16 v4, 0x11
goto:goto_set
:cond_4
const/16 v4, 0x05
:goto_set
invoke-virtual {v0, v4}, Landroid/widget/LinearLayout;->setGravity(I)V
[/COLOR]
iput-object v0, p0, Lcom/android/internal/policy/impl/sec/ClockWidget$Clock;->mSingleClock:Landroid/widget/LinearLayout;
.line 997
Save all changes and compile android.policy then put SecSettings.apk , framework-res.apk and android.policy.jar in your device
Hey Bud.
Thanks for the tutorial, good work!
Im trying to do the mod on 4.4.2 so it has changed alittle.
all the lockscreen files are now in keyguard.apk
so ive added the list pref to settings, all works fine.
added the smali code to 'SecKeyguardClock' and changed all references to this file.
compiled and looks fine.
the bit im having trouble with is the xml file.
the newer ones are completely different to the older ones so could you post just the changes you made to 'keyguard_circlelock_clockwidget.xml ' so I can implement them in mine?
I have no way of comparing what you changed.
Thanks Mate.
maskerwsk said:
Hey Bud.
Thanks for the tutorial, good work!
Im trying to do the mod on 4.4.2 so it has changed alittle.
all the lockscreen files are now in keyguard.apk
so ive added the list pref to settings, all works fine.
added the smali code to 'SecKeyguardClock' and changed all references to this file.
compiled and looks fine.
the bit im having trouble with is the xml file.
the newer ones are completely different to the older ones so could you post just the changes you made to 'keyguard_circlelock_clockwidget.xml ' so I can implement them in mine?
I have no way of comparing what you changed.
Thanks Mate.
Click to expand...
Click to collapse
Hi mate ok, this is the original xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/clock_root" android:paddingTop="4.0dip" android:paddingBottom="6.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<view android:gravity="center" android:id="@id/clock_emergency" android:layout_width="fill_parent" android:layout_height="17.0dip" class="com.android.internal.policy.impl.sec.ClockWidget$EmergencyCall">
<TextView android:textSize="12.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_emergency_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="0.25" />
</view>
<view android:id="@id/clock_clock" android:layout_width="fill_parent" android:layout_height="wrap_content" class="com.android.internal.policy.impl.sec.ClockWidget$Clock">
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/clock_time_and_date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="4.0dip">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:gravity="center" android:id="@id/clock_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true">
<ImageView android:id="@id/zzz_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_time_dot" />
<ImageView android:id="@id/zzz_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/clock_time" android:layout_alignBottom="@id/clock_time">
<TextView android:textSize="23.0dip" android:textColor="#fff8f8f8" android:id="@id/zzz_ampm" android:paddingLeft="3.0dip" android:paddingBottom="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
</RelativeLayout>
<TextView android:textSize="20.0dip" android:textStyle="bold" android:textColor="#ffffffff" android:gravity="bottom|center" android:id="@id/zzz_date_month" android:layout_width="fill_parent" android:layout_height="24.0dip" android:layout_marginTop="2.0dip" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
</LinearLayout>
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/dualClock_time_and_date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="14.0dip">
<LinearLayout android:orientation="vertical" android:id="@id/dual_clock_local" android:layout_width="160.0dip" android:layout_height="wrap_content">
<TextView android:textSize="18.0dip" android:textColor="#ffdcdcdc" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_local_locale" android:layout_width="fill_parent" android:layout_height="22.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@id/zzz_local_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_local_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_local_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_dual_time_dot" />
<ImageView android:id="@id/zzz_local_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_local_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="17.0dip" android:textColor="#fff8f8f8" android:ellipsize="none" android:gravity="bottom" android:layout_gravity="bottom" android:id="@id/local_am_pm" android:layout_width="wrap_content" android:layout_height="29.0dip" android:layout_marginBottom="3.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<TextView android:textSize="20.0dip" android:textColor="#ffffffff" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_local_date_month" android:layout_width="fill_parent" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
</LinearLayout>
<LinearLayout android:orientation="vertical" android:id="@id/dual_clock_home" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:paddingBottom="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_home" />
<TextView android:textSize="18.0dip" android:textColor="#ffdcdcdc" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_home_locale" android:layout_width="fill_parent" android:layout_height="22.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:id="@id/zzz_home_hour01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_home_hour02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:id="@id/zzz_home_colon01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_dual_time_dot" />
<ImageView android:id="@id/zzz_home_minute01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-4.0dip" />
<ImageView android:id="@id/zzz_home_minute02" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="17.0dip" android:textColor="#fff8f8f8" android:ellipsize="none" android:gravity="bottom" android:layout_gravity="bottom" android:id="@id/home_am_pm" android:layout_width="wrap_content" android:layout_height="29.0dip" android:layout_marginBottom="3.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
</LinearLayout>
<TextView android:textSize="20.0dip" android:textColor="#ffffffff" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/zzz_home_date_month" android:layout_width="fill_parent" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#aa000000" android:shadowDy="2.0" android:shadowRadius="1.0" />
</LinearLayout>
</LinearLayout>
</view>
<view android:orientation="vertical" android:id="@id/clock_weather" android:paddingTop="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" class="com.android.internal.policy.impl.sec.ClockWidget$Weather">
<TextView android:textSize="16.0dip" android:textColor="#ffebebeb" android:ellipsize="none" android:gravity="center" android:id="@id/clock_weather_no_service" android:padding="15.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:shadowColor="@color/black" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" />
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/clock_weather_data_box" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:gravity="top" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:textSize="39.0dip" android:typeface="sans" android:textColor="#fff9f9f9" android:gravity="bottom" android:id="@id/clock_weather_temp" android:layout_width="wrap_content" android:layout_height="44.0dip" android:layout_marginTop="3.0dip" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" />
<ImageView android:id="@id/clock_weather_temp_unit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_celsius" />
<ImageView android:id="@id/clock_weather_icon" android:layout_width="83.0dip" android:layout_height="49.0dip" android:scaleType="fitXY" />
</LinearLayout>
<TextView android:textSize="23.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/clock_weather_city" android:layout_width="wrap_content" android:layout_height="25.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="3.0" android:shadowDy="3.0" android:shadowRadius="1.0" android:marqueeRepeatLimit="marquee_forever" />
<ImageView android:id="@id/clock_weather_logo_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_weather_logo" />
</LinearLayout>
</view>
<view android:gravity="center" android:id="@id/clock_charge" android:paddingTop="5.0dip" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="24.0dip" class="com.android.internal.policy.impl.sec.ClockWidget$Charge">
<ImageView android:id="@id/clock_charge_icon" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_charging" />
<ImageView android:id="@id/clock_cmas_icon" android:paddingRight="3.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/keyguard_lockscreen_ic_cmas" />
<TextView android:textSize="17.0dip" android:textColor="#fff9f9f9" android:ellipsize="marquee" android:gravity="bottom" android:id="@id/clock_charge_text" android:layout_width="wrap_content" android:layout_height="24.0dip" android:singleLine="true" android:shadowColor="#55000000" android:shadowDx="1.0" android:shadowDy="1.0" android:shadowRadius="1.0" />
</view>
</LinearLayout>
in the line with android:id="@id/clock_time_and_date" i changed the value of android:layout_height to fill_parent.
In the line with RelativeLayout i changed the value of android:layout_width to wrap_content then moved all the view with android:id="@id/clock_charge" inside the LinearLayout with android:id="@id/clock_time_and_date" and put it after the TextView with android:id="@id/zzz_date_month" then moved the rest of code inside the LinearLayout with android:id="@id/clock_time_and_date" too and put it after the view with android:id="@id/clock_charge"
hope this can help you

[StatusBarMods]Battery Percentage Text Statusbar for Lollipop

Battery percentage text with color changer controller .
What you will need
==> A lollipop rom (May work in other android versions too. I'm not sure.)
==> Apktool and a bit knowledge about it.
==> files.zip and controller.apk(optional) from below.
1) Decompile your SystemUI.apk
2) Copy the arefin folder from files.zip to decompiled systemui/smali/com/
3) Go to res/layout/status_bar.xml
4) Open that with notepad++ or any text editor
5) Now add this line
Code:
<com.arefin.batterytext.ArefinBatteryTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" android:paddingStart="7.0dip" android:layout_centerVertical="true" android:paddingTop="2dp" android:layout_centerHorizontal="true" />
Like this
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/system_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android:id="@id/notification_lights_out" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" android:paddingStart="6.0dip" />
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="6.0dip" android:paddingEnd="8.0dip">
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
<com.android.keyguard.AlphaOptimizedLinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include layout="@layout/system_icons" />
<com.arefin.batterytext.ArefinBatteryTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" android:paddingStart="7.0dip" android:layout_centerVertical="true" android:paddingTop="2dp" android:layout_centerHorizontal="true" />
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="start|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="7.0dip" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</LinearLayout>
<ViewStub android:id="@id/ticker_stub" android:layout="@layout/status_bar_ticker" android:inflatedId="@id/ticker" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Ok all done. Recompile your SystemUI.apk then push it in system/priv-app/SystemUI/
if you want to change color then you can use the controller apk .
Screenshots below ..
Works perfect, but cause a problem in my phone.
I set an alarm and turn off my phone, then when the phone turns on for the alarm, sistemui force close and i have to force reboot my phone by hold power button.
This not happen with unmoddified sistemui.apk.
Any help? Thanks for share your knoweledge with us.
oberworld said:
Works perfect, but cause a problem in my phone.
I set an alarm and turn off my phone, then when the phone turns on for the alarm, sistemui force close and i have to force reboot my phone by hold power button.
This not happen with unmoddified sistemui.apk.
Any help? Thanks for share your knoweledge with us.
Click to expand...
Click to collapse
Thanks for submitting bug report. I will look forward to find a solution for that problem.

[MOD][HOWTO] Extended Power Menu (EPM)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I figured this mod was long overdue, given that we're without Xposed on Nougat. Those who used to have the Galaxy S2/4 know how fond I am of this feature! This is a straightforward mod to add 2 buttons to the longpress power menu, specifically to reboot directly to recovery and bootloader. I'm not including a flashable zip as it won't run with stock kernel (modifies /system) and this is really intended for ROM devs to cook.
I've attached the B19 files to this post.
I will go through all the changes necessary to do the mod yourself for future bases. It will be assumed you have a basic environment (apktool/smali/baksmali) set up and some apk/jar modification experience. This is based on A2017U B19.
1. Add the buttons to the longpress menu: /system/framework/framework-zte-res.apk
- Decompile the apk and replace res/layout/global_dialog.xml with:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="vertical" android:background="#b3000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:textSize="12.0sp" android:textColor="#8affffff" android:gravity="center" android:id="@id/longpress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="24.0dip" android:text="@string/global_action_rboot_message" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="132.0dip" android:layout_marginStart="56.0dip" android:layout_alignParentStart="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/airplanemode" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/airplane" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:tint="#ffffffff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_airplane" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="132.0dip" android:layout_marginEnd="56.0dip" android:layout_alignParentEnd="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/silent_mode" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/silent" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:tint="#ffffffff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_silent" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="268.0dip" android:layout_marginStart="56.0dip" android:layout_alignParentStart="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/reset_action" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/reset" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_reboot" android:tint="#ffffffff" android:contentDescription="@string/global_action_reset" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_reset" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_reset" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="268.0dip" android:layout_marginEnd="56.0dip" android:layout_alignParentEnd="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/power_action" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/power" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_poweroff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_power" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_poweroff" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="404.0dip" android:layout_marginStart="56.0dip" android:layout_alignParentStart="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/recovery_action" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/recovery" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_recovery" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_recovery" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_recovery" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="404.0dip" android:layout_marginEnd="56.0dip" android:layout_alignParentEnd="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/bootloader_action" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageButton android:id="@id/bootloader" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_bootloader" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_bootloader" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_bootloader" android:maxLines="2" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
- For the landscape version, replace res/layout-land/global_dialog.xml with:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="vertical" android:background="#b3000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:textSize="12.0sp" android:textColor="#8affffff" android:gravity="center" android:id="@id/longpress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="24.0dip" android:text="@string/global_action_rboot_message" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="86.0dip" android:layout_centerHorizontal="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/airplanemode" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="14.0dip">
<ImageButton android:id="@id/airplane" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:tint="#ffffffff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_airplane" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:maxLines="2" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/silent_mode" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="14.0dip">
<ImageButton android:id="@id/silent" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:tint="#ffffffff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_silent" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:maxLines="2" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/power_action" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="14.0dip">
<ImageButton android:id="@id/power" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_poweroff" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_power" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_poweroff" android:maxLines="2" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="224.0dip" android:layout_centerHorizontal="true">
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/reset_action" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="14.0dip">
<ImageButton android:id="@id/reset" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_reboot" android:tint="#ffffffff" android:contentDescription="@string/global_action_reset" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_reset" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_reset" android:maxLines="2" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/recovery_action" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="14.0dip">
<ImageButton android:id="@id/recovery" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_recovery" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_recovery" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_recovery" android:maxLines="2" />
</LinearLayout>
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/bootloader_action" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="14.0dip">
<ImageButton android:id="@id/bootloader" android:background="@drawable/circle1" android:clickable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_lock_power" android:tint="#ffffffff" android:contentDescription="@string/global_action_bootloader" android:alpha="0.9" android:paddingStart="19.0dip" android:paddingEnd="19.0dip" />
<TextView android:textSize="12.0sp" android:textColor="@color/global_action_text" android:gravity="center" android:id="@id/text_bootloader" android:paddingTop="10.0dip" android:layout_width="110.0dip" android:layout_height="wrap_content" android:text="@string/global_action_bootloader" android:maxLines="2" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
It should be mentioned I simply reused the power button graphic for the additional buttons. You can customize the buttons by generating vector xml and replacing ic_lock_recovery/bootloader.xml.
(If you do generate nice icons, please post them!)
2. Add the appropriate IDs/strings/xml to framework-zte-res.apk
- add to res/values/ids.xml
Code:
<item type="id" name="recovery_action">false</item>
<item type="id" name="bootloader_action">false</item>
<item type="id" name="recovery" />
<item type="id" name="bootloader" />
<item type="id" name="text_recovery" />
<item type="id" name="text_bootloader" />
- add to res/values/strings.xml
Code:
<string name="global_action_recovery">Recovery</string>
<string name="global_action_bootloader">Bootloader</string>
- in res/drawable, copy ic_lock_power.xml to ic_lock_recovery.xml, ic_lock_bootloader.xml (comment at end of #1 applies here)
3. Build framework-zte-res.apk using apktool, which is nice enough to assign all the new IDs needed. Now decompile the new apk and open res/values/public.xml to obtain two IDs
used for step 4 smali changes:
Code:
<public type="id" name="recovery" id="[COLOR="Red"]0x06060067[/COLOR]" />
<public type="id" name="bootloader" id="[COLOR="red"]0x06060068[/COLOR]" />
You must save those two IDs somewhere for the next step. If you don't, you risk bootlooping or worse!
4. Our target for the actual code changes is GlobalActions.smali in services.odex. Search for '.method private createDialogMF40' and find the following code:
Code:
new-instance v6, Lcom/android/server/policy/GlobalActions$7;
invoke-direct {v6, p0}, Lcom/android/server/policy/GlobalActions$7;-><init>(Lcom/android/server/policy/GlobalActions;\V
invoke-virtual {v3, v6}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
Just after that last line will be our insertion point for the following code:
Code:
iget-object v6, p0, Lcom/android/server/policy/GlobalActions;->contentView:Landroid/view/View;
const v9, [COLOR="red"]0x6060067[/COLOR]
invoke-virtual {v6, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v3
.line 270
.local v3, "recoveryAction":Landroid/view/View;
new-instance v6, Lcom/android/server/policy/GlobalActions$19;
invoke-direct {v6, p0}, Lcom/android/server/policy/GlobalActions$19;-><init>(Lcom/android/server/policy/GlobalActions;)V
invoke-virtual {v3, v6}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
iget-object v6, p0, Lcom/android/server/policy/GlobalActions;->contentView:Landroid/view/View;
const v9, [COLOR="red"]0x6060068[/COLOR]
invoke-virtual {v6, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v3
.line 270
.local v3, "bootloaderAction":Landroid/view/View;
new-instance v6, Lcom/android/server/policy/GlobalActions$20;
invoke-direct {v6, p0}, Lcom/android/server/policy/GlobalActions$20;-><init>(Lcom/android/server/policy/GlobalActions;)V
invoke-virtual {v3, v6}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
5. Now we have associated our new buttons with GlobalActions$19 & 20 above. To create these two files, used GlobalActions$7.smali (which is the reboot code) as a template. Be sure to change any $7 to $19 / $20 in the appropriate files. Our last modifications are simple one-liners to direct the reboot behavior.
Find 'const/4 v3, 0x0' around line 69 and change to:
GlobalActions$19.smali:
Code:
const-string/jumbo v3, "recovery"
GlobalActions$20.smali:
Code:
const-string/jumbo v3, "bootloader"
Compile your changes and update services.jar. You are now ready to flash the new framework-zte-res.apk and services.jar to /system/framework. Reboot and cross your fingers!
Version History:
1.0(3/26/17): Initial release
1.1 (3/29/17): Moved portrait layout up 80 pixels to center vertically
You wouldn't be happen to already have a zip readily available to share With that knowledge would you be willing to look at that edits needed to get 3minit battery mod working? I tried it but the standard edits do not work, someone had got it working but pulled down how he did it . Anyways great thread thanks for the info!
neo4uo said:
You wouldn't be happen to already have a zip readily available to share With that knowledge would you be willing to look at that edits needed to get 3minit battery mod working? I tried it but the standard edits do not work, someone had got it working but pulled down how he did it . Anyways great thread thanks for the info!
Click to expand...
Click to collapse
I just updated the OP with the modified apk+jar. That should help
I'm not familiar with the 3minit mod.
neo4uo said:
You wouldn't be happen to already have a zip readily available to share With that knowledge would you be willing to look at that edits needed to get 3minit battery mod working? I tried it but the standard edits do not work, someone had got it working but pulled down how he did it . Anyways great thread thanks for the info!
Click to expand...
Click to collapse
I had 3mint workink on our BadBoyz rom but i havn't updated it for 7.1.1 yet...coming soon
---------- Post added at 07:57 PM ---------- Previous post was at 07:55 PM ----------
jeboo said:
I figured this mod was long overdue, given that we're without Xposed on Nougat. Those who used to have the Galaxy S2/4 know how fond I am of this feature! This is a straightforward mod to add 2 buttons to the longpress power menu, specifically to reboot directly to recovery and bootloader. I'm not including a flashable zip as it won't run with stock kernel (modifies /system) and this is really intended for ROM devs to cook.
Click to expand...
Click to collapse
Nice work Sir !! May we use this ?
benny3 said:
I had 3mint workink on our BadBoyz rom but i havn't updated it for 7.1.1 yet...coming soon
---------- Post added at 07:57 PM ---------- Previous post was at 07:55 PM ----------
Nice work Sir !! May we use this ?
Click to expand...
Click to collapse
Sure :good:
jeboo said:
It should be mentioned I simply reused the power button graphic for the additional buttons. You can customize the buttons by generating vector xml and replacing ic_lock_recovery/bootloader.xml.
(If you do generate nice icons, please post them!)
Click to expand...
Click to collapse
Here's what I came up with for icons if you or anyone wants to use them.
EDIT: I don't know how to do the vector thing you mentioned or why the power off is vectored but also included as a .PNG in res\drawable-xhdpi-v4 but I made some .PNGs based off ic_lock_power_off.png to be used as icons. If it's possible to use these somehow, cool. If not, let me know and I can remove them.
-Duir- said:
Here's what I came up with for icons if you or anyone wants to use them.
EDIT: I don't know how to do the vector thing you mentioned or why the power off is vectored but also included as a .PNG in res\drawable-xhdpi-v4 but I made some .PNGs based off ic_lock_power_off.png to be used as icons. If it's possible to use these somehow, cool. If not, let me know and I can remove them.
Click to expand...
Click to collapse
That'd be dope as hell dude. Gonna see about using these for mine if you're ok with that.
-Duir- said:
Here's what I came up with for icons if you or anyone wants to use them.
EDIT: I don't know how to do the vector thing you mentioned or why the power off is vectored but also included as a .PNG in res\drawable-xhdpi-v4 but I made some .PNGs based off ic_lock_power_off.png to be used as icons. If it's possible to use these somehow, cool. If not, let me know and I can remove them.
Click to expand...
Click to collapse
Awesome man! I actually tried using a 96x96 PNG from framework-res.apk, but it distorted (too large and ovoid).
tylerlawhon said:
That'd be dope as hell dude. Gonna see about using these for mine if you're ok with that.
Click to expand...
Click to collapse
Go for it. I'd use them myself if I knew how. :silly:
Updated OP to fix vertical alignment in portrait mode. :good:
Here is a flashable for peeps to flash in recovery. I can mirror if needed.
neo4uo said:
You wouldn't be happen to already have a zip readily available to share With that knowledge would you be willing to look at that edits needed to get 3minit battery mod working? I tried it but the standard edits do not work, someone had got it working but pulled down how he did it . Anyways great thread thanks for the info!
Click to expand...
Click to collapse
EDIT
benny3 said:
Here is 3Mint for 7.1.1..Enjoy......http://www.mediafire.com/file/2xr733xwzhfbxy6/BadBoyZ_7.1.1_3Mint_Battery.zip
Click to expand...
Click to collapse
You should start a thread if not already thx bunches!
benny3 said:
Here is 3Mint for 7.1.1..Enjoy......http://www.mediafire.com/file/2xr733xwzhfbxy6/BadBoyZ_7.1.1_3Mint_Battery.zip
Click to expand...
Click to collapse
I tried flashing the file and it jacked my phone up. I do not know what was wrong with it. I have redownloaded it and tried reflashing with no luck. I am looking for a stock version(B19) to try to get my phone back working. I figured that I can replace the systemui_ui apk to get back going anyways just figured that I would let you know that that file was not working!
neo4uo said:
I tried flashing the file and it jacked my phone up. I do not know what was wrong with it. I have redownloaded it and tried reflashing with no luck. I am looking for a stock version(B19) to try to get my phone back working. I figured that I can replace the systemui_ui apk to get back going anyways just figured that I would let you know that that file was not working!
Click to expand...
Click to collapse
Same here. I can't enter my decryption password when flashing the 3minit battery mod
Is there a screen shot of what the apm look like?
gpz1100 said:
Is there a screen shot of what the apm look like?
Click to expand...
Click to collapse
Here ya go
neo4uo said:
I tried flashing the file and it jacked my phone up. I do not know what was wrong with it. I have redownloaded it and tried reflashing with no luck. I am looking for a stock version(B19) to try to get my phone back working. I figured that I can replace the systemui_ui apk to get back going anyways just figured that I would let you know that that file was not working!
Click to expand...
Click to collapse
It flashed and worked just fine for me. Strange. This is for a deodex rom, what rom are you on ?
benny3 said:
It flashed and worked just fine for me. Strange. This is for a deodex rom, what rom are you on ?
Click to expand...
Click to collapse
I'm in stock B19. Might be due to the rom being odexed. I didn't think of that
jimbo77 said:
I'm in stock B19. Might be due to the rom being odexed. I didn't think of that
Click to expand...
Click to collapse
It really shouldn't matter. You can have some files deodexed and some not. If this was the case then 3minit wouldn't work on any stock rooted ROMs. I am thinking a bad download. I might try downloading and flashing again. Maybe we can get a Md5 so we can check the download.

Categories

Resources