Fix a bunch of random lint warnings.

This commit is contained in:
Greyson Parrelli
2023-02-26 13:45:24 -05:00
committed by Nicholas Tinsley
parent ce4b7c2d7f
commit 6922886395
75 changed files with 293 additions and 213 deletions

View File

@@ -392,7 +392,6 @@ public class Util {
}
}
@TargetApi(VERSION_CODES.LOLLIPOP)
public static boolean isMmsCapable(Context context) {
return (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) || OutgoingLegacyMmsConnection.isConnectionPossible(context);
}
@@ -418,12 +417,10 @@ public class Util {
else return Uri.parse(uri);
}
@TargetApi(VERSION_CODES.KITKAT)
public static boolean isLowMemory(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
return (VERSION.SDK_INT >= VERSION_CODES.KITKAT && activityManager.isLowRamDevice()) ||
activityManager.getLargeMemoryClass() <= 64;
return activityManager.isLowRamDevice() || activityManager.getLargeMemoryClass() <= 64;
}
public static int clamp(int value, int min, int max) {

View File

@@ -14,6 +14,7 @@ import androidx.core.content.withStyledAttributes
import com.google.android.material.button.MaterialButton
import com.google.android.material.progressindicator.CircularProgressIndicator
import com.google.android.material.theme.overlay.MaterialThemeOverlay
import org.signal.core.util.getParcelableCompat
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.util.visible
import kotlin.math.max
@@ -76,7 +77,7 @@ class CircularProgressMaterialButton @JvmOverloads constructor(
override fun onRestoreInstanceState(state: Parcelable) {
val stateBundle = state as Bundle
val superState: Parcelable? = stateBundle.getParcelable(SUPER_STATE)
val superState: Parcelable? = stateBundle.getParcelableCompat(SUPER_STATE, Parcelable::class.java)
super.onRestoreInstanceState(superState)
currentState = if (materialButton.visibility == INVISIBLE) State.PROGRESS else State.BUTTON