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

Commit f2dd4216 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Removing extraction service and palette api dependency

Change-Id: I30ad1a1462a97b6bc03f8e386ae3058c7fe022e5
parent 9315c9a8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v7-palette \
    android-support-dynamic-animation

LOCAL_SRC_FILES := \
@@ -72,7 +71,6 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v7-palette \
    android-support-dynamic-animation

LOCAL_SRC_FILES := \
+0 −6
Original line number Diff line number Diff line
@@ -81,12 +81,6 @@
            </intent-filter>
        </receiver>

        <service android:name="com.android.launcher3.dynamicui.ColorExtractionService"
            android:exported="false"
            android:process=":wallpaper_chooser"
            android:permission="android.permission.BIND_JOB_SERVICE">
        </service>

        <service
            android:name="com.android.launcher3.compat.WallpaperManagerCompatVL$ColorExtractionService"
            android:exported="false"
+4 −5
Original line number Diff line number Diff line
@@ -13,12 +13,12 @@ apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.0'
    compileSdkVersion 27
    buildToolsVersion '27.0.0'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 26
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

@@ -86,12 +86,11 @@ repositories {
    jcenter()
}

final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT'
final String SUPPORT_LIBS_VERSION = '27.0.0-SNAPSHOT'
dependencies {
    compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
    compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
    compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
    compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'

    testCompile 'junit:junit:4.12'
+0 −4
Original line number Diff line number Diff line
@@ -232,8 +232,4 @@
    <dimen name="horizontal_ellipsis_offset">19dp</dimen>
    <dimen name="popup_item_divider_height">0.5dp</dimen>
    <dimen name="swipe_helper_falsing_threshold">70dp</dimen>

<!-- Other -->
    <!-- Approximates the system status bar height. Not guaranteed to be always be correct. -->
    <dimen name="status_bar_height">24dp</dimen>
</resources>
+0 −66
Original line number Diff line number Diff line
@@ -16,16 +16,9 @@

package com.android.launcher3;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.ColorUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -35,11 +28,9 @@ import android.widget.FrameLayout;
import android.widget.TextView;

import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dynamicui.ExtractedColors;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.Themes;

public class Hotseat extends FrameLayout
        implements UserEventDispatcher.LogContainerProvider {
@@ -51,12 +42,6 @@ public class Hotseat extends FrameLayout
    @ViewDebug.ExportedProperty(category = "launcher")
    private final boolean mHasVerticalHotseat;

    @ViewDebug.ExportedProperty(category = "launcher")
    private int mBackgroundColor;
    @ViewDebug.ExportedProperty(category = "launcher")
    private ColorDrawable mBackground;
    private ValueAnimator mBackgroundColorAnimator;

    public Hotseat(Context context) {
        this(context, null);
    }
@@ -69,12 +54,6 @@ public class Hotseat extends FrameLayout
        super(context, attrs, defStyle);
        mLauncher = Launcher.getLauncher(context);
        mHasVerticalHotseat = mLauncher.getDeviceProfile().isVerticalBarLayout();
        mBackgroundColor = ColorUtils.setAlphaComponent(
                Themes.getAttrColor(context, android.R.attr.colorPrimary), 0);
        mBackground = new ColorDrawable(mBackgroundColor);
        if (!FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS) {
            setBackground(mBackground);
        }
    }

    public CellLayout getLayout() {
@@ -177,49 +156,4 @@ public class Hotseat extends FrameLayout
        target.gridY = info.cellY;
        targetParent.containerType = ContainerType.HOTSEAT;
    }

    public void updateColor(ExtractedColors extractedColors, boolean animate) {
        if (FeatureFlags.LAUNCHER3_GRADIENT_ALL_APPS) {
            // not hotseat visible
            return;
        }
        if (!mHasVerticalHotseat) {
            int color = extractedColors.getColor(ExtractedColors.HOTSEAT_INDEX);
            if (mBackgroundColorAnimator != null) {
                mBackgroundColorAnimator.cancel();
            }
            if (!animate) {
                setBackgroundColor(color);
            } else {
                mBackgroundColorAnimator = ValueAnimator.ofInt(mBackgroundColor, color);
                mBackgroundColorAnimator.setEvaluator(new ArgbEvaluator());
                mBackgroundColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public void onAnimationUpdate(ValueAnimator animation) {
                        mBackground.setColor((Integer) animation.getAnimatedValue());
                    }
                });
                mBackgroundColorAnimator.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        mBackgroundColorAnimator = null;
                    }
                });
                mBackgroundColorAnimator.start();
            }
            mBackgroundColor = color;
        }
    }

    public void setBackgroundTransparent(boolean enable) {
        if (enable) {
            mBackground.setAlpha(0);
        } else {
            mBackground.setAlpha(255);
        }
    }

    public int getBackgroundDrawableColor() {
        return mBackgroundColor;
    }
}
Loading