1 /* 2 * Copyright (C) 2024 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.notetask 18 19 import android.os.Parcel 20 import android.os.Parcelable 21 22 enum class NoteTaskBubbleExpandBehavior : Parcelable { 23 /** 24 * The default bubble expand behavior for note task bubble: The bubble will collapse if there is 25 * already an expanded bubble, The bubble will expand if there is a collapsed bubble. 26 */ 27 DEFAULT, 28 /** 29 * The special bubble expand behavior for note task bubble: The bubble will stay expanded, not 30 * collapse, if there is already an expanded bubble, The bubble will expand if there is a 31 * collapsed bubble. 32 */ 33 KEEP_IF_EXPANDED; 34 describeContentsnull35 override fun describeContents(): Int { 36 return 0 37 } 38 writeToParcelnull39 override fun writeToParcel(dest: Parcel, flags: Int) { 40 dest.writeString(name) 41 } 42 43 companion object CREATOR : Parcelable.Creator<NoteTaskBubbleExpandBehavior> { createFromParcelnull44 override fun createFromParcel(parcel: Parcel?): NoteTaskBubbleExpandBehavior { 45 return parcel?.readString()?.let { valueOf(it) } ?: DEFAULT 46 } 47 newArraynull48 override fun newArray(size: Int) = arrayOfNulls<NoteTaskBubbleExpandBehavior>(size) 49 } 50 } 51