mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Remove unnecessary code now that minSdk is 21.
This commit is contained in:
committed by
Cody Henthorne
parent
8cfd02aff2
commit
3e7dc79fe8
@@ -37,13 +37,6 @@ public final class FullscreenHelper {
|
||||
}
|
||||
|
||||
public void configureToolbarLayout(@NonNull View spacer, @NonNull View toolbar) {
|
||||
if (Build.VERSION.SDK_INT == 19) {
|
||||
setSpacerHeight(spacer, ViewUtil.getStatusBarHeight(spacer));
|
||||
int[] padding = makePaddingValuesForAPI19(activity);
|
||||
toolbar.setPadding(padding[0], 0, padding[1], 0);
|
||||
return;
|
||||
}
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(spacer, (view, insets) -> {
|
||||
setSpacerHeight(view, insets.getSystemWindowInsetTop());
|
||||
return insets;
|
||||
@@ -57,13 +50,6 @@ public final class FullscreenHelper {
|
||||
}
|
||||
|
||||
public static void configureBottomBarLayout(@NonNull Activity activity, @NonNull View spacer, @NonNull View bottomBar) {
|
||||
if (Build.VERSION.SDK_INT == 19) {
|
||||
setSpacerHeight(spacer, ViewUtil.getNavigationBarHeight(spacer));
|
||||
int[] padding = makePaddingValuesForAPI19(activity);
|
||||
bottomBar.setPadding(padding[0], 0, padding[1], 0);
|
||||
return;
|
||||
}
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(spacer, (view, insets) -> {
|
||||
setSpacerHeight(view, insets.getSystemWindowInsetBottom());
|
||||
return insets;
|
||||
|
||||
@@ -86,11 +86,7 @@ public final class Projection {
|
||||
if (corners == null) {
|
||||
path.addRect(rect, Path.Direction.CW);
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
path.addRoundRect(rect, corners.toRadii(), Path.Direction.CW);
|
||||
} else {
|
||||
path.op(path, Path.Op.UNION);
|
||||
}
|
||||
path.addRoundRect(rect, corners.toRadii(), Path.Direction.CW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,27 +122,15 @@ public class StorageUtil {
|
||||
}
|
||||
|
||||
public static @NonNull Uri getVideoUri() {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return getLegacyUri(Environment.DIRECTORY_MOVIES);
|
||||
} else {
|
||||
return MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
return MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
|
||||
public static @NonNull Uri getAudioUri() {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return getLegacyUri(Environment.DIRECTORY_MUSIC);
|
||||
} else {
|
||||
return MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
return MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
|
||||
public static @NonNull Uri getImageUri() {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return getLegacyUri(Environment.DIRECTORY_PICTURES);
|
||||
} else {
|
||||
return MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
return MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||
}
|
||||
|
||||
public static @NonNull Uri getDownloadUri() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.thoughtcrime.securesms.util
|
||||
|
||||
import android.os.Build
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -24,9 +23,7 @@ class TopToastPopup private constructor(parent: ViewGroup, iconResource: Int, de
|
||||
private val description: TextView = contentView.findViewById(R.id.top_toast_popup_description)
|
||||
|
||||
init {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
elevation = ViewUtil.dpToPx(8).toFloat()
|
||||
}
|
||||
elevation = ViewUtil.dpToPx(8).toFloat()
|
||||
animationStyle = R.style.PopupAnimation
|
||||
icon.setImageResource(iconResource)
|
||||
description.text = descriptionText
|
||||
|
||||
@@ -41,9 +41,7 @@ public final class WindowUtil {
|
||||
}
|
||||
|
||||
public static void setNavigationBarColor(@NonNull Context context, @NonNull Window window, @ColorInt int color) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return;
|
||||
} else if (Build.VERSION.SDK_INT < 27) {
|
||||
if (Build.VERSION.SDK_INT < 27) {
|
||||
window.setNavigationBarColor(ThemeUtil.getThemedColor(context, android.R.attr.navigationBarColor));
|
||||
} else {
|
||||
window.setNavigationBarColor(color);
|
||||
@@ -72,8 +70,6 @@ public final class WindowUtil {
|
||||
}
|
||||
|
||||
public static void setStatusBarColor(@NonNull Window window, @ColorInt int color) {
|
||||
if (Build.VERSION.SDK_INT < 21) return;
|
||||
|
||||
window.setStatusBarColor(color);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.thoughtcrime.securesms.util.views
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.util.AttributeSet
|
||||
@@ -116,7 +115,7 @@ class CircularProgressMaterialButton @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
|
||||
if (!animate || Build.VERSION.SDK_INT < 21) {
|
||||
if (!animate) {
|
||||
materialButton.visibility = state.materialButtonVisibility
|
||||
currentState = state
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user