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 package com.android.car.ui.recyclerview;
17 
18 import android.view.View;
19 
20 import androidx.recyclerview.widget.RecyclerView;
21 
22 /**
23  * An abstract class that defines required contract for a custom scroll bar for the {@link
24  * CarUiRecyclerView}. All custom scroll bar must inherit from this class.
25  */
26 public interface ScrollBar {
27     /**
28      * The concrete class should implement this method to initialize configuration of a scrollbar
29      * view.
30      */
initialize(RecyclerView recyclerView, View scrollView)31     void initialize(RecyclerView recyclerView, View scrollView);
32 
33     /**
34      * Requests layout of the scrollbar. Should be called when there's been a change that will
35      * affect
36      * the size of the scrollbar view.
37      */
requestLayout()38     void requestLayout();
39 
40     /** Sets the padding of the scrollbar, relative to the padding of the RecyclerView. */
setPadding(int paddingStart, int paddingEnd)41     void setPadding(int paddingStart, int paddingEnd);
42 }
43