1 /*
2  * Copyright 2018 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 androidx.cardview.widget;
17 
18 import android.content.Context;
19 import android.content.res.ColorStateList;
20 
21 import androidx.annotation.Nullable;
22 
23 /**
24  * Interface for platform specific CardView implementations.
25  */
26 interface CardViewImpl {
initialize(CardViewDelegate cardView, Context context, ColorStateList backgroundColor, float radius, float elevation, float maxElevation)27     void initialize(CardViewDelegate cardView, Context context, ColorStateList backgroundColor,
28             float radius, float elevation, float maxElevation);
29 
setRadius(CardViewDelegate cardView, float radius)30     void setRadius(CardViewDelegate cardView, float radius);
31 
getRadius(CardViewDelegate cardView)32     float getRadius(CardViewDelegate cardView);
33 
setElevation(CardViewDelegate cardView, float elevation)34     void setElevation(CardViewDelegate cardView, float elevation);
35 
getElevation(CardViewDelegate cardView)36     float getElevation(CardViewDelegate cardView);
37 
initStatic()38     void initStatic();
39 
setMaxElevation(CardViewDelegate cardView, float maxElevation)40     void setMaxElevation(CardViewDelegate cardView, float maxElevation);
41 
getMaxElevation(CardViewDelegate cardView)42     float getMaxElevation(CardViewDelegate cardView);
43 
getMinWidth(CardViewDelegate cardView)44     float getMinWidth(CardViewDelegate cardView);
45 
getMinHeight(CardViewDelegate cardView)46     float getMinHeight(CardViewDelegate cardView);
47 
updatePadding(CardViewDelegate cardView)48     void updatePadding(CardViewDelegate cardView);
49 
onCompatPaddingChanged(CardViewDelegate cardView)50     void onCompatPaddingChanged(CardViewDelegate cardView);
51 
onPreventCornerOverlapChanged(CardViewDelegate cardView)52     void onPreventCornerOverlapChanged(CardViewDelegate cardView);
53 
setBackgroundColor(CardViewDelegate cardView, @Nullable ColorStateList color)54     void setBackgroundColor(CardViewDelegate cardView, @Nullable ColorStateList color);
55 
getBackgroundColor(CardViewDelegate cardView)56     ColorStateList getBackgroundColor(CardViewDelegate cardView);
57 }
58