Are annoyed with ongoing notifications in pull-down menu and status bar UI?
If yes, then this tutorial is just for you :laugh:
In this tutorial, I will show you how to get rid of ongoing notifications in pull-down menu and the built-in ongoing notifications for status bar PERMANENTLY... This will not affect foreground ongoing activity..!! So here we go..
★ Disable Ongoing Notifications in Pull-down Menu ★
{
"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"
}
- Decompile SystemUI.apk.
- Navigate to res/layout folder and open tw_status_bar_expanded.xml file.
- Now, locate this section:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="[B][COLOR="Red"]fill_parent[/COLOR][/B]" android:layout_height="[B][COLOR="Red"]@dimen/status_bar_expanded_notification_category_height[/COLOR][/B]">
<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
</LinearLayout>
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Change the red texts in the previous codes to the new green one bellow and add the new blue codes..
Code:
<LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="[B][COLOR="Lime"]0.0dip[/COLOR][/B]" android:layout_height="[B][COLOR="Lime"]0.0dip[/COLOR][/B]">
<TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
</LinearLayout>
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Save changes, recompile, push to phone, fix permissions (644) and reboot.
★ Disable Built-in Ongoing Notifications in Status Bar ★
Ok, this part is only for built-in ongoing notifications, since market apps ongoing notifications can be disabled from application manager settings..!!!
A. Disable USB Debugging Notification:
This is quiet simple. In your phone, go to /system partition folder and open build.prop file and add this line if it is not there or edit the pre-existent one to be like this one:
Code:
persist.adb.notify=[B][COLOR="Blue"]0[/COLOR][/B]
So.. 0 means disable and 1 means enable.
B. Disable Full Battery Notification:
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and just add the following line (the blue line):
Code:
.method notifyFullBatteryNotification()V
.registers 12
.prologue
[B][COLOR="Blue"]return-void[/COLOR][/B]
const/4 v10, 0x0
.line 827
iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
const-string v8, "notification"
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.
C. Disable Keyboard Input Notification:
- Baksmali services.jar.
- Navigate to classout/com/android/server/ folder and open InputMethodManagerService.smali
- Search for this method ".method public setImeWindowStatus(Landroid/os/IBinder;II)V" and just add the following line (the blue line):
Code:
.method public setImeWindowStatus(Landroid/os/IBinder;II)V
.registers 23
.param p1, "token" # Landroid/os/IBinder;
.param p2, "vis" # I
.param p3, "backDisposition" # I
.prologue
[B][COLOR="Blue"]return-void[/COLOR][/B]
.line 1640
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.
D. Disable USB Connection Notification:
This method is inspired by this thread here by @Didact74
- Decompile framework-res.apk.
- Go to res/values/ folder and open drawables.xml and add this line at the end before </resources> line:
Code:
<item type="drawable" name="stat_sys_data_usb">false</item>
- Now delete this image resource "stat_sys_data_usb.png" from both res/drawables-hdpi and drawables-xhdpi folders.
- Recompile, push to phone, fix permissions (644) and reboot.
And that's all folks for this tutorial,,, and until next tutorial,, please stay safe,,,
Yours,,
<< Adding toggle to switch on and off full battery notification and keyboard notification >>
Coming Soon....
See this thread:
http://forum.xda-developers.com/showthread.php?p=46565607#post46565607
Ho Ho Ho!
nokiamodeln91 said:
Ho Ho Ho!
Click to expand...
Click to collapse
lol.. Yei Yei
The first part., its going to disable all ongoing ones right? Not app specific.
I just want to remove the one that shows speed in the screenshot.
nokiamodeln91 said:
The first part., its going to disable all ongoing ones right? Not app specific.
Click to expand...
Click to collapse
Yes, all of whatever in pull-down menu
nokiamodeln91 said:
I just want to remove the one that shows speed in the screenshot.
Click to expand...
Click to collapse
If you want to remove that in both status bar and pull-down then uncheck show notification in application manager for that app
If you want only one of them, then you need to decompile the app and look to its smali method that invoke notification and you need to debug the <if :condition> for that method so you will have notification in status bar but not in pull-down. Yes it could be time consuming but if you are patient enough you will do it.
Thanks thats great! is there a way to stop the screen turning on and fully charged beep. the phone's screen lights up during the night when i am asleep and sometimes wakes me up!
Use xposed with gravitybox.
Fender9770 said:
Thanks thats great! is there a way to stop the screen turning on and fully charged beep. the phone's screen lights up during the night when i am asleep and sometimes wakes me up!
Click to expand...
Click to collapse
+1
how about power saving mode on??? can u guide how to hide it??? thanks.
Related
It is not only transparent, it could be any color as well that you can achieve by playing with hex color codes!!!
I am trying to help those who want to play with status bar background, text color and pull-down menu background (this will not include how to change status bar and pull-down menu icons)..
I will also try to show you how to get transparency up-to my knowledge
So here we go..
You will need:
1. Apktool or APK-Tool Manager for decompiling and recompiling
2. Backsmali/Smali program from here "use it to edit smali part in this tutorial"
3. Color hex code picker (like color picker, or photoshop).
4. ARGB hex converter to set transparency of alpha value.
5. Notepad++ for xml and smali editing.
First you need to decompile SystemUI.apk, and framwork-res.apk
Click to expand...
Click to collapse
Initially, you need to choose the color you want.. This is how RGB color hex code picker in photoshop..
{
"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"
}
Then change transparency with ARGB hex converter..
Where 00 = 100% transparency (i.e, completely transparent), 3F = 75% transparency, 7F = 50% transparency, BF = 25% transparency, FF = 0% transparency (i.e, completely opaque)
Now lets the chaos begins!!
1) For status bar:
- Go to SystemUI.apk\res\values and open drawables.xml and focus on this line:
Code:
<item type="drawable" name="status_bar_background">#[B][COLOR="Red"]ff[/COLOR][/B]1e1e1e</item>
change ff value to (00 -> 100% transparency, 3f -> 75% transparency, 7f -> 50% transparency, bf -> 25% transparency)
The other value (1e1e1e) is RBG for grey color, if you want it black it will be (000000).
So:
#00000000 - black with 100% transparency
#3F000000 - black with 75% transparency
#7F000000 - black with 50% transparency
#BF000000 - black with 25% transparency
2) For pull-down menu:
This one has 6 parts..
First part: top bar of pull-menu
- Go to SystemUI.apk\res\layout and open tw_status_bar_expanded_header.xml, look for this line:
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="#[B][COLOR="Red"]ff000000[/COLOR][/B]" android:layout_width="fill_parent" android:layout_height="39.0dip" android:baselineAligned="false"
so change ff value to which value that represent the transparency you like as mentioned in section above (00 -> 100% transparency, 3f -> 75% transparency, 7f -> 50% transparency, bf -> 25% transparency)
- Also for Settings background in top bar of pull-menu, edit this line in tw_status_bar_expanded_header.xml (the red line):
Code:
<RelativeLayout android:id="@id/settings_button" android:background="[B][COLOR="Red"]@drawable/tw_quick_panel_setting_button_bg[/COLOR][/B]" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
Here you can put any ARGB color code that you like starting with hashtag sign "#" instead of red color line above. (credits to nokiamodeln91)
Second part: toggle slider
Well I didn't change it before. But I believe It is png file in drawable-xhdpi folder named [tw_quick_panel_quick_setting_button_bg_normal.9.png] and [tw_quick_panel_quick_setting_button_bg_pressed.9.png], just change it with any transparent image with same name.
Third part: brightness panel background
- Go to SystemUI.apk\res\layout folder and open tw_status_bar_expanded.xml and focus on this line:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/[B][COLOR="Blue"]brightness_controller[/COLOR][/B]" android:background="#[B][COLOR="Red"]ff000000[/COLOR][/B]" android:layout_width="fill_parent" android:layout_height="56.0dip">
This is black with 0 transparency.. so change to which color and transparency you want.
The fourth part: Notification panel background:
This one has different parts:
Part A: Ongoing header:
- Go to SystemUI.apk\res\layout and open tw_status_bar_expanded.xml. Here focus on the following line:
Code:
<LinearLayout android:orientation="vertical" android:id="@i[B][COLOR="Blue"]d/onGoingCart[/COLOR][/B]" android:background="#[B][COLOR="Red"]ff293945[/COLOR][/B]" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
This is dark grey with 0 transparency.. Change to whatever you want
Part B: Notifications header:
- Go to SystemUI.apk\res\layout and open tw_status_bar_expanded.xml. Here focus on the following line:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/[B][COLOR="Blue"]notificationCart[/COLOR][/B]" android:background="#[B][COLOR="Red"]ff293945[/COLOR][/B]" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
This is dark grey with 0 transparency.. so change to which color and transparency you want.
Part C: Clear button:
Just go to SystemUI.apk\res\drawable-xhdpi folder and change these images [tw_quick_panel_clearbtn_focus.9.png], [tw_quick_panel_clearbtn_normal.9.png], [tw_quick_panel_clearbtn_press.9.png] and [tw_quick_panel_clearbtn_select.9.png]; don't forget that these are 9.png files, so need special way (you can search the forum for that)
Part D: Notifications panel itself:
- Go to SystemUI.apk\res\layout and open tw_status_bar_expanded.xml. Here focus on the following lines:
Code:
<FrameLayout android:id="@i[B][COLOR="Blue"]d/notification_panel[/COLOR][/B]" android:background="@drawable/[B][COLOR="Red"]notification_panel_bg[/COLOR][/B]" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
This is for notification panel and it is not hex color code; it is notification_panel_bg.9.png file so go to drawable-xhdpi folder and replace it with another 9.png file which is transparent (see forum to know how to create 9.png file, there are a lot of tutorials!!)
Fifth part: the notifications themselves.
- Go to SystemUI/smali/com/android/systemui/statusbar/phone/ folder and open PhoneStatusBar.smali and search for "-0x100". There will be two lines; change them from:
Code:
const/high16 v15, [B][COLOR="Red"]-0x100[/COLOR][/B]
to:
Code:
const/high16 v15, [B][COLOR="Blue"]0x0[/COLOR][/B]
Don't forget to change the second line as well.
Then decompile framework-res.apk and go to framework-res/res/values/ folder and open drawables.xml and look for this line:
Code:
<item type="drawable" name="notification_item_background_color">#[B][COLOR="Red"]ff000000[/COLOR][/B]</item>
change ff value to any transparency value you want.
then recompile framework-res.apk with compression level set to 0 (to not get boot-loop!!!)
Sixth part: the footer:
This is the simplest part, just go to SystemUI.apk\res\drawable-xhdpi folder and change these images [tw_status_bar_close_off.png] and [tw_status_bar_close_on.png] with any transparant image you create (just save with the same name).
3) For texts in status bar and pull-down menu:
Just search for any text color hex codes in the following files and change them to whatever you want:
SystemUI/res/values/drawables.xml
Code:
<item type="drawable" name="[B][COLOR="Blue"]notification_number_text_color[/COLOR][/B]">#[B][COLOR="Red"]ffffffff[/COLOR][/B]</item>
SystemUI/res/layout/tw_quick_setting_button.xml
Code:
<TextView android:textSize="@dimen/quick_setting_button_text_size" android:textColor="#[B][COLOR="Red"]ffafc5dc[/COLOR][/B]" android:gravity="center" android:id="@id/[B][COLOR="Blue"]btn_text[/COLOR][/B]" android:layout_width="fill_parent" android:layout_height="@dimen/quick_setting_button_text_height" android:includeFontPadding="false" />
SystemUI/res/layout/tw_status_bar_expanded_header.xml
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/[B][COLOR="Blue"]TextAppearance.StatusBar.Expanded.Clock[/COLOR][/B]" android:textColor="#[B][COLOR="Red"]ffffffff[/COLOR][/B]" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:layout_marginTop="-3.0dip" android:singleLine="true" systemui:ampmSmall="true" />
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/[B][COLOR="Blue"]TextAppearance.StatusBar.Expanded.Date[/COLOR][/B]" android:textColor="#[B][COLOR="Red"]ffcbcbcb[/COLOR][/B]" android:ellipsize="none" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="4.0dip" android:maxLines="2" />
SystemUI/res/layout/tw_status_bar.xml
Code:
<TextView android:textSize="12.0dip" android:textColor="#[B][COLOR="Red"]ffa6a6a6[/COLOR][/B]" android:layout_gravity="center" android:id="@id/[B][COLOR="Blue"]battery_text[/COLOR][/B]" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_[B][COLOR="Blue"]clock_text[/COLOR][/B]_size" android:textColor="#[B][COLOR="Red"]ff959595[/COLOR][/B]" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
and that is it all what I know
enjoy :good:
Extra steps:
- Remove lines in notification pull-down to be transparent, see post #103 (credits to bombaybadboy)
- Hide Statusbar or Transparent Statusbar on Lockscreen (a great tutorial by @xperiacle from here)
- Add shadow effect to status bar texts and icons, see post #205
Oh man great work. Just to write these tutorials you deserve a hi five.
Sent from my GT-N7000 using xda premium
Is my teacher, thanks
Send from my toilets with Tapatalk
ohh
hay i decompiled.... but in my res folder >values when i enter values and search for layout xml there is no such xml file plz help me in this.... :cyclops:
both are folders
\res\layout & \res\values
Any simple way???!!!directly on android
Sent from my GT-N7000 using xda premium
No. Other than using roms that incorporates these settings.
thanks for the tutorial, I got some questions
by apk manager
after compiling, should I sign it or not?
step in 7 zip
i wanted to replace the amended xml to the original xml, but \res\values\drawables is missing
how can i decompile systemUI and framwork
devilctk said:
thanks for the tutorial, I got some questions
by apk manager
after compiling, should I sign it or not?
step in 7 zip
i wanted to replace the amended xml to the original xml, but \res\values\drawables is missing
Click to expand...
Click to collapse
no need to sign sys apps.
to get the values folder, you will first need to decompile the apk as its hidden in resources.asrc Use APK manager
Excellent info thanks much OP.
I gave notification_panel_bg.9.png some transparency looks great except for transparent gap between toggle slider & brightness panel.
Ive tried for hours to fill that void with black having no luck.
Any recommendations?
Thanks
Phil-
Hi men, how to chance the status bar color in xxlsc..Pls help me, pls...
Sent from my GT-N7000 using xda premium
devilctk said:
thanks for the tutorial, I got some questions
by apk manager
after compiling, should I sign it or not?
step in 7 zip
i wanted to replace the amended xml to the original xml, but \res\values\drawables is missing
Click to expand...
Click to collapse
if its system apk you must sign it,
for /res/values just drag and drop resources.arsc from your mod to your original
Emothic_Reagan said:
Hi men, how to chance the status bar color in xxlsc..Pls help me, pls...
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
Have you tryed this guide it shiuld work on xxlsc as well
Sent from my GT-N7000 using XDA Premium HD app
I'm not able to decompile systemUI.apk
framework-res.apk is decompiling properly, but there are always problems with systemUI.apk.
I was trying to delete classes.dex but no difference.
Any help?
wierzbik said:
I'm not able to decompile systemUI.apk
framework-res.apk is decompiling properly, but there are always problems with systemUI.apk.
I was trying to delete classes.dex but no difference.
Any help?
Click to expand...
Click to collapse
Make sure you have a completely stock unmodified systemUI.apk installed along with framework-res and in my case the twframework-res, in the apktool frameworks
Sent from my SAMSUNG-SGH-I747 using xda premium
I didn't tried with stock. I want only to change color of the statusbar in Ultimate rom, so I took apk's from this rom. So the problem is previously modifed apk? Is it possible to do something with this?
EDIT: Original, unmodifed systemUI.apk from S2 can not be decompiled too
Maybe I'm doing something wrong.
I was trying to decompile with this guide: http://forum.xda-developers.com/showthread.php?t=1848458
and with others which have 'succeed' because there weren't any errors but on the beginning of drawables.xml I have a lot of lines:
<item type="drawable" name="APKTOOL_DUMMY_003f">false</item>
So I guess, that's not properly decompiled.
Thanks for great guide. Would you please also prepare an instruction for Center Clock for status bar also?
I decompiled,made the transparency edits and compiled the apk. all the values are fine. But when I replace my System UI I get back the same look I had before I did all the transparency edits. When I decompile the new System UI all my edits are there. This is just weird...
2) For pull-down menu:
This one has 6 parts..
First part: top bar of pull-menu
- Go to SystemUI.apk\res\layout and open tw_status_bar_expanded_header.xml, look for this line:
Code:
<LinearLayout android:gravity="center_vertical" androidrientation="horizontal" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="39.0dip" android:baselineAligned="false"
so change ff value to which value that represent the transparency you like as mentioned in section above (00 -> 100% transparency, 3f -> 75% transparency, 7f -> 50% transparency, bf -> 25% transparency)
Click to expand...
Click to collapse
How do i get rid of this on any other rom i want?
Disclaimer
I am not the developer of this tool. I am just sharing how to test your apps' functionality via Robotium.
This tutorial assumes that you have the SDK and Eclipse all set up perfectly. Setting these up will not be covered in this tutorial.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Setting up a sample project:
Although source codes are available, it is recommended to do this manually.
Create a new android project by going to File> New> Android Application Project.
Fill in the following information until you have the project set up.
{
"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"
}
So your project is now set up. Its a simple calculator just for testing.
Type this in your main.xml;
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtFirstNumber"
/>
<EditText
android:inputType="numberDecimal"
android:id="@+id/EditText01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSecondNumber"
/>
<EditText
android:inputType="numberDecimal"
android:id="@+id/EditText02"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace"
/>
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace"
/>
<Button
android:text="Multiply"
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
This in your strings.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Enter two values and click on Calculate to multiply them.</string>
<string name="app_name">AndroidCalculator</string>
<string name="txtFirstNumber">Enter First Number</string>
<string name="txtSecondNumber">Enter Second Number</string>
<string name="txtSpace"></string>
</resources>
This in your Main.java :
Code:
package com.calculator;
import com.calculator.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.text.Editable;
public class Main extends Activity {
EditText FirstValue;
EditText SecondValue;
TextView Result;
Button Calculate;
float num1 , num2;
[user=439709]@override[/user]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
FirstValue = (EditText) findViewById(R.id.EditText01);
SecondValue = (EditText) findViewById(R.id.EditText02);
Result = (TextView) findViewById(R.id.TextView01);
Result.setText("0.00");
Calculate = (Button) findViewById(R.id.Button01);
//Adding listener to button
Calculate.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//Getting first & second values and passing to show result
showResult(FirstValue.getText(), SecondValue.getText());
}
});
}
//Showing multiply results
protected void showResult(Editable first, Editable second)
{
float num1 = Float.parseFloat(first.toString());
float num2 = Float.parseFloat(second.toString());
float result = num1 * num2;
Result.setText(String.valueOf(result));
}
}
Your basic calculator app is now ready. This is just for testing purposes so we will not be focusing on the layout too much.
Launch your app in emulator. It will look like this :
Now we will create a test android project.
Go to File> New> Project and follow like its given below :
This is also done.
Now right click on the Test project and go to New> JUnit Test Case and setup the following:
A new java file will now bee created.
Now right click on the Test Project again and go to Build Path> Configure Build Path and setup the following again:
Here Click Add External Jars and browse to the Robotium jar file. You can download it here. Choose the latest one to download.
Note: Not javadoc.jar Only Jar file.
Go to Order and Export and check the jar file and click OK.
Now type this in the TestMain.java :
Code:
package com.calculator.test;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.EditText;
import android.widget.TextView;
import com.calculator.Main;
import com.calculator.R;
import com.jayway.android.robotium.solo.Solo;
public class TestMain extends ActivityInstrumentationTestCase2<Main> {
private Solo solo;
public TestMain() {
super(Main.class);
}
[user=439709]@override[/user]
protected void setUp() throws Exception {
super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
}
public void testDisplayBlackBox() {
//Enter 10 in first edit-field
solo.enterText(0, "10");
//Enter 20 in first edit-field
solo.enterText(1, "20");
//Click on Multiply button
solo.clickOnButton("Multiply");
//Verify that resultant of 10 x 20
assertTrue(solo.searchText("200"));
}
public void testDisplayWhiteBox() {
//Defining our own values to multiply
float firstNumber = 10;
float secondNumber = 20;
float resutl = firstNumber * secondNumber ;
//Access First value (edit-filed) and putting firstNumber value in it
EditText FirsteditText = (EditText) solo.getView(R.id.EditText01);
solo.enterText(FirsteditText, String.valueOf(firstNumber));
//Access Second value (edit-filed) and putting SecondNumber value in it
EditText SecondeditText = (EditText) solo.getView(R.id.EditText02);
solo.enterText(SecondeditText, String.valueOf(secondNumber));
//Click on Multiply button
solo.clickOnButton("Multiply");
assertTrue(solo.searchText(String.valueOf(resutl)));
TextView outputField = (TextView) solo.getView(R.id.TextView01);
//Assert to verify result with visible value
assertEquals(String.valueOf(resutl), outputField.getText().toString());
}
[user=439709]@override[/user]
protected void tearDown() throws Exception{
solo.finishOpenedActivities();
}
}
That's it. Your test project is also done.
Now right click on the TestMain.java in Eclipse and run it as an Android JUnit Test Case:
Project will now load up in the emulator and auto testing will begin as provided in TestMain.java:
Finally your results will be shown in the JUnit panel. Which shouldn't have any errors of course.
That's it! You have just tested your app without even really testing it!! :good:
Using Robotium to test apk file
This tutorial is for testing an apk file if you dont have the source.
Follow this first if app is not yours and is signed by someone else.
1. Open the apk file with 7zip or any other alternative.
2. Delete the Meta-inf folder.
3. Resign the apk again in debug mode.
If the app is yours.
Export the app in any location signed in debug mode.
Install the apk onto the emulator.
Now again create a test project like in the 1st post.
Make sure you click the radio button for ''This Project''.
From now, its similar to the first post.
First right click on the package and go to New> Package and give the package as com.testcalculator .
Create a new Class by right clicking on the Test Project and name it as TestApk.
Again add the Robotium jar file that you downloaded earlier. Follow first post on how to do it.
Finally right-click the project and run it as Android JUnit Test.
That's it. Emulator will load it and test it the same way as in Post 1.
Note:
1. Make sure your Manifest is correct because most probably Eclipse will make the package as com.calculator.test . You can keep it the same way but to differentiate it from the 1st post, we will keep it as com.testcalculator .
2. Whatever your package name is, make sure to keep it correct in the java class in src folder.
3. You can keep the java file same as in post 1 keeping in mind the above point.
Featured on the Portal here:
http://www.xda-developers.com/android/auto-test-your-android-apps-with-robotium
Again here:
www.xda-developers.com/android/robotium-guide-updated-for-testing-apps-without-source
And on XDA TV here:
http://www.xda-developers.com/andro...g-android-apps-with-robotium-xda-developer-tv
Robotium
Robotium is an Android test automation framework
that has full support for native and hybrid
applications. Robotium makes it easy to write
powerful and robust automatic black-box test
cases. With the support of Robotium, test case
developers can write function, system and acceptance test scenarios, spanning multiple
Android activities.
Click to expand...
Click to collapse
Sources And Links
Robotium Project Home.
Download Page.
Tutorials Page.
Sources
The source code of the sample apps can be downloaded through the Tutorials link given.
{
"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"
}
Framework Base
108375411c6b714635e7f17eeda75cc17857323d
f96fd1afff2e5189c0bf1e5c5c25ed9be6908061
568a433716cfc4a5080df3fd730cb438ab139b3d new
Settings
60f2ef537af3b7fe7c7557f61029e9a03b3a2105
95f2a541d59c988c82cf14655a3be6578802442a
Features included
Original :
Instantly turns the device screen on and displays notifications as they arrive
Up to 8 notifications displayed in a horizontal strip that can be viewed by touching the notification icon
Short notification description can be displayed around the outside of the center ring
Touch the center ring notification to view the full notification
Unlock the device, open the app for the current notification or dismiss the current notification
Set a re-display time to have active display remind you of your pending notifications
Adjustable brightness level for when active display turns the screen on
Pocket mode which allows active display to turn on once you remove the device from your pocket or bag
New all in one :
Display Time out
Turn Off Display
Threshold to proximity
maybe more ...
Fixes included :
FULL ActiveDisplay Fixes/Options
Code:
[I]Active display [squashed] (1/2) [/I]
ActiveDisplay: fix for disappearing notification bar
0c7588324f Browse code
maxwen authored
Active Display: Fix Derp
c6031125d0 Browse code
Der-Schubi authored
Active Display: Sort notifications by newest to oldest …
7674882824 Browse code
0xD34D authored
Active Display: Add some synchronization …
b3b33db6a6 Browse code
0xD34D authored
Omni: [1/2] Base: Fix pimp up ActiveDisplay …
434928a07e Browse code
micku7zu authored
pac : [1/2] Base: Pimp up ActiveDisplay …
b9e91f7a88 Browse code
Der-Schubi authored
Active display: Ability to turn off the screen, when a not clearable …
d047508943 Browse code
Der-Schubi authored
FULL ActiveDisplay Settings
Code:
[I]Active display [squashed] (2/2) [/I]
Pac : Pimp up ActiveDisplay
f7a3e64fa3 Browse code
Der-Schubi authored
OmniGears: Fix pimp up ActiveDisplay …
9852cc52b6 Browse code
micku7zu authored
this work took two days until i reached this result, I hope that it can be helpful for other developers
Regards
Is there any chance to get it works on 4.2?
Good it compiles correctly.
But when I activate activate display I obtain fc systemui
thank you good work:good:
packhex said:
Good it compiles correctly.
But when I activate activate display I obtain fc systemui
thank you good work:good:
Click to expand...
Click to collapse
what the base you work on ?
So just those 4 commits & that's it?
git cherry pick commit?
gr33nd3vil said:
So just those 4 commits & that's it?
git cherry pick commit?
Click to expand...
Click to collapse
there new fixes and changes was added , take a look here
https://github.com/ProBAMKK/android_frameworks_base/commit/568a433716cfc4a5080df3fd730cb438ab139b3d
then yes , you can pick it with "git cherry-pick SHA1"
codexc said:
there new fixes and changes was added , take a look here
https://github.com/ProBAMKK/android_frameworks_base/commit/568a433716cfc4a5080df3fd730cb438ab139b3d
then yes , you need can pick it with "git cherry-pick SHA1"
Click to expand...
Click to collapse
Alright I'll try adding to my cm11 build
gr33nd3vil said:
Alright I'll try adding to my cm11 build
Click to expand...
Click to collapse
OP was updated
So what are the exact commands I should be using to cherry pick these and add into my build? Because I keep getting errors when trying to add...
---------- Post added at 11:56 PM ---------- Previous post was at 11:26 PM ----------
Well added in and tried to get it to build on CM11, and it kept erroring.
Is there any chance to work it on 4.2+?
thank you for making this right, compiling went flawlessly ,:good::goodnly i miss the option "use as lockscreen" ?
can you implement it ?
firebird11 said:
thank you for making this right, compiling went flawlessly ,:good::goodnly i miss the option "use as lockscreen" ?
can you implement it ?
Click to expand...
Click to collapse
great , happy to help
Hello,if they can help me
I Have this problem with the navbar sometimes .. with the active activedisplay.
When I have a so called loss with the way active this pocket wakes up but with the screen of unfreezing for fault android. When I block and unfreezing again is when it activates the activedisplay
I'm realy want add this feature to my rom, but i dont know how. i use with PA 4+ (beta3).
packhex said:
Hello,if they can help me
I Have this problem with the navbar sometimes .. with the active activedisplay.
When I have a so called loss with the way active this pocket wakes up but with the screen of unfreezing for fault android. When I block and unfreezing again is when it activates the activedisplay
Click to expand...
Click to collapse
can we see your source ?
what is the base you work on ?
ScoolAir said:
I'm realy want add this feature to my rom, but i dont know how. i use with PA 4+ (beta3).
Click to expand...
Click to collapse
did you upload your rom on git ?
codexc said:
can we see your source ?
what is the base you work on ?
Click to expand...
Click to collapse
UPS! He forgive ! :$ Base CM-11.0
Source
https://github.com/lis4rd0
Thanks!
codexc said:
did you upload your rom on git ?
Click to expand...
Click to collapse
I dont know how, you can tell me how and i'll upload?
ScoolAir said:
I dont know how, you can tell me how and i'll upload?
Click to expand...
Click to collapse
first learn how to use git, look here and here
after commiting the changes for active display, i'm getting the following:
Code:
frameworks/base/core/res/res/values/cr_symbols.xml:6: error: Symbol 'Theme.DeviceDefault.FloatingWindow' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/cr_symbols.xml:7: error: Symbol 'Theme.DeviceDefault.FloatingWindowLight' declared with <java-symbol> not defined
make: *** [/home/android/psx-light/out/target/common/obj/APPS/framework-res_intermediates/package-export.apk] Error 1
make: *** Deleting file `/home/android/psx-light/out/target/common/obj/APPS/framework-res_intermediates/package-export.apk'
make: *** Waiting for unfinished jobs....
This is what my cr_symbols.xml looks like:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Halo -->
<java-symbol type="style" name="Theme.DeviceDefault.FloatingWindow" />
<java-symbol type="style" name="Theme.DeviceDefault.FloatingWindowLight" />
<!-- Active display -->
<java-symbol type="dimen" name="system_bar_height" />
<java-symbol type="dimen" name="kg_widget_pager_horizontal_padding" />
<java-symbol type="dimen" name="kg_widget_pager_top_padding" />
<java-symbol type="dimen" name="kg_widget_pager_bottom_padding" />
<java-symbol type="dimen" name="keyguard_avatar_size" />
<java-symbol type="dimen" name="keyguard_avatar_frame_stroke_width" />
<java-symbol type="dimen" name="keyguard_avatar_frame_shadow_radius" />
<java-symbol type="dimen" name="kg_edge_swipe_region_size" />
<java-symbol type="dimen" name="kg_squashed_layout_threshold" />
<java-symbol type="dimen" name="kg_small_widget_height" />
<java-symbol type="dimen" name="lockscreen_target_inset" />
<java-symbol type="dimen" name="glowpad_notification_font_size" />
<java-symbol type="dimen" name="glowpad_notification_text_radius" />
<java-symbol type="dimen" name="glowpad_overflow_notifications_margin_top" />
</resources>
also, when i cherry-picked and used git status, i noticed that there would be some files that were modified and some deleted; would i need to use git add to add those files back and then git commit?
This guide will help you in customizing the statusbar clock and play with it a bit. This mod requires a deodexed LGSystemUI.apk. It took me about a month to cook this mod.This guide couldnt have been possible without @Ticklefish , so I thank him for his terrific knowledge and his willingness to help others.
Special thanks to @Spannaa for his guide based on which this one was made...Truly awesome both @Spannaa and @Ticklefish
Basically an inbuilt android function called "TEXTCLOCK" is used in the mod to display clock in html code
You need to have knowledge of compiling and decompiling ...Tools recommended:
Apktool 1.5.2 (coz it handles smali files perfectly, although we don't touch any of them in this mod)
Notepad++
Remember the variable used should be in format like :
<b>...</b> ..................................makes the the enclosed text bold
<i>...</i>...................................makes the the enclosed text italic
<font size=xx>...</font>............sets the font size of the enclosed text to X.0dip
<font fgcolor ="#ffffffff">...</>........sets the foreground colour of the enclosed text
<font bgcolor ="#ff000000">...</>... .sets the background colour of the enclosed text
fgcolor and bgcolor set the foreground and background color. Note that these attributes should be in hexcode like “#ff00ff00”.
<u>...</u>.... Underlines the text
<strike>...</strike>.... creates a strikethrough
Click to expand...
Click to collapse
There are lots of options for customizations available. You can change the strings above using any of the following.
d.............Day Of Month " 1"
dd.......... Day Of Month adds Zero before,"01"
EEEE......Day Of Week "Tuesday"
EEE........Week Day short "Tue"
MMMM....Month "SEPTEMBER"
MMM.......Month short "SEP"
MM..........Month adds zero before "09"
M............Month "9"
yyyy........Year "2014"
yy............Year Short "14"
h..............Hour 12 hour, 5
hh............Hour adds zero before "08"
H.............Hour 24 hour 5pm="5/17"
HH...........Hour 24 hour add zero before ie. 5am = "05"
In some ROMs if "HH" won't work replace the same with "kk" instead of "HH"
m.............Minute 5 min="5"
mm..........Minute add zero before 5min ="05"
s..............Second 7secs ="7"
ss............Second add zero before 7sec="07"
a..............AM/PM
Click to expand...
Click to collapse
Step 1
Decompile your LGSystemUI.apk. Edit /res/layout/statusbar.xml and find the line:
HTML:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
V.Imp: Do not delete this line...Just hide the clock by adding "andoid:visibility="gone""
Change it to
HTML:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:visibility="gone" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Step 2
Just below that line add the following code:
HTML:
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
VVV IMP: The above line must be below the stock clock code or the statusbar will crash
Step 3
Open /res/values/strings and add the following strings at the end.
HTML:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm</string>
You can change this to what is mentioned before with your choice of clock format
Step 4
Open/res/values/styles and find
HTML:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">18.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
Here you can customize size.bold,colour of the clock
Step 5
Recompile your LGSystemUI.apk.
Copy meta_inf folder and AndroidManifest.xml from original file to recompiled file.
Rename the recompiled file as LGSystemUI.apk
Push to /system/priv-app with 644 permissions.
Reboot and enjoy the mod.
For eg. my strings read as follows:
HTML:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm:ss<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm:ss</string>
Output of which is as under:
{
"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"
}
For those who arent profoud with compile/decompile...I am posting a G2 STOCK KK LGSystemUI.apk for download. It has
-Short day of the week.
-Clock with seconds
-Small am/pm
SCRRENSHOT:
Rename to LGSystemUI.apk and push to /system/priv-app with 644 permissions and delete the LGSystemUI.odex file.
Stock G2 KK Download
You have to play around a bit with the strings added to strings.xml in order to figure out your desired result
A lot of hardwork went into making this guide so please show appreciation by pressing thanks button. Please also give credit if youve used this in your MODS/ROM
thanks rastigo.
a clarification, if "HH" does not work, replace with "kk"
Very helpful!! Thanks!!
Thanks mate!!!
Great job
So I am finally testing this but have fun into an issue not sure what could have gone wrong, systemui is deodexed and the strings are there but 24 hour clock looks like this
And 12 hour clock same but last number changes
Any ideas @rastigo
XXZOMBIEPIKACHU WAS HERE
Share your strings.xml and statusbar.xml i will look and revert
rastigo said:
Share your strings.xml and statusbar.xml i will look and revert
Click to expand...
Click to collapse
It's okay I figured out what I was doing wrong, I was using textclock styles but had forgotten to install modded systemui with the strings for textclock added
XXZOMBIEPIKACHU WAS HERE
Yeah, possibilities are endless
rastigo said:
Yeah, possibilities are endless
Click to expand...
Click to collapse
so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?
XxZombiePikachu said:
so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?
Click to expand...
Click to collapse
You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless
rastigo said:
You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless
Click to expand...
Click to collapse
Well I left the center clock and added a clock(same code as center one) to the left with visibility gone and textclock and then used the format EEE, MMM/dd/yy but it still includes the clock
XXZOMBIEPIKACHU WAS HERE
Send me your statusbar.xml and strings.xml. Will see and revert
XxZombiePikachu said:
Well I left the center clock and added a clock(same code as center one) to the left with visibility gone and textclock and then used the format EEE, MMM/dd/yy but it still includes the clock
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
rastigo said:
Send me your statusbar.xml and strings.xml. Will see and revert
Click to expand...
Click to collapse
If you can include that xml in a post here, I can take a look for you as well if you want. :good:
rastigo said:
Send me your statusbar.xml and strings.xml. Will see and revert
Click to expand...
Click to collapse
Ticklefish said:
If you can include that xml in a post here, I can take a look for you as well if you want. :good:
Click to expand...
Click to collapse
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
XxZombiePikachu said:
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
Two clocks again, eh? This may just be caused the original clock line. If you can find that xml, I'm sure I'll be able to spot the problem for you. :highfive:
(Nice wallpaper, btw..)
Ticklefish said:
Two clocks again, eh? This may just be caused the original clock line. If you can find that xml, I'm sure I'll be able to spot the problem for you. :highfive:
(Nice wallpaper, btw..)
Click to expand...
Click to collapse
@XxZombiePikachu, Here are 2 workaround options , try and let me know if any of them works. I looked at your files, they seem fine to me but I dont know where is the second clock drawn from. Anyways @Ticklefish will figure out soon (he is the best with xml).
Meanwhile try the attached workarounds and let me know . Files are HERE
Ticklefish said:
(Nice wallpaper, btw..)
Click to expand...
Click to collapse
well mr@Ticklefish here you go, it is one of the g3 default wallpapers
rastigo said:
@XxZombiePikachu, Here are 2 workaround options , try and let me know if any of them works. I looked at your files, they seem fine to me but I dont know where is the second clock drawn from. Anyways @Ticklefish will figure out soon (he is the best with xml).
Meanwhile try the attached workarounds and let me know . Files are HERE
Click to expand...
Click to collapse
ok so workaround number one has the same result while workaround number two doesn't compile because you made an error in the status_bar.xml in line 26 you either forgot to finish the line or accidentally added that piece of code:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
I know i might have messed with the files in a hurry. Guess we have to wait for @Ticklefish to show us a way out. Just a thought, can you check signal_cluster.xml to see if any clock line exist in there.
As far as G2 kk rom, it works perfectly
XxZombiePikachu said:
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
Judging from your screenshot, I'd say that your original clock is still showing. Which is interesting because you should have hidden it when you added the attribute 'android:visibility="gone"' to the clock line.
There's a few possible solutions here.
The first thing we could try is removing the '@id/clock' from the TextClock line. This id isn't needed at all. It's needed for the ordinary clock so that the phone can process the clock smali ('LGSystemUI.apk/com/android/systemui/statusbar/policy/Clock.smali') and it knows what part of the statusbar to update.
But TextClock is a fundamental part of Android, there is no smali to reference to. So it's possible that having these two id's could be causing a conflict of some kind which makes the original clock stay visible.
So try changing this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" [COLOR="Red"]android:id="@id/clock"[/COLOR] android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
to this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work, it's possible that something in your rom is overriding that visibility attribute and forcing the clock to be visible. This happens in my rom, I can disable/enable the clock in my Settings app, so my clock line has 'android:visibility="gone"' already.
In which case, we just need to edit the clock line so it's essentially invisible, even if it's technically visible. To do that, we just need to change the width and height.
Like this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" [COLOR="Red"]android:layout_width="0.0dip" android:layout_height="0.0dip"[/COLOR] android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work either, then we need to work out just what you're seeing in your statusbar. The easiest way to do that is simply to have the clock and the TextClock in different colours..
Code:
<com.android.systemui.statusbar.policy.Clock [COLOR="Red"]android:textColor="#ff0000ff"[/COLOR] android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" [COLOR="Red"]android:textColor="#ff00ff00"[/COLOR] android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
This will make the normal clock bright blue and the TextClock bright green. Once you've finished flashing your recompiled apk, you'll be able to see just where that clock on the left is coming from.
Then we will have a better idea of how to get rid of it.
Let me know how it goes!
Ticklefish said:
Judging from your screenshot, I'd say that your original clock is still showing. Which is interesting because you should have hidden it when you added the attribute 'android:visibility="gone"' to the clock line.
There's a few possible solutions here.
The first thing we could try is removing the '@id/clock' from the TextClock line. This id isn't needed at all. It's needed for the ordinary clock so that the phone can process the clock smali ('LGSystemUI.apk/com/android/systemui/statusbar/policy/Clock.smali') and it knows what part of the statusbar to update.
But TextClock is a fundamental part of Android, there is no smali to reference to. So it's possible that having these two id's could be causing a conflict of some kind which makes the original clock stay visible.
So try changing this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" [COLOR="Red"]android:id="@id/clock"[/COLOR] android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
to this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work, it's possible that something in your rom is overriding that visibility attribute and forcing the clock to be visible. This happens in my rom, I can disable/enable the clock in my Settings app, so my clock line has 'android:visibility="gone"' already.
In which case, we just need to edit the clock line so it's essentially invisible, even if it's technically visible. To do that, we just need to change the width and height.
Like this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" [COLOR="Red"]android:layout_width="0.0dip" android:layout_height="0.0dip"[/COLOR] android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work either, then we need to work out just what you're seeing in your statusbar. The easiest way to do that is simply to have the clock and the TextClock in different colours..
Code:
<com.android.systemui.statusbar.policy.Clock [COLOR="Red"]android:textColor="#ff0000ff"[/COLOR] android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" [COLOR="Red"]android:textColor="#ff00ff00"[/COLOR] android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
This will make the normal clock bright blue and the TextClock bright green. Once you've finished flashing your recompiled apk, you'll be able to see just where that clock on the left is coming from.
Then we will have a better idea of how to get rid of it.
Let me know how it goes!
Click to expand...
Click to collapse
Alright then as soon as I get home will be sure to get to compiling/testing and report will my findings
XXZOMBIEPIKACHU WAS HERE
Hey fellows,
I am trying to match statusbar color with action bar. But that doesnt fit. Statusbar doesnt get the color of actionbar. see the screenshot
{
"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"
}
it matches with the color of background not with the actionbar. it flows behind the action bar. I use those codes :
HTML:
<style name="CalendarTheme.WithActionBar" parent="@android:style/Theme.Holo.Light">
<item name="android:windowNoTitle">false</item>
<item name="android:startYear">1970</item>
<item name="android:endYear">2036</item>
<item name="android:windowActionBar">true</item>
<item name="android:windowContentOverlay">@drawable/shadow</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="android:fitsSystemWindows">true</item>
<item name="android:windowTranslucentNavigation">false</item>
</style>
I need help Thank you in advance ...
Tinted Status Bar
Hello,
If your app minSdkVersion is set to 'L' (So its compatible with Android L Preview and above), you can choose to add this:
Code:
<item name="android:colorPrimaryDark">Same color as actionbar here</item>
and set this to false:
Code:
<item name="android:windowTranslucentStatus">[B]true --> false[/B]</item>
<item name="android:fitsSystemWindows">[B]true --> false[/B]</item>
If your app minSdkVersion is set to 19 or higher you could do this:
Code:
<item name="android:windowBackground">Same color as actionbar here</item>
WARNING: this can couse that some other areas are going tho have the same color as the window background/actionbar color.
if that hapens you can add this to the area where that hapens(in the layout_name.xml):
Code:
android:background="Your color"
This things do only work on android 4.4 (API 19) and above.
Netherlander said:
Hello,
If your app minSdkVersion is set to 'L' (So its compatible with Android L Preview and above), you can choose to add this:
Code:
<item name="android:colorPrimaryDark">Same color as actionbar here</item>
and set this to false:
Code:
<item name="android:windowTranslucentStatus">[B]true --> false[/B]</item>
<item name="android:fitsSystemWindows">[B]true --> false[/B]</item>
If your app minSdkVersion is set to 19 or higher you could do this:
Code:
<item name="android:windowBackground">Same color as actionbar here</item>
WARNING: this can couse that some other areas are going tho have the same color as the window background/actionbar color.
if that hapens you can add this to the area where that hapens(in the layout_name.xml):
Code:
android:background="Your color"
This things do only work on android 4.4 (API 19) and above.
Click to expand...
Click to collapse
Thanks! You rock my friend ... but could you give an example about '' <item name="android:windowBackground">Same color as actionbar here</item> ''
where i need to code it ? I mean in style.xml but what line? Base theme line? Btw I am on KitKat.
SmiLeToLife said:
where i need to code it ? I mean in style.xml but what line? Base theme line?
Click to expand...
Click to collapse
You can put it between
Code:
<style name="CalendarTheme.WithActionBar" parent="@android:style/Theme.Holo.Light">
and
Code:
</style>
it doesn't matter where you do that.
Like this:
Code:
<style name="CalendarTheme.WithActionBar" parent="@android:style/Theme.Holo.Light">
[B]<item name="android:windowBackground">Same color as actionbar here</item>[/B]
<item name="android:windowNoTitle">false</item>
...
If this gives an error:
Code:
<item name="android:windowBackground">[B]#ABC123[/B]</item>
try then:
Code:
<item name="android:windowBackground">[B]@color/MyActionBarColor[/B]</item>
and in colors.xml (or something with another name) this:
Code:
<resources>
<color name="MyActionBarColor">#ABC123</color>
</resources>
Set the color of the app in the per app settings of the tinted statusbar
jampy10 said:
Set the color of the app in the per app settings of the tinted statusbar
Click to expand...
Click to collapse
Not everyone has tinted statusbar/xposed.
If you develop an android app that is disigned for a great number of people I reccomedend not to do that.
If you develop an android app that is disigned for people that have xposed and tinted statusbar, than is that a good idea.
Or if you want that your app supports android 4.3 and higher (some specific devices above android 4.0) this is also a good idea.
Anyway what you choose, here are the links for tinted statusbar and xposed:
tinted statusbar
Xposed
Netherlander said:
Not everyone has tinted statusbar/xposed.
If you develop an android app that is disigned for a great number of people I reccomedend not to do that.
If you develop an android app that is disigned for people that have xposed and tinted statusbar, than is that a good idea.
Or if you want that your app supports android 4.3 and higher (some specific devices above android 4.0) this is also a good idea.
Anyway what you choose, here are the links for tinted statusbar and xposed:
tinted statusbar
Xposed
Click to expand...
Click to collapse
tinted status bar module is beta. that's why i wanted to edit styles. For instance when you use tinted status bar, it takes 1-2 sec statusbar to match the color of action bar. The other issue is if your action bar is red and your battery icon is white when status bar and action bar are tinted then your battery icon might get black .
i have also problem with my tinted status bar that doesnt macth color from facebook even i set it
Netherlander said:
You can put it between
Code:
<style name="CalendarTheme.WithActionBar" parent="@android:style/Theme.Holo.Light">
and
Code:
</style>
it doesn't matter where you do that.
Like this:
Code:
<style name="CalendarTheme.WithActionBar" parent="@android:style/Theme.Holo.Light">
[B]<item name="android:windowBackground">Same color as actionbar here</item>[/B]
<item name="android:windowNoTitle">false</item>
...
If this gives an error:
Code:
<item name="android:windowBackground">[B]#ABC123[/B]</item>
try then:
Code:
<item name="android:windowBackground">[B]@color/MyActionBarColor[/B]</item>
and in colors.xml (or something with another name) this:
Code:
<resources>
<color name="MyActionBarColor">#ABC123</color>
</resources>
Click to expand...
Click to collapse
If you are going to do what I sad a few post ago, your statusbar isn't going to be the same color, it will be gradient.
So from black at the top to purple at the bottom of the statusbar
SmartPoppy said:
i have also problem with my tinted status bar that doesnt macth color from facebook even i set it
Click to expand...
Click to collapse
go to per app titnts and facebook, then all activities status bar tint, paste that code ff3b5b98
SmiLeToLife said:
go to per app titnts and facebook, then all activities status bar tint, paste that code ff3b5b98
Click to expand...
Click to collapse
thanks sir! it works!