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 android.app.UiModeManager;
20 import android.content.Context;
21 
22 import com.android.systemui.broadcast.BroadcastDispatcher;
23 import com.android.systemui.car.CarDeviceProvisionedController;
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 bottom navigation bar.
35  */
36 @SysUISingleton
37 public class BottomNotificationPanelViewMediator extends NotificationPanelViewMediator {
38 
39     @Inject
BottomNotificationPanelViewMediator( Context context, CarSystemBarController carSystemBarController, NotificationPanelViewController notificationPanelViewController, PowerManagerHelper powerManagerHelper, BroadcastDispatcher broadcastDispatcher, UserTracker userTracker, CarDeviceProvisionedController carDeviceProvisionedController, ConfigurationController configurationController, UiModeManager uiModeManager )40     public BottomNotificationPanelViewMediator(
41             Context context,
42             CarSystemBarController carSystemBarController,
43             NotificationPanelViewController notificationPanelViewController,
44             PowerManagerHelper powerManagerHelper,
45             BroadcastDispatcher broadcastDispatcher,
46             UserTracker userTracker,
47             CarDeviceProvisionedController carDeviceProvisionedController,
48             ConfigurationController configurationController,
49             UiModeManager uiModeManager
50     ) {
51         super(context,
52                 carSystemBarController,
53                 notificationPanelViewController,
54                 powerManagerHelper,
55                 broadcastDispatcher,
56                 userTracker,
57                 carDeviceProvisionedController,
58                 configurationController,
59                 uiModeManager);
60         notificationPanelViewController.setOverlayDirection(
61                 OverlayPanelViewController.OVERLAY_FROM_BOTTOM_BAR);
62     }
63 
64     @Override
registerBottomBarTouchListener()65     protected void registerBottomBarTouchListener() {
66         getCarSystemBarController().registerBottomBarTouchListener(
67                 getNotificationPanelViewController().getDragOpenTouchListener());
68     }
69 }
70