Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fc953b9 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Version code cleanup

  > Renaming Lmp to Lollipop
  > Lollipop_MR1 instead of directly using 22
  > Using M APIs directly instead of reflection

Change-Id: I10a307f46e3be15b3299f549a2fd7e0e215a6a1b
parent b62a9763
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -223,14 +223,12 @@ public class WallpaperCropActivity extends BaseActivity implements Handler.Callb

    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    protected boolean isActivityDestroyed() {
        return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
                && isDestroyed();
        return Utilities.ATLEAST_JB_MR1 && isDestroyed();
    }

    @Thunk void addReusableBitmap(TileSource src) {
        synchronized (mReusableBitmaps) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
                    && src instanceof BitmapRegionTileSource) {
            if (Utilities.ATLEAST_KITKAT && src instanceof BitmapRegionTileSource) {
                Bitmap preview = ((BitmapRegionTileSource) src).getBitmap();
                if (preview != null && preview.isMutable()) {
                    mReusableBitmaps.add(preview);
+2 −4
Original line number Diff line number Diff line
@@ -977,10 +977,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {

        if (partner == null || !partner.hideDefaultWallpaper()) {
            // Add an entry for the default wallpaper (stored in system resources)
            WallpaperTileInfo defaultWallpaperInfo =
                    (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
                    ? getPreKKDefaultWallpaperInfo()
                    : getDefaultWallpaper();
            WallpaperTileInfo defaultWallpaperInfo = Utilities.ATLEAST_KITKAT
                    ? getDefaultWallpaper() : getPreKKDefaultWallpaperInfo();
            if (defaultWallpaperInfo != null) {
                bundled.add(0, defaultWallpaperInfo);
            }
+1 −1
Original line number Diff line number Diff line
@@ -510,7 +510,7 @@ public class BubbleTextView extends TextView
            mIcon.setBounds(0, 0, iconSize, iconSize);
        }
        if (mLayoutHorizontal) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            if (Utilities.ATLEAST_JB_MR1) {
                setCompoundDrawablesRelative(mIcon, null, null, null);
            } else {
                setCompoundDrawables(mIcon, null, null, null);
+4 −5
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.PointF;
@@ -93,7 +92,7 @@ public abstract class ButtonDropTarget extends TextView
        // drawableLeft and drawableStart.
        mDrawable = getResources().getDrawable(resId);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        if (Utilities.ATLEAST_JB_MR1) {
            setCompoundDrawablesRelativeWithIntrinsicBounds(mDrawable, null, null, null);
        } else {
            setCompoundDrawablesWithIntrinsicBounds(mDrawable, null, null, null);
@@ -114,7 +113,7 @@ public abstract class ButtonDropTarget extends TextView
    @Override
    public final void onDragEnter(DragObject d) {
        d.dragView.setColor(mHoverColor);
        if (Utilities.isLmpOrAbove()) {
        if (Utilities.ATLEAST_LOLLIPOP) {
            animateTextColor(mHoverColor);
        } else {
            if (mCurrentFilter == null) {
@@ -132,7 +131,7 @@ public abstract class ButtonDropTarget extends TextView
    }

    protected void resetHoverColor() {
        if (Utilities.isLmpOrAbove()) {
        if (Utilities.ATLEAST_LOLLIPOP) {
            animateTextColor(mOriginalTextColor.getDefaultColor());
        } else {
            mDrawable.setColorFilter(null);
+3 −3
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public class DragView extends View {
        measure(ms, ms);
        mPaint = new Paint(Paint.FILTER_BITMAP_FLAG);

        if (Utilities.isLmpOrAbove()) {
        if (Utilities.ATLEAST_LOLLIPOP) {
            setElevation(getResources().getDimension(R.dimen.drag_elevation));
        }
    }
@@ -252,14 +252,14 @@ public class DragView extends View {
            setColorScale(color, m2);
            m1.postConcat(m2);

            if (Utilities.isLmpOrAbove()) {
            if (Utilities.ATLEAST_LOLLIPOP) {
                animateFilterTo(m1.getArray());
            } else {
                mPaint.setColorFilter(new ColorMatrixColorFilter(m1));
                invalidate();
            }
        } else {
            if (!Utilities.isLmpOrAbove() || mCurrentFilter == null) {
            if (!Utilities.ATLEAST_LOLLIPOP || mCurrentFilter == null) {
                mPaint.setColorFilter(null);
                invalidate();
            } else {
Loading