1 /* 2 * Copyright (C) 2019 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 androidx.annotation.Nullable; 20 21 import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; 22 23 /** A View that is swipeable inside of the notification shade. */ 24 public interface SwipeableView { 25 26 /** Has this view finished initializing? */ hasFinishedInitialization()27 boolean hasFinishedInitialization(); 28 29 /** Optionally creates a menu for this view. */ createMenu()30 @Nullable NotificationMenuRowPlugin createMenu(); 31 32 /** Sets the translation amount for an in-progress swipe. */ setTranslation(float translate)33 void setTranslation(float translate); 34 35 /** Gets the current translation amount. */ getTranslation()36 float getTranslation(); 37 38 /** Has this view been removed? */ isRemoved()39 boolean isRemoved(); 40 41 /** Resets the swipe translation back to zero state. */ resetTranslation()42 void resetTranslation(); 43 } 44