Messaging: Remove compatibility for old android versions

Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 9bbc7a8f99
commit 7c55a6d56a
104 changed files with 580 additions and 2306 deletions
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,19 +20,12 @@ import android.animation.RectEvaluator;
import android.animation.TypeEvaluator;
import android.graphics.Rect;
import com.android.messaging.util.OsUtil;
/**
* This evaluator can be used to perform type interpolation between <code>Rect</code> values.
* It's backward compatible to Api Level 11.
*/
public class RectEvaluatorCompat implements TypeEvaluator<Rect> {
public static TypeEvaluator<Rect> create() {
if (OsUtil.isAtLeastJB_MR2()) {
return new RectEvaluator();
} else {
return new RectEvaluatorCompat();
}
return new RectEvaluator();
}
@Override
@@ -15,7 +15,6 @@
*/
package com.android.messaging.ui.animation;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
@@ -34,7 +33,6 @@ import android.widget.FrameLayout;
import com.android.messaging.R;
import com.android.messaging.util.ImageUtils;
import com.android.messaging.util.OsUtil;
import com.android.messaging.util.UiUtils;
/**
@@ -69,20 +67,15 @@ public class ViewGroupItemVerticalExplodeAnimation {
*/
public static void startAnimationForView(final ViewGroup container, final View viewToAnimate,
final View animationStagingView, final boolean snapshotView, final int duration) {
if (OsUtil.isAtLeastJB_MR2() && (viewToAnimate.getContext() instanceof Activity)) {
if ((viewToAnimate.getContext() instanceof Activity)) {
new ViewExplodeAnimationJellyBeanMR2(viewToAnimate, container, snapshotView, duration)
.startAnimation();
} else {
// Pre JB_MR2, this animation can cause rendering failures which causes the framework
// to fall back to software rendering where camera preview isn't supported (b/18264647)
// just skip the animation to avoid this case.
}
}
/**
* Implementation class for API level >= 18.
*/
@TargetApi(18)
private static class ViewExplodeAnimationJellyBeanMR2 {
private final View mViewToAnimate;
private final ViewGroup mContainer;