1 /* 2 * Copyright (C) 2023 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.statusbar.data.model 18 19 import com.android.systemui.statusbar.phone.BarTransitions 20 import com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT 21 import com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT_TRANSPARENT 22 import com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE 23 import com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT 24 import com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT 25 import com.android.systemui.statusbar.phone.BarTransitions.TransitionMode 26 27 /** 28 * The possible status bar modes. 29 * 30 * See the associated [BarTransitions] mode documentation for information about each of the modes 31 * and how they're used. 32 */ 33 enum class StatusBarMode { 34 /** Use a semi-transparent (aka translucent) background for the status bar. */ 35 SEMI_TRANSPARENT, 36 /** 37 * A mode where notification icons in the status bar are hidden and replaced by a dot (this mode 38 * can be requested by apps). See 39 * [com.android.systemui.statusbar.phone.LegacyLightsOutNotifController] and 40 * [com.android.systemui.statusbar.phone.domain.interactor.LightsOutInteractor]. 41 */ 42 LIGHTS_OUT, 43 /** Similar to [LIGHTS_OUT], but also with a transparent background for the status bar. */ 44 LIGHTS_OUT_TRANSPARENT, 45 /** Use an opaque background for the status bar. */ 46 OPAQUE, 47 /** Use a transparent background for the status bar. */ 48 TRANSPARENT; 49 50 /** Converts a [StatusBarMode] to its [BarTransitions] integer. */ 51 @TransitionMode toTransitionModeIntnull52 fun toTransitionModeInt(): Int { 53 return when (this) { 54 SEMI_TRANSPARENT -> MODE_SEMI_TRANSPARENT 55 LIGHTS_OUT -> MODE_LIGHTS_OUT 56 LIGHTS_OUT_TRANSPARENT -> MODE_LIGHTS_OUT_TRANSPARENT 57 OPAQUE -> MODE_OPAQUE 58 TRANSPARENT -> MODE_TRANSPARENT 59 } 60 } 61 } 62