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