Improved graphics for the intruder alert.
Change-Id: I9aa6c8995da39f332b724fabe67ed5efe584552f
This commit is contained in:
14
core/res/res/anim/priority_alert_enter.xml
Normal file
14
core/res/res/anim/priority_alert_enter.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
>
|
||||||
|
<scale
|
||||||
|
android:interpolator="@android:anim/overshoot_interpolator"
|
||||||
|
android:fromXScale="0.7" android:toXScale="1.0"
|
||||||
|
android:fromYScale="0.7" android:toYScale="1.0"
|
||||||
|
android:pivotX="50%" android:pivotY="50%"
|
||||||
|
android:duration="@android:integer/config_shortAnimTime" />
|
||||||
|
<alpha
|
||||||
|
android:interpolator="@android:anim/decelerate_interpolator"
|
||||||
|
android:fromAlpha="0.0" android:toAlpha="1.0"
|
||||||
|
android:duration="@android:integer/config_shortAnimTime" />
|
||||||
|
</set>
|
14
core/res/res/anim/priority_alert_exit.xml
Normal file
14
core/res/res/anim/priority_alert_exit.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
>
|
||||||
|
<scale
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:fromXScale="1.0" android:toXScale="0.7"
|
||||||
|
android:fromYScale="1.0" android:toYScale="0.7"
|
||||||
|
android:pivotX="50%" android:pivotY="50%"
|
||||||
|
android:duration="@android:integer/config_shortAnimTime" />
|
||||||
|
<alpha
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:fromAlpha="1.0" android:toAlpha="0.0"
|
||||||
|
android:duration="@android:integer/config_shortAnimTime" />
|
||||||
|
</set>
|
@ -88,6 +88,13 @@
|
|||||||
<item name="windowExitAnimation">@anim/status_bar_exit</item>
|
<item name="windowExitAnimation">@anim/status_bar_exit</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- {@hide} -->
|
||||||
|
<style name="Animation.StatusBar.IntruderAlert"
|
||||||
|
parent="@android:style/Animation.StatusBar">
|
||||||
|
<item name="android:windowEnterAnimation">@anim/priority_alert_enter</item>
|
||||||
|
<item name="android:windowExitAnimation">@anim/priority_alert_exit</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- Standard animations for a translucent window or activity. This
|
<!-- Standard animations for a translucent window or activity. This
|
||||||
style is <em>not<em> used by default for the translucent theme
|
style is <em>not<em> used by default for the translucent theme
|
||||||
(since translucent activities are a special case that have no
|
(since translucent activities are a special case that have no
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
23
packages/SystemUI/res/drawable/alert_bar_background.xml
Normal file
23
packages/SystemUI/res/drawable/alert_bar_background.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2008 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true"
|
||||||
|
android:drawable="@drawable/alert_bar_background_pressed" />
|
||||||
|
<item
|
||||||
|
android:drawable="@drawable/alert_bar_background_normal" />
|
||||||
|
</selector>
|
||||||
|
|
@ -21,29 +21,35 @@
|
|||||||
<!-- android:background="@drawable/status_bar_closed_default_background" -->
|
<!-- android:background="@drawable/status_bar_closed_default_background" -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:background="@drawable/alert_bar_background"
|
android:layout_height="32dip"
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:focusable="true"
|
android:paddingLeft="8dip"
|
||||||
android:descendantFocusability="afterDescendants"
|
android:paddingRight="8dip"
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/intruder_alert_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingLeft="6dip"
|
android:gravity="center"
|
||||||
android:animationCache="false"
|
android:animationCache="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/alert_bar_background"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:descendantFocusability="afterDescendants"
|
||||||
>
|
>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/alertIcon"
|
android:id="@+id/alertIcon"
|
||||||
android:layout_width="25dip"
|
android:layout_width="25dip"
|
||||||
android:layout_height="25dip"
|
android:layout_height="25dip"
|
||||||
|
android:paddingLeft="6dip"
|
||||||
android:layout_marginRight="8dip"
|
android:layout_marginRight="8dip"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/alertText"
|
android:id="@+id/alertText"
|
||||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.EventContent"
|
android:textAppearance="@style/TextAppearance.StatusBar.IntruderAlert"
|
||||||
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"
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.StatusBar.IntruderAlert"
|
||||||
|
parent="@android:style/TextAppearance.StatusBar">
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -357,7 +357,7 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks
|
|||||||
|
|
||||||
lp = new WindowManager.LayoutParams(
|
lp = new WindowManager.LayoutParams(
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
height,
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
|
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
|
||||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||||
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||||
@ -366,9 +366,9 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks
|
|||||||
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
|
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
|
||||||
PixelFormat.TRANSLUCENT);
|
PixelFormat.TRANSLUCENT);
|
||||||
lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
|
lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL;
|
||||||
lp.y += height * 1.5; // for now
|
lp.y += height * 1.5; // FIXME
|
||||||
lp.setTitle("IntruderAlert");
|
lp.setTitle("IntruderAlert");
|
||||||
lp.windowAnimations = android.R.style.Animation_Dialog;
|
lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar_IntruderAlert;
|
||||||
|
|
||||||
WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp);
|
WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp);
|
||||||
}
|
}
|
||||||
@ -417,7 +417,8 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks
|
|||||||
iconView.getStatusBarIcon()));
|
iconView.getStatusBarIcon()));
|
||||||
alertText.setText(notification.notification.tickerText);
|
alertText.setText(notification.notification.tickerText);
|
||||||
|
|
||||||
mIntruderAlertView.setOnClickListener(
|
View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content);
|
||||||
|
button.setOnClickListener(
|
||||||
new Launcher(notification.notification.contentIntent,
|
new Launcher(notification.notification.contentIntent,
|
||||||
notification.pkg, notification.tag, notification.id));
|
notification.pkg, notification.tag, notification.id));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user