Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cddc98a authored by Joe Onorato's avatar Joe Onorato
Browse files

Deal with more notifications than fit on screen.

Change-Id: I432b9ee73a473fe4af8b0caeede4993c67be6518
parent 561d3858
Loading
Loading
Loading
Loading
+19 −24
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* apps/common/assets/default/default/skins/StatusBar.xml
**
** Copyright 2006, 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.
*/
  Copyright (C) 2006 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.
-->

<!--    android:background="@drawable/status_bar_closed_default_background" -->
<com.android.systemui.statusbar.tablet.NotificationPanel
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="540dp"
    android:layout_width="match_parent"
    android:animateLayoutChanges="true"
    android:background="@drawable/bg_scrim_notification"
    android:paddingTop="32dp"
    android:paddingBottom="32dp"
    android:orientation="vertical"
    android:gravity="right"
    >

    <com.android.systemui.statusbar.tablet.NotificationTitleArea
        android:id="@+id/title_area"
        android:layout_height="wrap_content"
        android:layout_height="160dp"
        android:layout_width="384dp"
        android:layout_above="@+id/content_frame"
        android:layout_marginLeft="24dp"
        android:paddingBottom="16dp"
        android:paddingTop="20dp"
        android:orientation="vertical"
        android:animateLayoutChanges="true"
        android:layout_alignParentRight="true"
        >

        <com.android.systemui.statusbar.tablet.HoloClock
@@ -143,8 +140,6 @@
        android:id="@+id/content_frame"
        android:layout_height="wrap_content"
        android:layout_width="408dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        >
        <ScrollView
            android:id="@+id/notificationScroller"
+27 −4
Original line number Diff line number Diff line
@@ -19,16 +19,16 @@ package com.android.systemui.statusbar.tablet;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Slog;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.systemui.R;

public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
public class NotificationPanel extends LinearLayout implements StatusBarPanel,
        View.OnClickListener {
    static final String TAG = "NotificationPanel";

@@ -71,6 +71,29 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
        }
    }

    /**
     * We need to be aligned at the bottom.  LinearLayout can't do this, so instead,
     * let LinearLayout do all the hard work, and then shift everything down to the bottom.
     */
    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        // We know that none of our children are GONE, so don't worry about skipping GONE views.
        final int N = getChildCount();
        if (N == 0) {
            return;
        }
        final int allocatedBottom = getChildAt(N-1).getBottom();
        final int shift = b - allocatedBottom - getPaddingBottom();
        if (shift <= 0) {
            return;
        }
        for (int i=0; i<N; i++) {
            final View c = getChildAt(i);
            c.layout(c.getLeft(), c.getTop() + shift, c.getRight(), c.getBottom() + shift);
        }
    }

    public void onClick(View v) {
        if (v == mSettingsButton) {
            switchToSettingsMode();
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class TabletStatusBar extends StatusBar {
        mStatusBarView.setIgnoreChildren(0, mNotificationTrigger, mNotificationPanel);

        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN