Make notification panel fullscreen on tablets.
We only inset the notification themselves on tablets, and also the header when not on the lockscreen (on the lockscreen, the header must be full width so the icons are at the correct location). Change-Id: I85c8a4559f59b016432dab4a73236352233d9159
This commit is contained in:
@@ -50,9 +50,8 @@
|
||||
/>
|
||||
|
||||
<com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer
|
||||
style="@style/NotificationsQuickSettings"
|
||||
android:id="@+id/notification_container_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false">
|
||||
|
||||
@@ -89,13 +88,7 @@
|
||||
|
||||
</com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>
|
||||
|
||||
|
||||
<include layout="@layout/status_bar_expanded_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/status_bar_header_height"
|
||||
android:layout_marginLeft="@dimen/notification_side_padding"
|
||||
android:layout_marginRight="@dimen/notification_side_padding"
|
||||
/>
|
||||
<include layout="@layout/status_bar_expanded_header" />
|
||||
|
||||
<include
|
||||
layout="@layout/keyguard_bottom_area"
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
style="@style/StatusBarHeader"
|
||||
android:layout_height="@dimen/status_bar_header_height"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="@dimen/notification_side_padding"
|
||||
android:paddingEnd="@dimen/notification_side_padding"
|
||||
android:baselineAligned="false"
|
||||
android:elevation="10dp"
|
||||
>
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<include layout="@layout/status_bar_expanded"
|
||||
style="@style/StatusBarExpanded"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
</com.android.systemui.statusbar.phone.PanelHolder>
|
||||
|
||||
|
||||
@@ -19,9 +19,14 @@
|
||||
<item name="android:layout_width">480dp</item>
|
||||
</style>
|
||||
|
||||
<style name="StatusBarExpanded">
|
||||
<style name="NotificationsQuickSettings">
|
||||
<item name="android:layout_width">@dimen/notification_panel_width</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_gravity">start|top</item>
|
||||
<item name="android:layout_gravity">top|center_horizontal</item>
|
||||
</style>
|
||||
|
||||
<style name="StatusBarHeader">
|
||||
<item name="android:layout_width">@dimen/notification_panel_width</item>
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -171,10 +171,12 @@
|
||||
|
||||
<style name="systemui_theme" parent="@android:style/Theme.DeviceDefault" />
|
||||
|
||||
<style name="StatusBarExpanded">
|
||||
<style name="NotificationsQuickSettings">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
<item name="android:layout_gravity">start|top</item>
|
||||
</style>
|
||||
|
||||
<style name="StatusBarHeader">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -42,6 +42,9 @@ public class StatusBarHeaderView extends RelativeLayout {
|
||||
private int mExpandedHeight;
|
||||
private int mKeyguardHeight;
|
||||
|
||||
private int mKeyguardWidth = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
private int mNormalWidth;
|
||||
|
||||
private boolean mKeyguardShowing;
|
||||
|
||||
public StatusBarHeaderView(Context context, AttributeSet attrs) {
|
||||
@@ -65,6 +68,7 @@ public class StatusBarHeaderView extends RelativeLayout {
|
||||
R.dimen.status_bar_header_height_expanded);
|
||||
mKeyguardHeight = getResources().getDimensionPixelSize(
|
||||
R.dimen.status_bar_header_height_keyguard);
|
||||
mNormalWidth = getLayoutParams().width;
|
||||
}
|
||||
|
||||
public int getCollapsedHeight() {
|
||||
@@ -107,6 +111,15 @@ public class StatusBarHeaderView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWidth() {
|
||||
int width = mKeyguardShowing ? mKeyguardWidth : mNormalWidth;
|
||||
ViewGroup.LayoutParams lp = getLayoutParams();
|
||||
if (width != lp.width) {
|
||||
lp.width = width;
|
||||
setLayoutParams(lp);
|
||||
}
|
||||
}
|
||||
|
||||
public void setExpansion(float height) {
|
||||
if (height < mCollapsedHeight) {
|
||||
height = mCollapsedHeight;
|
||||
@@ -140,6 +153,7 @@ public class StatusBarHeaderView extends RelativeLayout {
|
||||
setTranslationZ(0);
|
||||
}
|
||||
updateHeights();
|
||||
updateWidth();
|
||||
}
|
||||
|
||||
public void setUserInfoController(UserInfoController userInfoController) {
|
||||
|
||||
Reference in New Issue
Block a user