blob: c13593a204d7bf45d52e01786e755c21c1e1f66b [file] [log] [blame]
Chris Wren51c75102013-07-16 20:49:17 -04001/*
2 * Copyright (C) 2013 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
17package com.android.systemui.statusbar;
18
19import android.content.Context;
Selim Cinekcab4a602014-09-03 14:47:57 +020020import android.graphics.drawable.AnimatedVectorDrawable;
21import android.graphics.drawable.AnimationDrawable;
22import android.graphics.drawable.Drawable;
Chris Wren51c75102013-07-16 20:49:17 -040023import android.util.AttributeSet;
Dan Sandlera5e0f412014-01-23 15:11:54 -050024import android.view.View;
Selim Cinekcab4a602014-09-03 14:47:57 +020025import android.view.ViewGroup;
Jorim Jaggife40f7d2014-04-28 15:20:04 +020026import android.view.accessibility.AccessibilityEvent;
Chris Wren51c75102013-07-16 20:49:17 -040027
Selim Cinekcab4a602014-09-03 14:47:57 +020028import android.widget.ImageView;
Dan Sandlera5e0f412014-01-23 15:11:54 -050029import com.android.systemui.R;
30
Jorim Jaggi4222d9a2014-04-23 16:13:15 +020031public class ExpandableNotificationRow extends ActivatableNotificationView {
Selim Cinek1685e632014-04-08 02:27:49 +020032 private int mRowMinHeight;
33 private int mRowMaxHeight;
Chris Wren51c75102013-07-16 20:49:17 -040034
Selim Cinek1685e632014-04-08 02:27:49 +020035 /** Does this row contain layouts that can adapt to row expansion */
Chris Wren51c75102013-07-16 20:49:17 -040036 private boolean mExpandable;
Selim Cinek1685e632014-04-08 02:27:49 +020037 /** Has the user actively changed the expansion state of this row */
38 private boolean mHasUserChangedExpansion;
39 /** If {@link #mHasUserChangedExpansion}, has the user expanded this row */
Chris Wren51c75102013-07-16 20:49:17 -040040 private boolean mUserExpanded;
Selim Cinek1685e632014-04-08 02:27:49 +020041 /** Is the user touching this row */
Chris Wren51c75102013-07-16 20:49:17 -040042 private boolean mUserLocked;
Selim Cinek1685e632014-04-08 02:27:49 +020043 /** Are we showing the "public" version */
Dan Sandlera5e0f412014-01-23 15:11:54 -050044 private boolean mShowingPublic;
Jorim Jaggiae441282014-08-01 02:45:18 +020045 private boolean mSensitive;
46 private boolean mShowingPublicInitialized;
47 private boolean mShowingPublicForIntrinsicHeight;
Chris Wren51c75102013-07-16 20:49:17 -040048
Selim Cinek1685e632014-04-08 02:27:49 +020049 /**
50 * Is this notification expanded by the system. The expansion state can be overridden by the
51 * user expansion.
52 */
53 private boolean mIsSystemExpanded;
Jorim Jaggidce3c4c2014-04-29 23:12:24 +020054
55 /**
56 * Whether the notification expansion is disabled. This is the case on Keyguard.
57 */
58 private boolean mExpansionDisabled;
59
Jorim Jaggibe565df2014-04-28 17:51:23 +020060 private NotificationContentView mPublicLayout;
61 private NotificationContentView mPrivateLayout;
Selim Cinek1685e632014-04-08 02:27:49 +020062 private int mMaxExpandHeight;
Selim Cinek863834b2014-05-20 04:20:25 +020063 private View mVetoButton;
Dan Sandler0d3e62f2014-07-14 17:13:50 -040064 private boolean mClearable;
Chris Wren78403d72014-07-28 10:23:24 +010065 private ExpansionLogger mLogger;
66 private String mLoggingKey;
Selim Cineka5e211b2014-08-11 17:35:48 +020067 private boolean mWasReset;
Selim Cinek024ca592014-09-01 15:11:28 +020068 private NotificationGuts mGuts;
Chris Wren78403d72014-07-28 10:23:24 +010069
Selim Cinekcab4a602014-09-03 14:47:57 +020070 public void setIconAnimationRunning(boolean running) {
71 setIconAnimationRunning(running, mPublicLayout);
72 setIconAnimationRunning(running, mPrivateLayout);
73 }
74
75 private void setIconAnimationRunning(boolean running, NotificationContentView layout) {
76 if (layout != null) {
77 View contractedChild = layout.getContractedChild();
78 View expandedChild = layout.getExpandedChild();
79 setIconAnimationRunningForChild(running, contractedChild);
80 setIconAnimationRunningForChild(running, expandedChild);
81 }
82 }
83
84 private void setIconAnimationRunningForChild(boolean running, View child) {
85 if (child != null) {
86 ImageView icon = (ImageView) child.findViewById(com.android.internal.R.id.icon);
87 setIconRunning(icon, running);
88 ImageView rightIcon = (ImageView) child.findViewById(
89 com.android.internal.R.id.right_icon);
90 setIconRunning(rightIcon, running);
91 }
92 }
93
94 private void setIconRunning(ImageView imageView, boolean running) {
95 if (imageView != null) {
96 Drawable drawable = imageView.getDrawable();
97 if (drawable instanceof AnimationDrawable) {
98 AnimationDrawable animationDrawable = (AnimationDrawable) drawable;
99 if (running) {
100 animationDrawable.start();
101 } else {
102 animationDrawable.stop();
103 }
104 } else if (drawable instanceof AnimatedVectorDrawable) {
105 AnimatedVectorDrawable animationDrawable = (AnimatedVectorDrawable) drawable;
106 if (running) {
107 animationDrawable.start();
108 } else {
109 animationDrawable.stop();
110 }
111 }
112 }
113 }
114
Chris Wren78403d72014-07-28 10:23:24 +0100115 public interface ExpansionLogger {
116 public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
117 }
Selim Cinek1685e632014-04-08 02:27:49 +0200118
Chris Wren51c75102013-07-16 20:49:17 -0400119 public ExpandableNotificationRow(Context context, AttributeSet attrs) {
120 super(context, attrs);
121 }
122
Christoph Studera7fe6312014-06-27 19:32:44 +0200123 /**
124 * Resets this view so it can be re-used for an updated notification.
125 */
Christoph Studer22f2ee52014-07-29 22:57:21 +0200126 @Override
Christoph Studera7fe6312014-06-27 19:32:44 +0200127 public void reset() {
Christoph Studer22f2ee52014-07-29 22:57:21 +0200128 super.reset();
Christoph Studera7fe6312014-06-27 19:32:44 +0200129 mRowMinHeight = 0;
Chris Wren78403d72014-07-28 10:23:24 +0100130 final boolean wasExpanded = isExpanded();
Christoph Studera7fe6312014-06-27 19:32:44 +0200131 mRowMaxHeight = 0;
132 mExpandable = false;
133 mHasUserChangedExpansion = false;
134 mUserLocked = false;
135 mShowingPublic = false;
Jorim Jaggiae441282014-08-01 02:45:18 +0200136 mSensitive = false;
137 mShowingPublicInitialized = false;
Christoph Studera7fe6312014-06-27 19:32:44 +0200138 mIsSystemExpanded = false;
139 mExpansionDisabled = false;
140 mPublicLayout.reset();
141 mPrivateLayout.reset();
Selim Cinek31094df2014-08-14 19:28:15 +0200142 resetHeight();
143 logExpansionEvent(false, wasExpanded);
144 }
145
146 public void resetHeight() {
Christoph Studera7fe6312014-06-27 19:32:44 +0200147 mMaxExpandHeight = 0;
Selim Cineka5e211b2014-08-11 17:35:48 +0200148 mWasReset = true;
Selim Cinek31094df2014-08-14 19:28:15 +0200149 onHeightReset();
Selim Cinek6e28a672014-09-05 14:43:28 +0200150 requestLayout();
Christoph Studera7fe6312014-06-27 19:32:44 +0200151 }
152
Jorim Jaggi251957d2014-04-09 04:24:09 +0200153 @Override
154 protected void onFinishInflate() {
155 super.onFinishInflate();
Jorim Jaggibe565df2014-04-28 17:51:23 +0200156 mPublicLayout = (NotificationContentView) findViewById(R.id.expandedPublic);
157 mPrivateLayout = (NotificationContentView) findViewById(R.id.expanded);
Selim Cinek024ca592014-09-01 15:11:28 +0200158 mGuts = (NotificationGuts) findViewById(R.id.notification_guts);
Selim Cinek863834b2014-05-20 04:20:25 +0200159 mVetoButton = findViewById(R.id.veto);
Jorim Jaggife40f7d2014-04-28 15:20:04 +0200160 }
161
162 @Override
163 public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
164 if (super.onRequestSendAccessibilityEvent(child, event)) {
165 // Add a record for the entire layout since its content is somehow small.
166 // The event comes from a leaf view that is interacted with.
167 AccessibilityEvent record = AccessibilityEvent.obtain();
168 onInitializeAccessibilityEvent(record);
169 dispatchPopulateAccessibilityEvent(record);
170 event.appendRecord(record);
171 return true;
172 }
173 return false;
Jorim Jaggic5dc0d02014-04-15 15:42:55 +0200174 }
Chris Wren51c75102013-07-16 20:49:17 -0400175
John Spurlocke15452b2014-08-21 09:44:39 -0400176 @Override
177 public void setDark(boolean dark, boolean fade) {
178 super.setDark(dark, fade);
179 final NotificationContentView showing = getShowingLayout();
180 if (showing != null) {
181 showing.setDark(dark, fade);
182 }
183 }
184
Selim Cinek1685e632014-04-08 02:27:49 +0200185 public void setHeightRange(int rowMinHeight, int rowMaxHeight) {
186 mRowMinHeight = rowMinHeight;
187 mRowMaxHeight = rowMaxHeight;
Chris Wren51c75102013-07-16 20:49:17 -0400188 }
189
190 public boolean isExpandable() {
191 return mExpandable;
192 }
193
194 public void setExpandable(boolean expandable) {
195 mExpandable = expandable;
196 }
197
Selim Cinek1685e632014-04-08 02:27:49 +0200198 /**
199 * @return whether the user has changed the expansion state
200 */
201 public boolean hasUserChangedExpansion() {
202 return mHasUserChangedExpansion;
203 }
204
Chris Wren51c75102013-07-16 20:49:17 -0400205 public boolean isUserExpanded() {
206 return mUserExpanded;
207 }
208
Selim Cinek1685e632014-04-08 02:27:49 +0200209 /**
210 * Set this notification to be expanded by the user
211 *
212 * @param userExpanded whether the user wants this notification to be expanded
213 */
Chris Wren51c75102013-07-16 20:49:17 -0400214 public void setUserExpanded(boolean userExpanded) {
Christoph Studera7fe6312014-06-27 19:32:44 +0200215 if (userExpanded && !mExpandable) return;
Chris Wren78403d72014-07-28 10:23:24 +0100216 final boolean wasExpanded = isExpanded();
Selim Cinek1685e632014-04-08 02:27:49 +0200217 mHasUserChangedExpansion = true;
Chris Wren51c75102013-07-16 20:49:17 -0400218 mUserExpanded = userExpanded;
Chris Wren78403d72014-07-28 10:23:24 +0100219 logExpansionEvent(true, wasExpanded);
Chris Wren51c75102013-07-16 20:49:17 -0400220 }
221
Selim Cinekccd14fb2014-08-12 18:53:24 +0200222 public void resetUserExpansion() {
223 mHasUserChangedExpansion = false;
224 mUserExpanded = false;
225 }
226
Chris Wren51c75102013-07-16 20:49:17 -0400227 public boolean isUserLocked() {
228 return mUserLocked;
229 }
230
231 public void setUserLocked(boolean userLocked) {
232 mUserLocked = userLocked;
233 }
234
Selim Cinek1685e632014-04-08 02:27:49 +0200235 /**
236 * @return has the system set this notification to be expanded
237 */
238 public boolean isSystemExpanded() {
239 return mIsSystemExpanded;
240 }
241
242 /**
243 * Set this notification to be expanded by the system.
244 *
245 * @param expand whether the system wants this notification to be expanded.
246 */
247 public void setSystemExpanded(boolean expand) {
Selim Cinek31094df2014-08-14 19:28:15 +0200248 if (expand != mIsSystemExpanded) {
249 final boolean wasExpanded = isExpanded();
250 mIsSystemExpanded = expand;
251 notifyHeightChanged();
252 logExpansionEvent(false, wasExpanded);
253 }
Jorim Jaggidce3c4c2014-04-29 23:12:24 +0200254 }
255
256 /**
257 * @param expansionDisabled whether to prevent notification expansion
258 */
259 public void setExpansionDisabled(boolean expansionDisabled) {
Selim Cinek31094df2014-08-14 19:28:15 +0200260 if (expansionDisabled != mExpansionDisabled) {
261 final boolean wasExpanded = isExpanded();
262 mExpansionDisabled = expansionDisabled;
263 logExpansionEvent(false, wasExpanded);
264 if (wasExpanded != isExpanded()) {
265 notifyHeightChanged();
266 }
267 }
Selim Cinek1685e632014-04-08 02:27:49 +0200268 }
269
270 /**
Dan Sandler0d3e62f2014-07-14 17:13:50 -0400271 * @return Can the underlying notification be cleared?
272 */
273 public boolean isClearable() {
274 return mClearable;
275 }
276
277 /**
278 * Set whether the notification can be cleared.
279 *
280 * @param clearable
281 */
282 public void setClearable(boolean clearable) {
283 mClearable = clearable;
284 updateVetoButton();
285 }
286
287 /**
Selim Cinek1685e632014-04-08 02:27:49 +0200288 * Apply an expansion state to the layout.
Selim Cinek1685e632014-04-08 02:27:49 +0200289 */
Jorim Jaggidce3c4c2014-04-29 23:12:24 +0200290 public void applyExpansionToLayout() {
291 boolean expand = isExpanded();
Chris Wren51c75102013-07-16 20:49:17 -0400292 if (expand && mExpandable) {
Jorim Jaggibe565df2014-04-28 17:51:23 +0200293 setActualHeight(mMaxExpandHeight);
Chris Wren51c75102013-07-16 20:49:17 -0400294 } else {
Jorim Jaggibe565df2014-04-28 17:51:23 +0200295 setActualHeight(mRowMinHeight);
Chris Wren51c75102013-07-16 20:49:17 -0400296 }
Chris Wren51c75102013-07-16 20:49:17 -0400297 }
Dan Sandlera5e0f412014-01-23 15:11:54 -0500298
Jorim Jaggi9cbadd32014-05-01 20:18:31 +0200299 @Override
300 public int getIntrinsicHeight() {
Jorim Jaggibe565df2014-04-28 17:51:23 +0200301 if (isUserLocked()) {
302 return getActualHeight();
303 }
Selim Cinek1685e632014-04-08 02:27:49 +0200304 boolean inExpansionState = isExpanded();
305 if (!inExpansionState) {
306 // not expanded, so we return the collapsed size
307 return mRowMinHeight;
308 }
309
Jorim Jaggiae441282014-08-01 02:45:18 +0200310 return mShowingPublicForIntrinsicHeight ? mRowMinHeight : getMaxExpandHeight();
Selim Cinek1685e632014-04-08 02:27:49 +0200311 }
312
Selim Cinek1685e632014-04-08 02:27:49 +0200313 /**
314 * Check whether the view state is currently expanded. This is given by the system in {@link
315 * #setSystemExpanded(boolean)} and can be overridden by user expansion or
316 * collapsing in {@link #setUserExpanded(boolean)}. Note that the visual appearance of this
317 * view can differ from this state, if layout params are modified from outside.
318 *
319 * @return whether the view state is currently expanded.
320 */
321 private boolean isExpanded() {
Jorim Jaggidce3c4c2014-04-29 23:12:24 +0200322 return !mExpansionDisabled
323 && (!hasUserChangedExpansion() && isSystemExpanded() || isUserExpanded());
Selim Cinek1685e632014-04-08 02:27:49 +0200324 }
325
326 @Override
327 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
328 super.onLayout(changed, left, top, right, bottom);
Selim Cineka5e211b2014-08-11 17:35:48 +0200329 boolean updateExpandHeight = mMaxExpandHeight == 0 && !mWasReset;
Selim Cinekd2319fb2014-09-01 19:41:54 +0200330 updateMaxExpandHeight();
Jorim Jaggibe565df2014-04-28 17:51:23 +0200331 if (updateExpandHeight) {
Jorim Jaggidce3c4c2014-04-29 23:12:24 +0200332 applyExpansionToLayout();
Jorim Jaggibe565df2014-04-28 17:51:23 +0200333 }
Selim Cineka5e211b2014-08-11 17:35:48 +0200334 mWasReset = false;
Selim Cinek1685e632014-04-08 02:27:49 +0200335 }
336
Selim Cinekd2319fb2014-09-01 19:41:54 +0200337 private void updateMaxExpandHeight() {
338 int intrinsicBefore = getIntrinsicHeight();
339 mMaxExpandHeight = mPrivateLayout.getMaxHeight();
340 if (intrinsicBefore != getIntrinsicHeight()) {
341 notifyHeightChanged();
342 }
343 }
344
Jorim Jaggiae441282014-08-01 02:45:18 +0200345 public void setSensitive(boolean sensitive) {
346 mSensitive = sensitive;
347 }
348
349 public void setHideSensitiveForIntrinsicHeight(boolean hideSensitive) {
350 mShowingPublicForIntrinsicHeight = mSensitive && hideSensitive;
351 }
352
353 public void setHideSensitive(boolean hideSensitive, boolean animated, long delay,
354 long duration) {
355 boolean oldShowingPublic = mShowingPublic;
356 mShowingPublic = mSensitive && hideSensitive;
357 if (mShowingPublicInitialized && mShowingPublic == oldShowingPublic) {
358 return;
359 }
Dan Sandlera5e0f412014-01-23 15:11:54 -0500360
361 // bail out if no public version
Selim Cinek1685e632014-04-08 02:27:49 +0200362 if (mPublicLayout.getChildCount() == 0) return;
Dan Sandlera5e0f412014-01-23 15:11:54 -0500363
Jorim Jaggiae441282014-08-01 02:45:18 +0200364 if (!animated) {
365 mPublicLayout.animate().cancel();
366 mPrivateLayout.animate().cancel();
367 mPublicLayout.setAlpha(1f);
368 mPrivateLayout.setAlpha(1f);
369 mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
370 mPrivateLayout.setVisibility(mShowingPublic ? View.INVISIBLE : View.VISIBLE);
371 } else {
372 animateShowingPublic(delay, duration);
373 }
Dan Sandler0d3e62f2014-07-14 17:13:50 -0400374
375 updateVetoButton();
Jorim Jaggiae441282014-08-01 02:45:18 +0200376 mShowingPublicInitialized = true;
377 }
378
379 private void animateShowingPublic(long delay, long duration) {
380 final View source = mShowingPublic ? mPrivateLayout : mPublicLayout;
381 View target = mShowingPublic ? mPublicLayout : mPrivateLayout;
382 source.setVisibility(View.VISIBLE);
383 target.setVisibility(View.VISIBLE);
384 target.setAlpha(0f);
385 source.animate().cancel();
386 target.animate().cancel();
387 source.animate()
388 .alpha(0f)
389 .withLayer()
390 .setStartDelay(delay)
391 .setDuration(duration)
392 .withEndAction(new Runnable() {
393 @Override
394 public void run() {
395 source.setVisibility(View.INVISIBLE);
396 }
397 });
398 target.animate()
399 .alpha(1f)
400 .withLayer()
401 .setStartDelay(delay)
402 .setDuration(duration);
Dan Sandler0d3e62f2014-07-14 17:13:50 -0400403 }
404
405 private void updateVetoButton() {
406 // public versions cannot be dismissed
407 mVetoButton.setVisibility(isClearable() && !mShowingPublic ? View.VISIBLE : View.GONE);
Dan Sandlera5e0f412014-01-23 15:11:54 -0500408 }
Jorim Jaggi251957d2014-04-09 04:24:09 +0200409
Selim Cinek1685e632014-04-08 02:27:49 +0200410 public int getMaxExpandHeight() {
Jorim Jaggiae441282014-08-01 02:45:18 +0200411 return mShowingPublicForIntrinsicHeight ? mRowMinHeight : mMaxExpandHeight;
Chris Wren51c75102013-07-16 20:49:17 -0400412 }
Jorim Jaggi584a7aa2014-04-10 23:26:13 +0200413
Jorim Jaggibe565df2014-04-28 17:51:23 +0200414 @Override
Jorim Jaggi4222d9a2014-04-23 16:13:15 +0200415 public boolean isContentExpandable() {
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200416 NotificationContentView showingLayout = getShowingLayout();
417 return showingLayout.isContentExpandable();
Jorim Jaggi4222d9a2014-04-23 16:13:15 +0200418 }
419
420 @Override
Jorim Jaggid552d9d2014-05-07 19:41:13 +0200421 public void setActualHeight(int height, boolean notifyListeners) {
Selim Cinekc9c00ae2014-05-20 03:33:40 +0200422 mPrivateLayout.setActualHeight(height);
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200423 mPublicLayout.setActualHeight(height);
Selim Cinek024ca592014-09-01 15:11:28 +0200424 mGuts.setActualHeight(height);
Jorim Jaggibe565df2014-04-28 17:51:23 +0200425 invalidate();
Jorim Jaggid552d9d2014-05-07 19:41:13 +0200426 super.setActualHeight(height, notifyListeners);
Jorim Jaggibe565df2014-04-28 17:51:23 +0200427 }
428
429 @Override
430 public int getMaxHeight() {
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200431 NotificationContentView showingLayout = getShowingLayout();
432 return showingLayout.getMaxHeight();
Jorim Jaggibe565df2014-04-28 17:51:23 +0200433 }
434
435 @Override
Jorim Jaggi4222d9a2014-04-23 16:13:15 +0200436 public int getMinHeight() {
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200437 NotificationContentView showingLayout = getShowingLayout();
438 return showingLayout.getMinHeight();
Jorim Jaggi4222d9a2014-04-23 16:13:15 +0200439 }
440
441 @Override
Jorim Jaggibe565df2014-04-28 17:51:23 +0200442 public void setClipTopAmount(int clipTopAmount) {
443 super.setClipTopAmount(clipTopAmount);
444 mPrivateLayout.setClipTopAmount(clipTopAmount);
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200445 mPublicLayout.setClipTopAmount(clipTopAmount);
Selim Cinek024ca592014-09-01 15:11:28 +0200446 mGuts.setClipTopAmount(clipTopAmount);
Jorim Jaggibe565df2014-04-28 17:51:23 +0200447 }
448
449 public void notifyContentUpdated() {
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200450 mPublicLayout.notifyContentUpdated();
Jorim Jaggibe565df2014-04-28 17:51:23 +0200451 mPrivateLayout.notifyContentUpdated();
Selim Cinek343e6e22014-04-11 21:23:30 +0200452 }
Selim Cinek7d447722014-06-10 15:51:59 +0200453
Selim Cinek31094df2014-08-14 19:28:15 +0200454 public boolean isMaxExpandHeightInitialized() {
455 return mMaxExpandHeight != 0;
Selim Cinek7d447722014-06-10 15:51:59 +0200456 }
Selim Cinek2f0df8a2014-06-10 17:40:42 +0200457
458 private NotificationContentView getShowingLayout() {
459 return mShowingPublic ? mPublicLayout : mPrivateLayout;
460 }
Chris Wren78403d72014-07-28 10:23:24 +0100461
462 public void setExpansionLogger(ExpansionLogger logger, String key) {
463 mLogger = logger;
464 mLoggingKey = key;
465 }
466
467
468 private void logExpansionEvent(boolean userAction, boolean wasExpanded) {
469 final boolean nowExpanded = isExpanded();
470 if (wasExpanded != nowExpanded && mLogger != null) {
471 mLogger.logNotificationExpansion(mLoggingKey, userAction, nowExpanded) ;
472 }
473 }
Chris Wren51c75102013-07-16 20:49:17 -0400474}