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

Commit 8d0b655c authored by Joe Onorato's avatar Joe Onorato
Browse files

Add a better notification test and clean up the flag handling in the notification builder.

Change-Id: I9354ed2c2cda690f53e5f43ad60943b63b02e7d4
parent 83d97c8c
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -742,7 +742,6 @@ public class Notification implements Parcelable
            mLedArgb = argb;
            mLedOnMs = onMs;
            mLedOffMs = offMs;
            mFlags |= FLAG_SHOW_LIGHTS;
            return this;
        }

@@ -763,10 +762,6 @@ public class Notification implements Parcelable

        public Builder setDefaults(int defaults) {
            mDefaults = defaults;
            int moreFlags = 0;
            if ((defaults & DEFAULT_LIGHTS) != 0) {
                moreFlags |= FLAG_SHOW_LIGHTS;
            }
            return this;
        }

@@ -851,6 +846,12 @@ public class Notification implements Parcelable
            n.ledOffMS = mLedOffMs;
            n.defaults = mDefaults;
            n.flags = mFlags;
            if (mLedOnMs != 0 && mLedOffMs != 0) {
                n.flags |= FLAG_SHOW_LIGHTS;
            }
            if ((mDefaults & DEFAULT_LIGHTS) != 0) {
                n.flags |= FLAG_SHOW_LIGHTS;
            }
            return n;
        }
    }
+5 −1
Original line number Diff line number Diff line
@@ -21,7 +21,11 @@
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="NotificationBuilderTest" android:label="_Notify Builder">
        <activity android:name="NotificationBuilderTest"
                android:label="_Notify Builder"
                android:theme="@android:style/Theme.Holo"
                android:hardwareAccelerated="true"
                >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
+3.41 KiB
Loading image diff...
+819 −0

File added.

Preview size limit exceeded, changes collapsed.

+63 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<resources>

    <style name="IdTitle">
        <item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
        <item name="android:layout_width">30sp</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">center</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="IdButton">
        <item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_weight">1</item>
        <item name="android:layout_marginRight">8dp</item>
        <item name="android:layout_marginLeft">8dp</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="IdButton.Minus">
        <item name="android:text">-</item>
    </style>

    <style name="IdButton.Plus">
        <item name="android:text">+</item>
    </style>

    <style name="FieldTitle">
        <item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
        <item name="android:layout_width">208sp</item>
        <item name="android:layout_height">wrap_content</item>
    </style>

    <style name="FieldContents">
        <item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginRight">20dp</item>
    </style>

    <style name="FieldContents.Disabled">
        <item name="android:clickable">false</item>
        <item name="android:visibility">gone</item>
    </style>

</resources>
Loading