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.plugin.oemapis.recyclerview; 17 18 /** 19 * Class for storing recyclerview layout style information. 20 */ 21 public interface LayoutStyleOEMV1 { 22 23 int LAYOUT_TYPE_LINEAR = 0; 24 int LAYOUT_TYPE_GRID = 1; 25 26 int ORIENTATION_HORIZONTAL = 0; 27 int ORIENTATION_VERTICAL = 1; 28 29 /** Returns number of recyclerview spans */ getSpanCount()30 int getSpanCount(); 31 32 /** Returns LAYOUT_TYPE_LINEAR vs LAYOUT_TYPE_GRID */ getLayoutType()33 int getLayoutType(); 34 35 /** Returns layout direction 0 for VERTICAL, 1 for HORIZONTAL */ getOrientation()36 int getOrientation(); 37 38 /** Returns true if layout is reversed */ getReverseLayout()39 boolean getReverseLayout(); 40 41 /** {@link androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup#getSpanSize} */ getSpanSize(int position)42 default int getSpanSize(int position) { 43 return 1; 44 } 45 } 46