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

Commit 3745a3da authored by Chris Wren's avatar Chris Wren
Browse files

BigPicture notifications for screenshots.

Needed a little extra help from the builder to make this
happen (like the title, you might want a different largeIcon
in the expanded view if---as in this case---it is redundant
with the big picture).

Needed to fix BigPicture template to reveal actions.

Bug: 6289107
Change-Id: I19dc62e693ee2c87cbe82f7327fe9115768b4102
parent 0eaeb69d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1689,6 +1689,8 @@ public class Notification implements Parcelable
     */
    public static class BigPictureStyle extends Style {
        private Bitmap mPicture;
        private Bitmap mBigLargeIcon;
        private boolean mBigLargeIconSet = false;

        public BigPictureStyle() {
        }
@@ -1719,6 +1721,16 @@ public class Notification implements Parcelable
            return this;
        }

        /**
         * @hide
         * Override the large icon when the big notification is shown.
         */
        public BigPictureStyle bigLargeIcon(Bitmap b) {
            mBigLargeIconSet = true;
            mBigLargeIcon = b;
            return this;
        }

        private RemoteViews makeBigContentView() {
            RemoteViews contentView = getStandardView(R.layout.notification_template_big_picture);

@@ -1731,6 +1743,9 @@ public class Notification implements Parcelable
        public Notification build() {
            checkBuilder();
            Notification wip = mBuilder.buildUnstyled();
            if (mBigLargeIconSet ) {
                mBuilder.mLargeIcon = mBigLargeIcon;
            }
            wip.bigContentView = makeBigContentView();
            return wip;
        }
+18 −1
Original line number Diff line number Diff line
@@ -42,4 +42,21 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />
  <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="208dp"
        android:layout_marginLeft="64dp"
        android:layout_gravity="bottom"
        android:background="#CC111111"
        >
        <include
            layout="@layout/notification_action_list"
            android:id="@+id/actions"
            android:layout_marginLeft="8dp"
            android:layout_gravity="bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
    </FrameLayout>
</FrameLayout>
+1 −0
Original line number Diff line number Diff line
@@ -785,6 +785,7 @@
  <java-symbol type="string" name="serviceNotProvisioned" />
  <java-symbol type="string" name="serviceRegistered" />
  <java-symbol type="string" name="setup_autofill" />
  <java-symbol type="string" name="share" />
  <java-symbol type="string" name="shareactionprovider_share_with" />
  <java-symbol type="string" name="shareactionprovider_share_with_application" />
  <java-symbol type="string" name="short_format_month" />
+1.34 KiB
Loading image diff...
+1.01 KiB
Loading image diff...
Loading