AutoScroller.java revision b31c3281d870e9abb673db239234d580dcc4feff
1/* 2 * Copyright 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 17package androidx.recyclerview.selection; 18 19import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; 20 21import android.graphics.Point; 22import androidx.annotation.NonNull; 23import androidx.annotation.RestrictTo; 24 25/** 26 * Provides support for auto-scrolling a view. 27 * 28 * @hide 29 */ 30@RestrictTo(LIBRARY_GROUP) 31public abstract class AutoScroller { 32 33 /** 34 * Resets state of the scroller. Call this when the user activity that is driving 35 * auto-scrolling is done. 36 */ 37 public abstract void reset(); 38 39 /** 40 * Processes a new input location. 41 * @param location 42 */ 43 public abstract void scroll(@NonNull Point location); 44} 45