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

Commit 8595a3dd authored by Joe Onorato's avatar Joe Onorato
Browse files

Show the number in the expanded notification instead of in the bar.

Change-Id: I248b4fe1732ed290e9f3f9c094de4544a0e396ab
parent 46439cec
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -32774,6 +32774,19 @@
<parameter name="highPriority" type="boolean">
</parameter>
</method>
<method name="setIconNumber"
 return="android.app.Notification.Builder"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="number" type="int">
</parameter>
</method>
<method name="setLargeIcon"
 return="android.app.Notification.Builder"
 abstract="false"
@@ -32858,19 +32871,6 @@
<parameter name="level" type="int">
</parameter>
</method>
<method name="setSmallIconNumber"
 return="android.app.Notification.Builder"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="number" type="int">
</parameter>
</method>
<method name="setSound"
 return="android.app.Notification.Builder"
 abstract="false"
+20 −11
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import java.text.NumberFormat;
import java.util.Date;

import android.app.PendingIntent;
@@ -30,6 +31,7 @@ import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.util.Slog;
import android.view.View;
import android.widget.RemoteViews;

/**
@@ -607,7 +609,7 @@ public class Notification implements Parcelable
        private long mWhen;
        private int mSmallIcon;
        private int mSmallIconLevel;
        private int mSmallIconNumber;
        private int mNumber;
        private CharSequence mContentTitle;
        private CharSequence mContentText;
        private CharSequence mContentInfo;
@@ -648,11 +650,6 @@ public class Notification implements Parcelable
            return this;
        }

        public Builder setSmallIconNumber(int number) {
            mSmallIconNumber = number;
            return this;
        }

        public Builder setContentTitle(CharSequence title) {
            mContentTitle = title;
            return this;
@@ -663,6 +660,11 @@ public class Notification implements Parcelable
            return this;
        }

        public Builder setNumber(int number) {
            mNumber = number;
            return this;
        }

        public Builder setContentInfo(CharSequence info) {
            mContentInfo = info;
            return this;
@@ -767,10 +769,17 @@ public class Notification implements Parcelable
                if (mContentText != null) {
                    contentView.setTextViewText(com.android.internal.R.id.text, mContentText);
                }
                //TODO
                //if (mContentInfo) {
                //    contentVeiw.setTextViewText(com.android.internal.R.id.info, mContentInfo);
                //}
                if (mContentInfo != null) {
                    contentView.setTextViewText(com.android.internal.R.id.info, mContentInfo);
                } else if (mNumber > 0) {
                    NumberFormat f = NumberFormat.getIntegerInstance();
                    contentView.setTextViewText(com.android.internal.R.id.info, f.format(mNumber));
                    contentView.setFloat(com.android.internal.R.id.info, "setTextSize",
                            mContext.getResources().getDimensionPixelSize(
                                com.android.internal.R.dimen.status_bar_content_number_size));
                } else {
                    contentView.setViewVisibility(com.android.internal.R.id.info, View.GONE);
                }
                if (mWhen != 0) {
                    contentView.setLong(com.android.internal.R.id.time, "setTime", mWhen);
                }
@@ -791,7 +800,7 @@ public class Notification implements Parcelable
            n.when = mWhen;
            n.icon = mSmallIcon;
            n.iconLevel = mSmallIconLevel;
            n.number = mSmallIconNumber;
            n.number = mNumber;
            n.contentView = makeContentView();
            n.contentIntent = mContentIntent;
            n.deleteIntent = mDeleteIntent;
+9 −5
Original line number Diff line number Diff line
@@ -6,8 +6,6 @@
    <ImageView android:id="@+id/icon"
        android:layout_width="48dp"
        android:layout_height="64dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:scaleType="center"
        />

@@ -37,5 +35,11 @@
            android:fadingEdge="horizontal"
            />
    </LinearLayout>
    <TextView android:id="@+id/info"
        android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        />
</LinearLayout>
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
    <dimen name="status_bar_height">48dip</dimen>
    <!-- Height of the status bar -->
    <dimen name="status_bar_icon_size">48dip</dimen>
    <!-- Size of the giant number (unread count) in the notifications -->
    <dimen name="status_bar_content_number_size">48sp</dimen>
    
    <!-- Margin at the edge of the screen to ignore touch events for in the windowshade. -->
    <!-- Margin for permanent screen decorations at the bottom. -->
    <dimen name="screen_margin_bottom">48dip</dimen>
+5 −0
Original line number Diff line number Diff line
@@ -213,12 +213,17 @@
        <item name="android:textStyle">bold</item>
    </style>
    <style name="TextAppearance.StatusBar.EventContent">
        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
        <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>
    <style name="TextAppearance.StatusBar.EventContent.Info">
        <item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
        <item name="android:textColor">#ff272727</item>
    </style>

    <!-- Widget Styles -->

Loading