1 /* 2 * Copyright (C) 2021 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.navigationbar; 18 19 import android.content.Context; 20 import android.graphics.Rect; 21 import android.view.View; 22 23 import com.android.systemui.dagger.SysUISingleton; 24 25 import java.util.function.Consumer; 26 27 import javax.inject.Inject; 28 29 /** Contains logic that deals with showing buttons with navigation bar. */ 30 @SysUISingleton 31 public class NavigationBarOverlayController { 32 33 protected final Context mContext; 34 35 @Inject NavigationBarOverlayController(Context context)36 public NavigationBarOverlayController(Context context) { 37 mContext = context; 38 } 39 getContext()40 public Context getContext() { 41 return mContext; 42 } 43 isNavigationBarOverlayEnabled()44 public boolean isNavigationBarOverlayEnabled() { 45 return false; 46 } 47 48 /** 49 * Initialize the controller with visibility change callback. 50 */ init(Consumer<Boolean> visibilityChangeCallback, Consumer<Rect> excludeBackRegionCallback)51 public void init(Consumer<Boolean> visibilityChangeCallback, 52 Consumer<Rect> excludeBackRegionCallback) {} 53 54 /** 55 * Set whether the view can be shown. 56 */ setCanShow(boolean canShow)57 public void setCanShow(boolean canShow) {} 58 59 /** 60 * Set the buttons visibility. 61 */ setButtonState(boolean visible, boolean force)62 public void setButtonState(boolean visible, boolean force) {} 63 64 /** 65 * Register necessary listeners, called when NavigationBarView is attached to window. 66 */ registerListeners()67 public void registerListeners() {} 68 69 /** 70 * Unregister listeners, called when navigationBarView is detached from window. 71 */ unregisterListeners()72 public void unregisterListeners() {} 73 74 /** 75 * Return the current view. 76 */ getCurrentView()77 public View getCurrentView() { 78 return null; 79 } 80 81 /** 82 * Return the visibility of the view. 83 */ isVisible()84 public boolean isVisible() { 85 return false; 86 } 87 } 88