Replace CardView usages with MaterialCardView.

This commit is contained in:
Alex Hart
2023-03-08 14:55:19 -04:00
parent f1c2ee9b32
commit 2d3e8ef31c
37 changed files with 272 additions and 76 deletions

View File

@@ -6,8 +6,8 @@ import android.graphics.Path
import android.graphics.Rect
import android.graphics.RectF
import android.util.AttributeSet
import androidx.cardview.widget.CardView
import androidx.core.graphics.withClip
import com.google.android.material.card.MaterialCardView
/**
* Adds manual clipping around the card. This ensures that software rendering
@@ -16,7 +16,7 @@ import androidx.core.graphics.withClip
class ClippedCardView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : CardView(context, attrs) {
) : MaterialCardView(context, attrs) {
private val bounds = Rect()
private val boundsF = RectF()

View File

@@ -28,7 +28,7 @@ import kotlin.jvm.functions.Function2;
* fill the bounds with a gradient.
*
* If you wish to apply clipping to this drawable, it is recommended to either use it with
* a CardView or utilize {@link org.thoughtcrime.securesms.util.CustomDrawWrapperKt#customizeOnDraw(Drawable, Function2)}
* a MaterialCardView or utilize {@link org.thoughtcrime.securesms.util.CustomDrawWrapperKt#customizeOnDraw(Drawable, Function2)}
*/
public final class RotatableGradientDrawable extends Drawable {

View File

@@ -7,10 +7,10 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.cardview.widget.CardView;
import com.google.android.flexbox.AlignItems;
import com.google.android.flexbox.FlexboxLayout;
import com.google.android.material.card.MaterialCardView;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.events.CallParticipant;
@@ -116,7 +116,7 @@ public class CallParticipantsLayout extends FlexboxLayout {
private void update(int index, int count, @NonNull CallParticipant participant) {
View view = getChildAt(index);
CardView cardView = view.findViewById(R.id.group_call_participant_card_wrapper);
MaterialCardView cardView = view.findViewById(R.id.group_call_participant_card_wrapper);
CallParticipantView callParticipantView = view.findViewById(R.id.group_call_participant);
callParticipantView.setCallParticipant(participant);