Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 1 | /* |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 2 | * Copyright (C) 2020 The Android Open Source Project |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 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 | |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 17 | package com.android.systemui.statusbar.notification.collection.inflation; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 18 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 19 | import static java.util.Objects.requireNonNull; |
| 20 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 21 | import android.annotation.Nullable; |
| 22 | import android.content.Context; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 23 | import android.os.Build; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 24 | import android.view.ViewGroup; |
| 25 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 26 | import com.android.internal.util.NotificationMessagingUtil; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 27 | import com.android.systemui.statusbar.NotificationLockscreenUserManager; |
| 28 | import com.android.systemui.statusbar.NotificationPresenter; |
| 29 | import com.android.systemui.statusbar.NotificationRemoteInputManager; |
| 30 | import com.android.systemui.statusbar.NotificationUiAdjustment; |
Ned Burns | c586467 | 2019-02-20 12:57:29 -0500 | [diff] [blame] | 31 | import com.android.systemui.statusbar.notification.InflationException; |
| 32 | import com.android.systemui.statusbar.notification.NotificationClicker; |
Ned Burns | 012048d | 2020-01-08 19:57:30 -0500 | [diff] [blame] | 33 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 34 | import com.android.systemui.statusbar.notification.icon.IconManager; |
Beverly Tai | d1e175c | 2020-03-10 16:37:04 +0000 | [diff] [blame] | 35 | import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 36 | import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 37 | import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowController; |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 38 | import com.android.systemui.statusbar.notification.row.NotifBindPipeline; |
Kevin Han | 0f98a6d | 2019-12-13 16:28:54 -0800 | [diff] [blame] | 39 | import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder; |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 40 | import com.android.systemui.statusbar.notification.row.RowContentBindParams; |
| 41 | import com.android.systemui.statusbar.notification.row.RowContentBindStage; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 42 | import com.android.systemui.statusbar.notification.row.RowInflaterTask; |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 43 | import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 44 | import com.android.systemui.statusbar.notification.stack.NotificationListContainer; |
Daulet Zhanguzin | d0549ae | 2020-01-03 11:08:54 +0000 | [diff] [blame] | 45 | |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 46 | import javax.inject.Inject; |
Dave Mankoff | 56fe9e4 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 47 | import javax.inject.Provider; |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 48 | import javax.inject.Singleton; |
| 49 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 50 | /** Handles inflating and updating views for notifications. */ |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 51 | @Singleton |
Ned Burns | c586467 | 2019-02-20 12:57:29 -0500 | [diff] [blame] | 52 | public class NotificationRowBinderImpl implements NotificationRowBinder { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 53 | |
| 54 | private static final String TAG = "NotificationViewManager"; |
| 55 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 56 | private final Context mContext; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 57 | private final NotificationMessagingUtil mMessagingUtil; |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 58 | private final NotificationRemoteInputManager mNotificationRemoteInputManager; |
| 59 | private final NotificationLockscreenUserManager mNotificationLockscreenUserManager; |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 60 | private final NotifBindPipeline mNotifBindPipeline; |
| 61 | private final RowContentBindStage mRowContentBindStage; |
| 62 | private final NotificationInterruptStateProvider mNotificationInterruptStateProvider; |
| 63 | private final Provider<RowInflaterTask> mRowInflaterTaskProvider; |
| 64 | private final ExpandableNotificationRowComponent.Builder |
| 65 | mExpandableNotificationRowComponentBuilder; |
| 66 | private final IconManager mIconManager; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 67 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 68 | private NotificationPresenter mPresenter; |
| 69 | private NotificationListContainer mListContainer; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 70 | private BindRowCallback mBindRowCallback; |
| 71 | private NotificationClicker mNotificationClicker; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 72 | |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 73 | @Inject |
Evan Laird | 181de62 | 2019-10-24 09:53:02 -0400 | [diff] [blame] | 74 | public NotificationRowBinderImpl( |
| 75 | Context context, |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 76 | NotificationMessagingUtil notificationMessagingUtil, |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 77 | NotificationRemoteInputManager notificationRemoteInputManager, |
| 78 | NotificationLockscreenUserManager notificationLockscreenUserManager, |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 79 | NotifBindPipeline notifBindPipeline, |
| 80 | RowContentBindStage rowContentBindStage, |
Beverly Tai | d1e175c | 2020-03-10 16:37:04 +0000 | [diff] [blame] | 81 | NotificationInterruptStateProvider notificationInterruptionStateProvider, |
Dave Mankoff | 56fe9e4 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 82 | Provider<RowInflaterTask> rowInflaterTaskProvider, |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 83 | ExpandableNotificationRowComponent.Builder expandableNotificationRowComponentBuilder, |
| 84 | IconManager iconManager) { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 85 | mContext = context; |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 86 | mNotifBindPipeline = notifBindPipeline; |
| 87 | mRowContentBindStage = rowContentBindStage; |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 88 | mMessagingUtil = notificationMessagingUtil; |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 89 | mNotificationRemoteInputManager = notificationRemoteInputManager; |
| 90 | mNotificationLockscreenUserManager = notificationLockscreenUserManager; |
Beverly Tai | d1e175c | 2020-03-10 16:37:04 +0000 | [diff] [blame] | 91 | mNotificationInterruptStateProvider = notificationInterruptionStateProvider; |
Dave Mankoff | 56fe9e4 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 92 | mRowInflaterTaskProvider = rowInflaterTaskProvider; |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 93 | mExpandableNotificationRowComponentBuilder = expandableNotificationRowComponentBuilder; |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 94 | mIconManager = iconManager; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 95 | } |
| 96 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 97 | /** |
| 98 | * Sets up late-bound dependencies for this component. |
| 99 | */ |
| 100 | public void setUpWithPresenter(NotificationPresenter presenter, |
| 101 | NotificationListContainer listContainer, |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 102 | BindRowCallback bindRowCallback) { |
| 103 | mPresenter = presenter; |
| 104 | mListContainer = listContainer; |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 105 | mBindRowCallback = bindRowCallback; |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 106 | |
| 107 | mIconManager.attach(); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | public void setNotificationClicker(NotificationClicker clicker) { |
| 111 | mNotificationClicker = clicker; |
| 112 | } |
| 113 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 114 | /** |
| 115 | * Inflates the views for the given entry (possibly asynchronously). |
| 116 | */ |
Ned Burns | c586467 | 2019-02-20 12:57:29 -0500 | [diff] [blame] | 117 | @Override |
Kevin Han | bd14293 | 2020-03-10 18:27:50 -0700 | [diff] [blame] | 118 | public void inflateViews( |
| 119 | NotificationEntry entry, |
| 120 | Runnable onDismissRunnable, |
| 121 | NotificationRowContentBinder.InflationCallback callback) |
Gus Prevas | 86928bb | 2019-01-04 16:46:13 -0500 | [diff] [blame] | 122 | throws InflationException { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 123 | ViewGroup parent = mListContainer.getViewParentForNotification(entry); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 124 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 125 | if (entry.rowExists()) { |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 126 | mIconManager.updateIcons(entry); |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 127 | ExpandableNotificationRow row = entry.getRow(); |
| 128 | row.reset(); |
| 129 | updateRow(entry, row); |
Kevin Han | bd14293 | 2020-03-10 18:27:50 -0700 | [diff] [blame] | 130 | inflateContentViews(entry, row, callback); |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 131 | entry.getRowController().setOnDismissRunnable(onDismissRunnable); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 132 | } else { |
Ned Burns | d8b5154 | 2020-03-13 20:52:43 -0400 | [diff] [blame] | 133 | mIconManager.createIcons(entry); |
Dave Mankoff | 56fe9e4 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 134 | mRowInflaterTaskProvider.get().inflate(mContext, parent, entry, |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 135 | row -> { |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 136 | // Setup the controller for the view. |
| 137 | ExpandableNotificationRowComponent component = |
| 138 | mExpandableNotificationRowComponentBuilder |
| 139 | .expandableNotificationRow(row) |
| 140 | .notificationEntry(entry) |
| 141 | .onDismissRunnable(onDismissRunnable) |
Dave Mankoff | c0211ff | 2020-02-07 15:36:12 -0500 | [diff] [blame] | 142 | .rowContentBindStage(mRowContentBindStage) |
| 143 | .onExpandClickListener(mPresenter) |
| 144 | .build(); |
| 145 | ExpandableNotificationRowController rowController = |
| 146 | component.getExpandableNotificationRowController(); |
| 147 | rowController.init(); |
| 148 | entry.setRowController(rowController); |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 149 | bindRow(entry, row); |
| 150 | updateRow(entry, row); |
Kevin Han | bd14293 | 2020-03-10 18:27:50 -0700 | [diff] [blame] | 151 | inflateContentViews(entry, row, callback); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 152 | }); |
| 153 | } |
| 154 | } |
| 155 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 156 | /** |
| 157 | * Bind row to various controllers and managers. This is only called when the row is first |
| 158 | * created. |
| 159 | * |
| 160 | * TODO: This method associates a row with an entry, but eventually needs to not do that |
| 161 | */ |
| 162 | private void bindRow(NotificationEntry entry, ExpandableNotificationRow row) { |
Kevin Han | 5182c9f | 2020-01-07 17:54:43 -0800 | [diff] [blame] | 163 | mListContainer.bindRow(row); |
| 164 | mNotificationRemoteInputManager.bindRow(row); |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 165 | row.setOnActivatedListener(mPresenter); |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 166 | entry.setRow(row); |
| 167 | row.setEntry(entry); |
| 168 | mNotifBindPipeline.manageRow(entry, row); |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 169 | mBindRowCallback.onBindRow(row); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Updates the views bound to an entry when the entry's ranking changes, either in-place or by |
| 174 | * reinflating them. |
Kevin Han | bd14293 | 2020-03-10 18:27:50 -0700 | [diff] [blame] | 175 | * |
| 176 | * TODO: Should this method be in this class? |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 177 | */ |
Ned Burns | c586467 | 2019-02-20 12:57:29 -0500 | [diff] [blame] | 178 | @Override |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 179 | public void onNotificationRankingUpdated( |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 180 | NotificationEntry entry, |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 181 | @Nullable Integer oldImportance, |
| 182 | NotificationUiAdjustment oldAdjustment, |
Kevin Han | 1390930 | 2020-04-15 14:53:17 -0700 | [diff] [blame] | 183 | NotificationUiAdjustment newAdjustment, |
| 184 | NotificationRowContentBinder.InflationCallback callback) { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 185 | if (NotificationUiAdjustment.needReinflate(oldAdjustment, newAdjustment)) { |
| 186 | if (entry.rowExists()) { |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 187 | ExpandableNotificationRow row = entry.getRow(); |
| 188 | row.reset(); |
| 189 | updateRow(entry, row); |
Kevin Han | 1390930 | 2020-04-15 14:53:17 -0700 | [diff] [blame] | 190 | inflateContentViews(entry, row, callback); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 191 | } else { |
| 192 | // Once the RowInflaterTask is done, it will pick up the updated entry, so |
| 193 | // no-op here. |
| 194 | } |
| 195 | } else { |
Ned Burns | 60e9459 | 2019-09-06 14:47:25 -0400 | [diff] [blame] | 196 | if (oldImportance != null && entry.getImportance() != oldImportance) { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 197 | if (entry.rowExists()) { |
| 198 | entry.getRow().onNotificationRankingUpdated(); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 204 | /** |
| 205 | * Update row after the notification has updated. |
| 206 | * |
| 207 | * @param entry notification that has updated |
| 208 | */ |
| 209 | private void updateRow( |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 210 | NotificationEntry entry, |
Ned Burns | f529ec2 | 2019-02-12 19:33:50 -0500 | [diff] [blame] | 211 | ExpandableNotificationRow row) { |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 212 | row.setLegacy(entry.targetSdk >= Build.VERSION_CODES.GINGERBREAD |
| 213 | && entry.targetSdk < Build.VERSION_CODES.LOLLIPOP); |
| 214 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 215 | // bind the click event to the content area |
| 216 | requireNonNull(mNotificationClicker).register(row, entry.getSbn()); |
| 217 | } |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 218 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 219 | /** |
| 220 | * Inflate the row's basic content views. |
| 221 | */ |
| 222 | private void inflateContentViews( |
| 223 | NotificationEntry entry, |
Kevin Han | bd14293 | 2020-03-10 18:27:50 -0700 | [diff] [blame] | 224 | ExpandableNotificationRow row, |
Kevin Han | 1390930 | 2020-04-15 14:53:17 -0700 | [diff] [blame] | 225 | @Nullable NotificationRowContentBinder.InflationCallback inflationCallback) { |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 226 | final boolean useIncreasedCollapsedHeight = |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 227 | mMessagingUtil.isImportantMessaging(entry.getSbn(), entry.getImportance()); |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 228 | final boolean isLowPriority = entry.isAmbient(); |
| 229 | |
| 230 | RowContentBindParams params = mRowContentBindStage.getStageParams(entry); |
| 231 | params.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 232 | params.setUseLowPriority(entry.isAmbient()); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 233 | |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 234 | // TODO: Replace this API with RowContentBindParams directly. Also move to a separate |
| 235 | // redaction controller. |
Dave Mankoff | 02dcaf5 | 2020-01-08 15:42:06 -0500 | [diff] [blame] | 236 | row.setNeedsRedaction(mNotificationLockscreenUserManager.needsRedaction(entry)); |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 237 | |
Kevin Han | 2745336 | 2020-02-06 16:54:50 -0800 | [diff] [blame] | 238 | params.rebindAllContentViews(); |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 239 | mRowContentBindStage.requestRebind(entry, en -> { |
| 240 | row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight); |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 241 | row.setIsLowPriority(isLowPriority); |
Kevin Han | 1390930 | 2020-04-15 14:53:17 -0700 | [diff] [blame] | 242 | if (inflationCallback != null) { |
| 243 | inflationCallback.onAsyncInflationFinished(en); |
| 244 | } |
Kevin Han | 933dc7c | 2020-01-29 11:17:46 -0800 | [diff] [blame] | 245 | }); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 246 | } |
| 247 | |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 248 | /** Callback for when a row is bound to an entry. */ |
| 249 | public interface BindRowCallback { |
| 250 | /** |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 251 | * Called when a new row is created and bound to a notification. |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 252 | */ |
Kevin Han | 3742322 | 2020-03-10 16:05:07 -0700 | [diff] [blame] | 253 | void onBindRow(ExpandableNotificationRow row); |
Gus Prevas | 8ba88a8 | 2018-12-18 11:13:44 -0500 | [diff] [blame] | 254 | } |
| 255 | } |