1 /* 2 * Copyright (C) 2020 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.car.notification; 18 19 import com.android.systemui.broadcast.BroadcastDispatcher; 20 import com.android.systemui.car.CarDeviceProvisionedController; 21 import com.android.systemui.car.systembar.CarSystemBarController; 22 import com.android.systemui.car.window.OverlayPanelViewController; 23 import com.android.systemui.dagger.SysUISingleton; 24 import com.android.systemui.statusbar.policy.ConfigurationController; 25 26 import javax.inject.Inject; 27 28 /** 29 * Implementation of NotificationPanelViewMediator that sets the notification panel to be opened 30 * from the top navigation bar. 31 */ 32 @SysUISingleton 33 public class BottomNotificationPanelViewMediator extends NotificationPanelViewMediator { 34 35 @Inject BottomNotificationPanelViewMediator( CarSystemBarController carSystemBarController, NotificationPanelViewController notificationPanelViewController, PowerManagerHelper powerManagerHelper, BroadcastDispatcher broadcastDispatcher, CarDeviceProvisionedController carDeviceProvisionedController, ConfigurationController configurationController )36 public BottomNotificationPanelViewMediator( 37 CarSystemBarController carSystemBarController, 38 NotificationPanelViewController notificationPanelViewController, 39 40 PowerManagerHelper powerManagerHelper, 41 BroadcastDispatcher broadcastDispatcher, 42 43 CarDeviceProvisionedController carDeviceProvisionedController, 44 ConfigurationController configurationController 45 ) { 46 super(carSystemBarController, 47 notificationPanelViewController, 48 powerManagerHelper, 49 broadcastDispatcher, 50 carDeviceProvisionedController, 51 configurationController); 52 notificationPanelViewController.setOverlayDirection( 53 OverlayPanelViewController.OVERLAY_FROM_BOTTOM_BAR); 54 } 55 56 @Override registerListeners()57 public void registerListeners() { 58 super.registerListeners(); 59 getCarSystemBarController().registerBottomBarTouchListener( 60 getNotificationPanelViewController().getDragOpenTouchListener()); 61 } 62 } 63