1 /* 2 * Copyright (C) 2017 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 package com.android.wallpaper.picker.individual; 17 18 /** 19 * Interface for a class which adds a visual selection state (which may be animated between the 20 * selected and deselected state) to a ViewHolder. 21 */ 22 public interface SelectionAnimator { isSelected()23 boolean isSelected(); 24 25 /** 26 * Sets the UI to selected immediately with no animation. 27 */ selectImmediately()28 void selectImmediately(); 29 30 /** 31 * Sets the UI to deselected immediately with no animation. 32 */ deselectImmediately()33 void deselectImmediately(); 34 35 /** 36 * Sets the UI to selected with a smooth animation. 37 */ animateSelected()38 void animateSelected(); 39 40 /** 41 * Sets the UI to deselected with a smooth animation. 42 */ animateDeselected()43 void animateDeselected(); 44 45 /** 46 * Sets the UI to show a loading indicator. 47 */ showLoading()48 void showLoading(); 49 50 /** 51 * Sets the UI to hide the loading indicator. 52 */ showNotLoading()53 void showNotLoading(); 54 } 55