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

Commit c0b89b72 authored by Kenny Guy's avatar Kenny Guy Committed by Android (Google) Code Review
Browse files

Merge "Update calls now we have an L API version." into ub-now-porkchop

parents 850d471b d794a3f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.launcher3">
    <uses-sdk android:targetSdkVersion="19" android:minSdkVersion="16"/>
    <uses-sdk android:targetSdkVersion="21" android:minSdkVersion="16"/>

    <permission
        android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList

        Animator openFolderAnim = null;
        final Runnable onCompleteRunnable;
        if (!Utilities.isLmp()) {
        if (!Utilities.isLmpOrAbove()) {
            positionAndSizeAsIcon();
            centerAboutIcon();

+7 −7
Original line number Diff line number Diff line
@@ -1650,7 +1650,7 @@ public class Launcher extends Activity
        // TODO(sansid): use the APIs directly when compiling against L sdk.
        // Currently we use reflection to access the flags and the API to set the transparency
        // on the System bars.
        if (Utilities.isLmp()) {
        if (Utilities.isLmpOrAbove()) {
            try {
                getWindow().getAttributes().systemUiVisibility |=
                        (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
@@ -2809,7 +2809,7 @@ public class Launcher extends Activity

            Bundle optsBundle = null;
            if (useLaunchAnimation) {
                ActivityOptions opts = Utilities.isLmp() ?
                ActivityOptions opts = Utilities.isLmpOrAbove() ?
                        ActivityOptions.makeCustomAnimation(this, R.anim.task_open_enter, R.anim.no_anim) :
                        ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
                optsBundle = opts.toBundle();
@@ -2920,7 +2920,7 @@ public class Launcher extends Activity

        ObjectAnimator oa = LauncherAnimUtils.ofPropertyValuesHolder(mFolderIconImageView, alpha,
                scaleX, scaleY);
        if (Utilities.isLmp()) {
        if (Utilities.isLmpOrAbove()) {
            oa.setInterpolator(new LogDecelerateInterpolator(100, 0));
        }
        oa.setDuration(getResources().getInteger(R.integer.config_folderExpandDuration));
@@ -3194,7 +3194,7 @@ public class Launcher extends Activity
            mStateAnimation = null;
        }

        boolean material = Utilities.isLmp();
        boolean material = Utilities.isLmpOrAbove();

        final Resources res = getResources();

@@ -3376,7 +3376,7 @@ public class Launcher extends Activity
                    dispatchOnLauncherTransitionStart(toView, animated, false);

                    revealView.setAlpha(initAlpha);
                    if (Utilities.isLmp()) {
                    if (Utilities.isLmpOrAbove()) {
                        for (int i = 0; i < layerViews.size(); i++) {
                            View v = layerViews.get(i);
                            if (v != null) {
@@ -3431,7 +3431,7 @@ public class Launcher extends Activity
            mStateAnimation = null;
        }

        boolean material = Utilities.isLmp();
        boolean material = Utilities.isLmpOrAbove();
        Resources res = getResources();

        final int duration = res.getInteger(R.integer.config_appsCustomizeZoomOutTime);
@@ -3651,7 +3651,7 @@ public class Launcher extends Activity
                    dispatchOnLauncherTransitionStart(fromView, animated, false);
                    dispatchOnLauncherTransitionStart(toView, animated, false);

                    if (Utilities.isLmp()) {
                    if (Utilities.isLmpOrAbove()) {
                        for (int i = 0; i < layerViews.size(); i++) {
                            View v = layerViews.get(i);
                            if (v != null) {
+3 −4
Original line number Diff line number Diff line
@@ -103,11 +103,10 @@ public final class Utilities {
    }

    /**
     * Indicates if the device is running LMP or not.
     * TODO(sansid): Change the check to a VERSION_CODES code check once we have a version for L.
     * Indicates if the device is running LMP or higher.
     */
    public static boolean isLmp() {
        return "L".equals(Build.VERSION.CODENAME);
    public static boolean isLmpOrAbove() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.L;
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -38,9 +38,8 @@ public abstract class AppWidgetManagerCompat {

    public static AppWidgetManagerCompat getInstance(Context context) {
        synchronized (sInstanceLock) {
            // TODO change this to use api version once L gets an API number.
            if (sInstance == null) {
                if (Utilities.isLmp()) {
                if (Utilities.isLmpOrAbove()) {
                    sInstance = new AppWidgetManagerCompatVL(context.getApplicationContext());
                } else {
                    sInstance = new AppWidgetManagerCompatV16(context.getApplicationContext());
Loading