[Cleanup] Removed redundant API 21(Lollipop) or lower version checks as the minimum SDK version is 21

This commit is contained in:
Prathamesh More 2021-11-28 12:17:20 +05:30
parent aefd52c12e
commit de14e72689
11 changed files with 36 additions and 68 deletions

View file

@ -209,10 +209,8 @@ public class CircularImageView extends AppCompatImageView {
private void drawShadow(float shadowRadius, int shadowColor) {
this.shadowRadius = shadowRadius;
this.shadowColor = shadowColor;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
setLayerType(LAYER_TYPE_SOFTWARE, paintBorder);
}
paintBorder.setShadowLayer(shadowRadius, 0.0f, shadowRadius / 2, shadowColor);
paintBorder.setShadowLayer(shadowRadius, 0.0f, shadowRadius / 2, shadowColor);
}
private void updateShader() {

View file

@ -40,12 +40,10 @@ public class StatusBarMarginFrameLayout extends FrameLayout {
@NonNull
@Override
public WindowInsets onApplyWindowInsets(@NonNull WindowInsets insets) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
lp.topMargin = insets.getSystemWindowInsetTop();
lp.bottomMargin = insets.getSystemWindowInsetBottom();
setLayoutParams(lp);
}
return super.onApplyWindowInsets(insets);
return super.onApplyWindowInsets(insets);
}
}