1 /* 2 * Copyright (C) 2018 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.notification.stack; 18 19 import com.android.systemui.statusbar.notification.row.ExpandableView; 20 21 /** 22 * Represents the bounds of a section of the notification shade and handles animation when the 23 * bounds change. 24 */ 25 public class NotificationSection { 26 private @PriorityBucket final int mBucket; 27 private ExpandableView mFirstVisibleChild; 28 private ExpandableView mLastVisibleChild; 29 NotificationSection(@riorityBucket int bucket)30 NotificationSection(@PriorityBucket int bucket) { 31 mBucket = bucket; 32 } 33 34 @PriorityBucket getBucket()35 public int getBucket() { 36 return mBucket; 37 } 38 39 getFirstVisibleChild()40 public ExpandableView getFirstVisibleChild() { 41 return mFirstVisibleChild; 42 } 43 getLastVisibleChild()44 public ExpandableView getLastVisibleChild() { 45 return mLastVisibleChild; 46 } 47 setFirstVisibleChild(ExpandableView child)48 public boolean setFirstVisibleChild(ExpandableView child) { 49 boolean changed = mFirstVisibleChild != child; 50 mFirstVisibleChild = child; 51 return changed; 52 } 53 setLastVisibleChild(ExpandableView child)54 public boolean setLastVisibleChild(ExpandableView child) { 55 boolean changed = mLastVisibleChild != child; 56 mLastVisibleChild = child; 57 return changed; 58 } 59 60 } 61