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 17 package com.android.systemui.wallet.ui; 18 19 import android.app.PendingIntent; 20 import android.graphics.drawable.Drawable; 21 22 import androidx.annotation.NonNull; 23 import androidx.annotation.Nullable; 24 25 interface WalletCardViewInfo { getCardId()26 String getCardId(); 27 28 /** 29 * Image of the card. 30 */ 31 @NonNull getCardDrawable()32 Drawable getCardDrawable(); 33 34 /** 35 * Content description for the card. 36 */ 37 @Nullable getContentDescription()38 CharSequence getContentDescription(); 39 40 /** 41 * Icon shown above the card. 42 */ 43 @Nullable getIcon()44 Drawable getIcon(); 45 46 /** 47 * Text shown above the card. 48 */ 49 @NonNull getLabel()50 CharSequence getLabel(); 51 52 /** 53 * Pending intent upon the card is clicked. 54 */ 55 @NonNull getPendingIntent()56 PendingIntent getPendingIntent(); 57 isUiEquivalent(WalletCardViewInfo other)58 default boolean isUiEquivalent(WalletCardViewInfo other) { 59 if (other == null) { 60 return false; 61 } 62 return getCardId().equals(other.getCardId()); 63 } 64 } 65