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

Commit 42941218 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "keyguard: enable magnetic target if no custom targets defined" into cm-10.1

parents 80d67ca0 f78df28f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -742,6 +742,14 @@ public class GlowPadView extends View {
        }
    }

    public boolean getMagneticTargets() {
        return mMagneticTargets;
    }

    public void setMagneticTargets(boolean enabled) {
        mMagneticTargets = enabled;
    }

    /**
     * Starts wave animation.
     *
+5 −0
Original line number Diff line number Diff line
@@ -316,6 +316,9 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
                    .ic_lockscreen_camera, !mCameraDisabled);
            mGlowPadView.setEnableTarget(com.android.internal.R.drawable
                    .ic_action_assist_generic, !mSearchDisabled);

            // Enable magnetic targets
            mGlowPadView.setMagneticTargets(true);
        } else {
            mStoredTargets = storedVal.split("\\|");
            mIsScreenLarge = isScreenLarge();
@@ -326,6 +329,8 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
            final boolean isLandscape = mCreationOrientation == Configuration.ORIENTATION_LANDSCAPE;
            final Drawable blankActiveDrawable = res.getDrawable(R.drawable.ic_lockscreen_target_activated);
            final InsetDrawable activeBack = new InsetDrawable(blankActiveDrawable, 0, 0, 0, 0);
            // Disable magnetic target
            mGlowPadView.setMagneticTargets(false);
            //Magnetic target replacement
            final Drawable blankInActiveDrawable = res.getDrawable(com.android.internal.R.drawable.ic_lockscreen_lock_pressed);
            final Drawable unlockActiveDrawable = res.getDrawable(com.android.internal.R.drawable.ic_lockscreen_unlock_activated);