1 /* 2 * Copyright (C) 2017 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 package com.android.systemui.statusbar; 17 18 import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; 19 20 /** 21 * An abstraction of something that presents notifications, e.g. CentralSurfaces. Contains methods 22 * for both querying the state of the system (some modularised piece of functionality may 23 * want to act differently based on e.g. whether the presenter is visible to the user or not) and 24 * for affecting the state of the system (e.g. starting an intent, given that the presenter may 25 * want to perform some action before doing so). 26 */ 27 public interface NotificationPresenter extends ExpandableNotificationRow.OnExpandClickListener { 28 /** 29 * Returns true if the presenter is not visible. For example, it may not be necessary to do 30 * animations if this returns true. 31 */ isPresenterFullyCollapsed()32 boolean isPresenterFullyCollapsed(); 33 34 /** 35 * Called when the current user changes. 36 * @param newUserId new user id 37 */ onUserSwitched(int newUserId)38 void onUserSwitched(int newUserId); 39 40 /** 41 * Called when a new row is created and bound to a notification. 42 */ onBindRow(ExpandableNotificationRow row)43 void onBindRow(ExpandableNotificationRow row); 44 45 /** 46 * @return true iff the device is in vr mode 47 */ isDeviceInVrMode()48 boolean isDeviceInVrMode(); 49 50 /** 51 * @return true if the shade is collapsing. 52 */ isCollapsing()53 boolean isCollapsing(); 54 } 55