1 /*
2  * Copyright (C) 2021 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.widget.LinearLayout;
19 
20 import androidx.annotation.IntDef;
21 import androidx.recyclerview.widget.RecyclerView.LayoutManager;
22 
23 import com.android.car.ui.recyclerview.CarUiRecyclerView.CarUiRecyclerViewLayout;
24 import com.android.car.ui.recyclerview.CarUiRecyclerView.Size;
25 
26 import java.lang.annotation.Retention;
27 import java.lang.annotation.RetentionPolicy;
28 
29 /**
30  * CarUi proxy class for {@link LayoutManager}
31  */
32 public interface CarUiLayoutStyle {
33 
34     @IntDef({HORIZONTAL, VERTICAL})
35     @Retention(RetentionPolicy.SOURCE)
36     @interface Orientation {
37     }
38     int HORIZONTAL = LinearLayout.HORIZONTAL;
39     int VERTICAL = LinearLayout.VERTICAL;
40 
41     /** Returns number of recyclerview spans */
getSpanCount()42     int getSpanCount();
43 
44     /** Returns {@link CarUiRecyclerViewLayout} */
45     @CarUiRecyclerViewLayout
getLayoutType()46     int getLayoutType();
47 
48     /** Returns layout direction {@link Orientation} */
49     @Orientation
getOrientation()50     int getOrientation();
51 
52     /** Returns true if layout is reversed */
getReverseLayout()53     boolean getReverseLayout();
54 
55     /** Returns CarUiRecyclerView size */
56     @Size
getSize()57     int getSize();
58 }
59