Merge "New shadowy status bar, direct from Z'ha'dum." into kraken
|
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 3.2 KiB |
@@ -76,28 +76,28 @@
|
|||||||
android:paddingTop="2dip"
|
android:paddingTop="2dip"
|
||||||
android:paddingRight="10dip">
|
android:paddingRight="10dip">
|
||||||
<TextView
|
<TextView
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.Ticker"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="#ff000000" />
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.Ticker"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="#ff000000" />
|
/>
|
||||||
</com.android.server.status.TickerView>
|
</com.android.server.status.TickerView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.android.server.status.DateView android:id="@+id/date"
|
<com.android.server.status.DateView android:id="@+id/date"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.Icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="center_vertical|left"
|
android:gravity="center_vertical|left"
|
||||||
android:paddingLeft="6px"
|
android:paddingLeft="6px"
|
||||||
android:paddingRight="6px"
|
android:paddingRight="6px"
|
||||||
android:textColor="?android:attr/textColorPrimaryInverse"
|
|
||||||
android:background="@drawable/statusbar_background"
|
android:background="@drawable/statusbar_background"
|
||||||
/>
|
/>
|
||||||
</com.android.server.status.StatusBarView>
|
</com.android.server.status.StatusBarView>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
/>
|
/>
|
||||||
<TextView android:id="@+id/spnLabel"
|
<TextView android:id="@+id/spnLabel"
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginBottom="1dp"
|
android:layout_marginBottom="1dp"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="#ff000000"
|
android:textColor="?android:attr/textColorPrimaryInverse"
|
||||||
android:text="@string/status_bar_clear_all_button"
|
android:text="@string/status_bar_clear_all_button"
|
||||||
style="?android:attr/buttonStyle"
|
style="?android:attr/buttonStyle"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/title_bar_portrait"
|
android:background="@drawable/title_bar_portrait"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBarTitle"
|
android:textAppearance="@style/TextAppearance.StatusBar.Title"
|
||||||
android:text="@string/status_bar_no_notifications_title"
|
android:text="@string/status_bar_no_notifications_title"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/title_bar_portrait"
|
android:background="@drawable/title_bar_portrait"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBarTitle"
|
android:textAppearance="@style/TextAppearance.StatusBar.Title"
|
||||||
android:text="@string/status_bar_ongoing_events_title"
|
android:text="@string/status_bar_ongoing_events_title"
|
||||||
/>
|
/>
|
||||||
<LinearLayout android:id="@+id/ongoingItems"
|
<LinearLayout android:id="@+id/ongoingItems"
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/title_bar_portrait"
|
android:background="@drawable/title_bar_portrait"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBarTitle"
|
android:textAppearance="@style/TextAppearance.StatusBar.Title"
|
||||||
android:text="@string/status_bar_latest_events_title"
|
android:text="@string/status_bar_latest_events_title"
|
||||||
/>
|
/>
|
||||||
<LinearLayout android:id="@+id/latestItems"
|
<LinearLayout android:id="@+id/latestItems"
|
||||||
|
|||||||
@@ -18,16 +18,15 @@
|
|||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/arrow_down_float"/>
|
android:src="@drawable/arrow_down_float"/>
|
||||||
<TextView android:id="@+id/title"
|
<TextView android:id="@+id/title"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:fadingEdge="horizontal"
|
android:fadingEdge="horizontal"
|
||||||
android:textStyle="bold"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
android:textColor="#ff000000" />
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -35,23 +34,22 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
>
|
>
|
||||||
<TextView android:id="@+id/text"
|
<TextView android:id="@+id/text"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textColor="#ff000000"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:fadingEdge="horizontal"
|
android:fadingEdge="horizontal"
|
||||||
android:textSize="14sp"
|
|
||||||
android:paddingLeft="4dp"
|
android:paddingLeft="4dp"
|
||||||
/>
|
/>
|
||||||
<android.widget.DateTimeView android:id="@+id/time"
|
<android.widget.DateTimeView android:id="@+id/time"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="14sp"
|
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:textColor="#ff000000" />
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -187,11 +187,26 @@
|
|||||||
|
|
||||||
<!-- Status Bar Styles -->
|
<!-- Status Bar Styles -->
|
||||||
|
|
||||||
<style name="TextAppearance.StatusBarTitle">
|
<style name="TextAppearance.StatusBar">
|
||||||
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
|
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
|
||||||
<item name="android:textStyle">bold</item>
|
|
||||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
|
<style name="TextAppearance.StatusBar.Ticker">
|
||||||
|
</style>
|
||||||
|
<style name="TextAppearance.StatusBar.Title">
|
||||||
|
<item name="android:textStyle">bold</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.StatusBar.Icon">
|
||||||
|
<item name="android:textStyle">bold</item>
|
||||||
|
</style>
|
||||||
|
<style name="TextAppearance.StatusBar.EventContent">
|
||||||
|
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
|
||||||
|
</style>
|
||||||
|
<style name="TextAppearance.StatusBar.EventContent.Title">
|
||||||
|
<item name="android:textSize">18sp</item>
|
||||||
|
<item name="android:textStyle">bold</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- Widget Styles -->
|
<!-- Widget Styles -->
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,11 @@ class StatusBarIcon {
|
|||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case IconData.TEXT: {
|
case IconData.TEXT: {
|
||||||
TextView t;
|
TextView t;
|
||||||
t = new TextView(context);
|
t = new TextView(context, null, com.android.internal.R.style.TextAppearance_StatusBar_Icon);
|
||||||
mTextView = t;
|
mTextView = t;
|
||||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
t.setTextSize(16);
|
|
||||||
t.setTextColor(0xff000000);
|
|
||||||
t.setTypeface(Typeface.DEFAULT_BOLD);
|
|
||||||
t.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
|
t.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
|
||||||
t.setPadding(6, 0, 0, 0);
|
t.setPadding(6, 0, 0, 0);
|
||||||
t.setLayoutParams(layoutParams);
|
t.setLayoutParams(layoutParams);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import android.content.Intent;
|
|||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
@@ -49,7 +50,10 @@ import android.telephony.ServiceState;
|
|||||||
import android.telephony.SignalStrength;
|
import android.telephony.SignalStrength;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
|
import android.text.style.CharacterStyle;
|
||||||
import android.text.style.RelativeSizeSpan;
|
import android.text.style.RelativeSizeSpan;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.text.style.StyleSpan;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -86,6 +90,12 @@ public class StatusBarPolicy {
|
|||||||
// message codes for the handler
|
// message codes for the handler
|
||||||
private static final int EVENT_BATTERY_CLOSE = 4;
|
private static final int EVENT_BATTERY_CLOSE = 4;
|
||||||
|
|
||||||
|
private static final int AM_PM_STYLE_NORMAL = 0;
|
||||||
|
private static final int AM_PM_STYLE_SMALL = 1;
|
||||||
|
private static final int AM_PM_STYLE_GONE = 2;
|
||||||
|
|
||||||
|
private static final int AM_PM_STYLE = AM_PM_STYLE_GONE;
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final StatusBarService mService;
|
private final StatusBarService mService;
|
||||||
private final Handler mHandler = new StatusBarHandler();
|
private final Handler mHandler = new StatusBarHandler();
|
||||||
@@ -576,31 +586,33 @@ public class StatusBarPolicy {
|
|||||||
* add dummy characters around it to let us find it again after
|
* add dummy characters around it to let us find it again after
|
||||||
* formatting and change its size.
|
* formatting and change its size.
|
||||||
*/
|
*/
|
||||||
int a = -1;
|
if (AM_PM_STYLE != AM_PM_STYLE_NORMAL) {
|
||||||
boolean quoted = false;
|
int a = -1;
|
||||||
for (int i = 0; i < format.length(); i++) {
|
boolean quoted = false;
|
||||||
char c = format.charAt(i);
|
for (int i = 0; i < format.length(); i++) {
|
||||||
|
char c = format.charAt(i);
|
||||||
|
|
||||||
if (c == '\'') {
|
if (c == '\'') {
|
||||||
quoted = !quoted;
|
quoted = !quoted;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!quoted && c == 'a') {
|
||||||
|
a = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!quoted && c == 'a') {
|
if (a >= 0) {
|
||||||
a = i;
|
// Move a back so any whitespace before the AM/PM is also in the alternate size.
|
||||||
break;
|
final int b = a;
|
||||||
|
while (a > 0 && Character.isWhitespace(format.charAt(a-1))) {
|
||||||
|
a--;
|
||||||
|
}
|
||||||
|
format = format.substring(0, a) + MAGIC1 + format.substring(a, b)
|
||||||
|
+ "a" + MAGIC2 + format.substring(b + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a >= 0) {
|
|
||||||
// Move a back so any whitespace before the AM/PM is also in the alternate size.
|
|
||||||
final int b = a;
|
|
||||||
while (a > 0 && Character.isWhitespace(format.charAt(a-1))) {
|
|
||||||
a--;
|
|
||||||
}
|
|
||||||
format = format.substring(0, a) + MAGIC1 + format.substring(a, b)
|
|
||||||
+ "a" + MAGIC2 + format.substring(b + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
mClockFormat = sdf = new SimpleDateFormat(format);
|
mClockFormat = sdf = new SimpleDateFormat(format);
|
||||||
mClockFormatString = format;
|
mClockFormatString = format;
|
||||||
} else {
|
} else {
|
||||||
@@ -608,22 +620,31 @@ public class StatusBarPolicy {
|
|||||||
}
|
}
|
||||||
String result = sdf.format(mCalendar.getTime());
|
String result = sdf.format(mCalendar.getTime());
|
||||||
|
|
||||||
int magic1 = result.indexOf(MAGIC1);
|
if (AM_PM_STYLE != AM_PM_STYLE_NORMAL) {
|
||||||
int magic2 = result.indexOf(MAGIC2);
|
int magic1 = result.indexOf(MAGIC1);
|
||||||
|
int magic2 = result.indexOf(MAGIC2);
|
||||||
|
|
||||||
if (magic1 >= 0 && magic2 > magic1) {
|
if (magic1 >= 0 && magic2 > magic1) {
|
||||||
SpannableStringBuilder formatted = new SpannableStringBuilder(result);
|
SpannableStringBuilder formatted = new SpannableStringBuilder(result);
|
||||||
|
|
||||||
formatted.setSpan(new RelativeSizeSpan(0.7f), magic1, magic2,
|
if (AM_PM_STYLE == AM_PM_STYLE_GONE) {
|
||||||
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
formatted.delete(magic1, magic2+1);
|
||||||
|
} else {
|
||||||
|
if (AM_PM_STYLE == AM_PM_STYLE_SMALL) {
|
||||||
|
CharacterStyle style = new RelativeSizeSpan(0.7f);
|
||||||
|
formatted.setSpan(style, magic1, magic2,
|
||||||
|
Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||||
|
}
|
||||||
|
|
||||||
formatted.delete(magic2, magic2 + 1);
|
formatted.delete(magic2, magic2 + 1);
|
||||||
formatted.delete(magic1, magic1 + 1);
|
formatted.delete(magic1, magic1 + 1);
|
||||||
|
}
|
||||||
|
|
||||||
return formatted;
|
return formatted;
|
||||||
} else {
|
}
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void updateClock() {
|
private final void updateClock() {
|
||||||
|
|||||||