Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.systemui.statusbar.stack; |
| 18 | |
Eliot Courtney | 5d3d2d0 | 2018-01-18 15:59:03 +0900 | [diff] [blame] | 19 | import android.annotation.Nullable; |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 20 | import android.content.Context; |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 21 | import android.view.View; |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 22 | |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 23 | import com.android.systemui.R; |
Selim Cinek | a32ab60 | 2014-06-11 15:06:01 +0200 | [diff] [blame] | 24 | import com.android.systemui.statusbar.ActivatableNotificationView; |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 25 | import com.android.systemui.statusbar.ExpandableNotificationRow; |
| 26 | import com.android.systemui.statusbar.ExpandableView; |
| 27 | import com.android.systemui.statusbar.NotificationData; |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 28 | import com.android.systemui.statusbar.NotificationShelf; |
Selim Cinek | 355652a | 2016-12-07 13:32:12 -0800 | [diff] [blame] | 29 | import com.android.systemui.statusbar.StatusBarState; |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 30 | import com.android.systemui.statusbar.policy.HeadsUpManager; |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 31 | |
| 32 | import java.util.ArrayList; |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 33 | import java.util.Collection; |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * A global state to track all input states for the algorithm. |
| 37 | */ |
| 38 | public class AmbientState { |
| 39 | private ArrayList<View> mDraggedViews = new ArrayList<View>(); |
| 40 | private int mScrollY; |
| 41 | private boolean mDimmed; |
Selim Cinek | a32ab60 | 2014-06-11 15:06:01 +0200 | [diff] [blame] | 42 | private ActivatableNotificationView mActivatedChild; |
Selim Cinek | 8d9ff9c | 2014-05-12 15:13:04 +0200 | [diff] [blame] | 43 | private float mOverScrollTopAmount; |
| 44 | private float mOverScrollBottomAmount; |
Selim Cinek | db16737 | 2016-11-17 15:41:17 -0800 | [diff] [blame] | 45 | private int mSpeedBumpIndex = -1; |
John Spurlock | bf37099 | 2014-06-17 13:58:31 -0400 | [diff] [blame] | 46 | private boolean mDark; |
Jorim Jaggi | ae44128 | 2014-08-01 02:45:18 +0200 | [diff] [blame] | 47 | private boolean mHideSensitive; |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 48 | private HeadsUpManager mHeadsUpManager; |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 49 | private float mStackTranslation; |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 50 | private int mLayoutHeight; |
| 51 | private int mTopPadding; |
| 52 | private boolean mShadeExpanded; |
| 53 | private float mMaxHeadsUpTranslation; |
Selim Cinek | 9c17b77 | 2015-07-07 20:37:09 -0700 | [diff] [blame] | 54 | private boolean mDismissAllInProgress; |
Selim Cinek | bc243a9 | 2016-09-27 16:35:13 -0700 | [diff] [blame] | 55 | private int mLayoutMinHeight; |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 56 | private NotificationShelf mShelf; |
| 57 | private int mZDistanceBetweenElements; |
| 58 | private int mBaseZHeight; |
Selim Cinek | 91d4cba | 2016-11-10 19:59:48 -0800 | [diff] [blame] | 59 | private int mMaxLayoutHeight; |
Selim Cinek | db16737 | 2016-11-17 15:41:17 -0800 | [diff] [blame] | 60 | private ActivatableNotificationView mLastVisibleBackgroundChild; |
Selim Cinek | 727903c | 2016-12-06 17:28:10 -0800 | [diff] [blame] | 61 | private float mCurrentScrollVelocity; |
Selim Cinek | 355652a | 2016-12-07 13:32:12 -0800 | [diff] [blame] | 62 | private int mStatusBarState; |
Selim Cinek | d5ab645 | 2016-12-08 16:34:00 -0800 | [diff] [blame] | 63 | private float mExpandingVelocity; |
| 64 | private boolean mPanelTracking; |
| 65 | private boolean mExpansionChanging; |
Selim Cinek | fcff4c6 | 2016-12-27 14:26:06 +0100 | [diff] [blame] | 66 | private boolean mPanelFullWidth; |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 67 | private Collection<HeadsUpManager.HeadsUpEntry> mPulsing; |
Selim Cinek | ec29d34 | 2017-05-05 18:31:49 -0700 | [diff] [blame] | 68 | private boolean mUnlockHintRunning; |
Selim Cinek | 5cf1d05 | 2017-06-01 17:36:46 -0700 | [diff] [blame] | 69 | private boolean mQsCustomizerShowing; |
Selim Cinek | 1f62495 | 2017-06-08 19:11:50 -0700 | [diff] [blame] | 70 | private int mIntrinsicPadding; |
Selim Cinek | 2627d72 | 2018-01-19 12:16:49 -0800 | [diff] [blame] | 71 | private int mExpandAnimationTopChange; |
| 72 | private ExpandableNotificationRow mExpandingNotification; |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 73 | |
| 74 | public AmbientState(Context context) { |
| 75 | reload(context); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Reload the dimens e.g. if the density changed. |
| 80 | */ |
| 81 | public void reload(Context context) { |
Selim Cinek | 2627d72 | 2018-01-19 12:16:49 -0800 | [diff] [blame] | 82 | mZDistanceBetweenElements = getZDistanceBetweenElements(context); |
| 83 | mBaseZHeight = getBaseHeight(mZDistanceBetweenElements); |
| 84 | } |
| 85 | |
| 86 | private static int getZDistanceBetweenElements(Context context) { |
| 87 | return Math.max(1, context.getResources() |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 88 | .getDimensionPixelSize(R.dimen.z_distance_between_notifications)); |
Selim Cinek | 2627d72 | 2018-01-19 12:16:49 -0800 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | private static int getBaseHeight(int zdistanceBetweenElements) { |
| 92 | return 4 * zdistanceBetweenElements; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * @return the launch height for notifications that are launched |
| 97 | */ |
| 98 | public static int getNotificationLaunchHeight(Context context) { |
| 99 | int zDistance = getZDistanceBetweenElements(context); |
| 100 | return getBaseHeight(zDistance) * 2; |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | /** |
| 104 | * @return the basic Z height on which notifications remain. |
| 105 | */ |
| 106 | public int getBaseZHeight() { |
| 107 | return mBaseZHeight; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * @return the distance in Z between two overlaying notifications. |
| 112 | */ |
| 113 | public int getZDistanceBetweenElements() { |
| 114 | return mZDistanceBetweenElements; |
| 115 | } |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 116 | |
| 117 | public int getScrollY() { |
| 118 | return mScrollY; |
| 119 | } |
| 120 | |
| 121 | public void setScrollY(int scrollY) { |
| 122 | this.mScrollY = scrollY; |
| 123 | } |
| 124 | |
| 125 | public void onBeginDrag(View view) { |
| 126 | mDraggedViews.add(view); |
| 127 | } |
| 128 | |
| 129 | public void onDragFinished(View view) { |
| 130 | mDraggedViews.remove(view); |
| 131 | } |
| 132 | |
| 133 | public ArrayList<View> getDraggedViews() { |
| 134 | return mDraggedViews; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * @param dimmed Whether we are in a dimmed state (on the lockscreen), where the backgrounds are |
| 139 | * translucent and everything is scaled back a bit. |
| 140 | */ |
| 141 | public void setDimmed(boolean dimmed) { |
| 142 | mDimmed = dimmed; |
| 143 | } |
| 144 | |
John Spurlock | bf37099 | 2014-06-17 13:58:31 -0400 | [diff] [blame] | 145 | /** In dark mode, we draw as little as possible, assuming a black background */ |
| 146 | public void setDark(boolean dark) { |
| 147 | mDark = dark; |
| 148 | } |
| 149 | |
Jorim Jaggi | ae44128 | 2014-08-01 02:45:18 +0200 | [diff] [blame] | 150 | public void setHideSensitive(boolean hideSensitive) { |
| 151 | mHideSensitive = hideSensitive; |
| 152 | } |
| 153 | |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 154 | /** |
| 155 | * In dimmed mode, a child can be activated, which happens on the first tap of the double-tap |
| 156 | * interaction. This child is then scaled normally and its background is fully opaque. |
| 157 | */ |
Selim Cinek | a32ab60 | 2014-06-11 15:06:01 +0200 | [diff] [blame] | 158 | public void setActivatedChild(ActivatableNotificationView activatedChild) { |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 159 | mActivatedChild = activatedChild; |
| 160 | } |
| 161 | |
| 162 | public boolean isDimmed() { |
| 163 | return mDimmed; |
| 164 | } |
| 165 | |
John Spurlock | bf37099 | 2014-06-17 13:58:31 -0400 | [diff] [blame] | 166 | public boolean isDark() { |
| 167 | return mDark; |
| 168 | } |
| 169 | |
Jorim Jaggi | ae44128 | 2014-08-01 02:45:18 +0200 | [diff] [blame] | 170 | public boolean isHideSensitive() { |
| 171 | return mHideSensitive; |
| 172 | } |
| 173 | |
Selim Cinek | a32ab60 | 2014-06-11 15:06:01 +0200 | [diff] [blame] | 174 | public ActivatableNotificationView getActivatedChild() { |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 175 | return mActivatedChild; |
| 176 | } |
Selim Cinek | 8d9ff9c | 2014-05-12 15:13:04 +0200 | [diff] [blame] | 177 | |
| 178 | public void setOverScrollAmount(float amount, boolean onTop) { |
| 179 | if (onTop) { |
| 180 | mOverScrollTopAmount = amount; |
| 181 | } else { |
| 182 | mOverScrollBottomAmount = amount; |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | public float getOverScrollAmount(boolean top) { |
| 187 | return top ? mOverScrollTopAmount : mOverScrollBottomAmount; |
| 188 | } |
Selim Cinek | c27437b | 2014-05-14 10:23:33 +0200 | [diff] [blame] | 189 | |
Selim Cinek | db16737 | 2016-11-17 15:41:17 -0800 | [diff] [blame] | 190 | public int getSpeedBumpIndex() { |
| 191 | return mSpeedBumpIndex; |
Selim Cinek | c27437b | 2014-05-14 10:23:33 +0200 | [diff] [blame] | 192 | } |
| 193 | |
Selim Cinek | db16737 | 2016-11-17 15:41:17 -0800 | [diff] [blame] | 194 | public void setSpeedBumpIndex(int shelfIndex) { |
| 195 | mSpeedBumpIndex = shelfIndex; |
Selim Cinek | c27437b | 2014-05-14 10:23:33 +0200 | [diff] [blame] | 196 | } |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 197 | |
| 198 | public void setHeadsUpManager(HeadsUpManager headsUpManager) { |
| 199 | mHeadsUpManager = headsUpManager; |
| 200 | } |
| 201 | |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 202 | public float getStackTranslation() { |
| 203 | return mStackTranslation; |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 204 | } |
| 205 | |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 206 | public void setStackTranslation(float stackTranslation) { |
| 207 | mStackTranslation = stackTranslation; |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 210 | public void setLayoutHeight(int layoutHeight) { |
| 211 | mLayoutHeight = layoutHeight; |
| 212 | } |
| 213 | |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 214 | public float getTopPadding() { |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 215 | return mTopPadding; |
| 216 | } |
| 217 | |
| 218 | public void setTopPadding(int topPadding) { |
| 219 | mTopPadding = topPadding; |
| 220 | } |
| 221 | |
| 222 | public int getInnerHeight() { |
Selim Cinek | 2627d72 | 2018-01-19 12:16:49 -0800 | [diff] [blame] | 223 | return Math.max(Math.min(mLayoutHeight, mMaxLayoutHeight) - mTopPadding |
| 224 | - mExpandAnimationTopChange, mLayoutMinHeight); |
Selim Cinek | b8f09cf | 2015-03-16 17:09:28 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | public boolean isShadeExpanded() { |
| 228 | return mShadeExpanded; |
| 229 | } |
| 230 | |
| 231 | public void setShadeExpanded(boolean shadeExpanded) { |
| 232 | mShadeExpanded = shadeExpanded; |
| 233 | } |
| 234 | |
| 235 | public void setMaxHeadsUpTranslation(float maxHeadsUpTranslation) { |
| 236 | mMaxHeadsUpTranslation = maxHeadsUpTranslation; |
| 237 | } |
| 238 | |
| 239 | public float getMaxHeadsUpTranslation() { |
| 240 | return mMaxHeadsUpTranslation; |
| 241 | } |
Selim Cinek | a59ecc3 | 2015-04-07 10:51:49 -0700 | [diff] [blame] | 242 | |
Selim Cinek | 9c17b77 | 2015-07-07 20:37:09 -0700 | [diff] [blame] | 243 | public void setDismissAllInProgress(boolean dismissAllInProgress) { |
| 244 | mDismissAllInProgress = dismissAllInProgress; |
| 245 | } |
| 246 | |
| 247 | public boolean isDismissAllInProgress() { |
| 248 | return mDismissAllInProgress; |
| 249 | } |
Selim Cinek | bc243a9 | 2016-09-27 16:35:13 -0700 | [diff] [blame] | 250 | |
| 251 | public void setLayoutMinHeight(int layoutMinHeight) { |
| 252 | mLayoutMinHeight = layoutMinHeight; |
| 253 | } |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 254 | |
| 255 | public void setShelf(NotificationShelf shelf) { |
| 256 | mShelf = shelf; |
| 257 | } |
| 258 | |
Eliot Courtney | 5d3d2d0 | 2018-01-18 15:59:03 +0900 | [diff] [blame] | 259 | @Nullable |
Selim Cinek | 281c202 | 2016-10-13 19:14:43 -0700 | [diff] [blame] | 260 | public NotificationShelf getShelf() { |
| 261 | return mShelf; |
| 262 | } |
Selim Cinek | 91d4cba | 2016-11-10 19:59:48 -0800 | [diff] [blame] | 263 | |
| 264 | public void setLayoutMaxHeight(int maxLayoutHeight) { |
| 265 | mMaxLayoutHeight = maxLayoutHeight; |
| 266 | } |
Selim Cinek | db16737 | 2016-11-17 15:41:17 -0800 | [diff] [blame] | 267 | |
| 268 | /** |
| 269 | * Sets the last visible view of the host layout, that has a background, i.e the very last |
| 270 | * view in the shade, without the clear all button. |
| 271 | */ |
| 272 | public void setLastVisibleBackgroundChild( |
| 273 | ActivatableNotificationView lastVisibleBackgroundChild) { |
| 274 | mLastVisibleBackgroundChild = lastVisibleBackgroundChild; |
| 275 | } |
| 276 | |
| 277 | public ActivatableNotificationView getLastVisibleBackgroundChild() { |
| 278 | return mLastVisibleBackgroundChild; |
| 279 | } |
Selim Cinek | 727903c | 2016-12-06 17:28:10 -0800 | [diff] [blame] | 280 | |
| 281 | public void setCurrentScrollVelocity(float currentScrollVelocity) { |
| 282 | mCurrentScrollVelocity = currentScrollVelocity; |
| 283 | } |
| 284 | |
| 285 | public float getCurrentScrollVelocity() { |
| 286 | return mCurrentScrollVelocity; |
| 287 | } |
Selim Cinek | 355652a | 2016-12-07 13:32:12 -0800 | [diff] [blame] | 288 | |
| 289 | public boolean isOnKeyguard() { |
| 290 | return mStatusBarState == StatusBarState.KEYGUARD; |
| 291 | } |
| 292 | |
| 293 | public void setStatusBarState(int statusBarState) { |
| 294 | mStatusBarState = statusBarState; |
| 295 | } |
Selim Cinek | d5ab645 | 2016-12-08 16:34:00 -0800 | [diff] [blame] | 296 | |
| 297 | public void setExpandingVelocity(float expandingVelocity) { |
| 298 | mExpandingVelocity = expandingVelocity; |
| 299 | } |
| 300 | |
| 301 | public void setExpansionChanging(boolean expansionChanging) { |
| 302 | mExpansionChanging = expansionChanging; |
| 303 | } |
| 304 | |
| 305 | public boolean isExpansionChanging() { |
| 306 | return mExpansionChanging; |
| 307 | } |
| 308 | |
| 309 | public float getExpandingVelocity() { |
| 310 | return mExpandingVelocity; |
| 311 | } |
| 312 | |
| 313 | public void setPanelTracking(boolean panelTracking) { |
| 314 | mPanelTracking = panelTracking; |
| 315 | } |
| 316 | |
Selim Cinek | be2c443 | 2017-05-30 12:11:09 -0700 | [diff] [blame] | 317 | public boolean hasPulsingNotifications() { |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 318 | return mPulsing != null; |
Adrian Roos | d83e999 | 2017-03-16 15:17:57 -0700 | [diff] [blame] | 319 | } |
| 320 | |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 321 | public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> hasPulsing) { |
| 322 | mPulsing = hasPulsing; |
| 323 | } |
| 324 | |
| 325 | public boolean isPulsing(NotificationData.Entry entry) { |
| 326 | if (mPulsing == null) { |
| 327 | return false; |
| 328 | } |
| 329 | for (HeadsUpManager.HeadsUpEntry e : mPulsing) { |
| 330 | if (e.entry == entry) { |
| 331 | return true; |
| 332 | } |
| 333 | } |
| 334 | return false; |
Adrian Roos | d83e999 | 2017-03-16 15:17:57 -0700 | [diff] [blame] | 335 | } |
| 336 | |
Selim Cinek | d5ab645 | 2016-12-08 16:34:00 -0800 | [diff] [blame] | 337 | public boolean isPanelTracking() { |
| 338 | return mPanelTracking; |
| 339 | } |
Selim Cinek | fcff4c6 | 2016-12-27 14:26:06 +0100 | [diff] [blame] | 340 | |
| 341 | public boolean isPanelFullWidth() { |
| 342 | return mPanelFullWidth; |
| 343 | } |
| 344 | |
| 345 | public void setPanelFullWidth(boolean panelFullWidth) { |
| 346 | mPanelFullWidth = panelFullWidth; |
| 347 | } |
Selim Cinek | ec29d34 | 2017-05-05 18:31:49 -0700 | [diff] [blame] | 348 | |
| 349 | public void setUnlockHintRunning(boolean unlockHintRunning) { |
| 350 | mUnlockHintRunning = unlockHintRunning; |
| 351 | } |
| 352 | |
| 353 | public boolean isUnlockHintRunning() { |
| 354 | return mUnlockHintRunning; |
| 355 | } |
Selim Cinek | 5cf1d05 | 2017-06-01 17:36:46 -0700 | [diff] [blame] | 356 | |
| 357 | public boolean isQsCustomizerShowing() { |
| 358 | return mQsCustomizerShowing; |
| 359 | } |
| 360 | |
| 361 | public void setQsCustomizerShowing(boolean qsCustomizerShowing) { |
| 362 | mQsCustomizerShowing = qsCustomizerShowing; |
| 363 | } |
Selim Cinek | 1f62495 | 2017-06-08 19:11:50 -0700 | [diff] [blame] | 364 | |
| 365 | public void setIntrinsicPadding(int intrinsicPadding) { |
| 366 | mIntrinsicPadding = intrinsicPadding; |
| 367 | } |
| 368 | |
| 369 | public int getIntrinsicPadding() { |
| 370 | return mIntrinsicPadding; |
| 371 | } |
Selim Cinek | ebf4234 | 2017-07-13 15:46:10 +0200 | [diff] [blame] | 372 | |
| 373 | /** |
| 374 | * Similar to the normal is above shelf logic but doesn't allow it to be above in AOD1. |
| 375 | * |
| 376 | * @param expandableView the view to check |
| 377 | */ |
| 378 | public boolean isAboveShelf(ExpandableView expandableView) { |
| 379 | if (!(expandableView instanceof ExpandableNotificationRow)) { |
| 380 | return expandableView.isAboveShelf(); |
| 381 | } |
| 382 | ExpandableNotificationRow row = (ExpandableNotificationRow) expandableView; |
| 383 | return row.isAboveShelf() && !isDozingAndNotPulsing(row); |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * @return whether a view is dozing and not pulsing right now |
| 388 | */ |
| 389 | public boolean isDozingAndNotPulsing(ExpandableView view) { |
| 390 | if (view instanceof ExpandableNotificationRow) { |
| 391 | return isDozingAndNotPulsing((ExpandableNotificationRow) view); |
| 392 | } |
| 393 | return false; |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * @return whether a row is dozing and not pulsing right now |
| 398 | */ |
| 399 | public boolean isDozingAndNotPulsing(ExpandableNotificationRow row) { |
| 400 | return isDark() && !isPulsing(row.getEntry()); |
| 401 | } |
Selim Cinek | 2627d72 | 2018-01-19 12:16:49 -0800 | [diff] [blame] | 402 | |
| 403 | public void setExpandAnimationTopChange(int expandAnimationTopChange) { |
| 404 | mExpandAnimationTopChange = expandAnimationTopChange; |
| 405 | } |
| 406 | |
| 407 | public void setExpandingNotification(ExpandableNotificationRow row) { |
| 408 | mExpandingNotification = row; |
| 409 | } |
| 410 | |
| 411 | public ExpandableNotificationRow getExpandingNotification() { |
| 412 | return mExpandingNotification; |
| 413 | } |
| 414 | |
| 415 | public int getExpandAnimationTopChange() { |
| 416 | return mExpandAnimationTopChange; |
| 417 | } |
Jorim Jaggi | d552d9d | 2014-05-07 19:41:13 +0200 | [diff] [blame] | 418 | } |