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

Commit 72710f11 authored by Alan Viverette's avatar Alan Viverette
Browse files

Use ObjectAnimator for fading scrollbars, set initial duration to 1500

Fairly intensive refactoring of ScrollabilityCache.

Change-Id: I88669c0b9b79ca12a237606d5ff8be0e7e8b37ba
parent c20f54af
Loading
Loading
Loading
Loading
+220 −294

File changed.

Preview size limit exceeded, changes collapsed.

+17 −1
Original line number Diff line number Diff line
@@ -46,6 +46,12 @@ public class ViewConfiguration {
     */
    private static final int SCROLL_BAR_DEFAULT_DELAY = 300;

    /**
     * Default delay before the scrollbars fade in milliseconds for the first
     * time they are shown to the user.
     */
    private static final int SCROLL_BAR_DEFAULT_INITIAL_DELAY = 1500;

    /**
     * Defines the length of the fading edges in dips
     */
@@ -395,12 +401,22 @@ public class ViewConfiguration {
    }

    /**
     * @return Default delay before the scrollbars fade in milliseconds
     * @return Default delay in milliseconds before the scrollbars fade out
     *         after they have been awoken.
     */
    public static int getScrollDefaultDelay() {
        return SCROLL_BAR_DEFAULT_DELAY;
    }

    /**
     * @return Default delay in milliseconds before the scrollbars fade out
     *         after they are initially shown to the user.
     * @hide Pending cleanup of ViewConfiguration values.
     */
    public static int getScrollDefaultInitialDelay() {
        return SCROLL_BAR_DEFAULT_INITIAL_DELAY;
    }

    /**
     * @return the length of the fading edges in dips
     *
+16 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.graphics.Xfermode;
import android.os.Trace;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.IntProperty;
import android.util.StateSet;
import android.util.TypedValue;
import android.util.Xml;
@@ -1351,5 +1352,20 @@ public abstract class Drawable {
            default: return defaultMode;
        }
    }

    /** @hide */
    public static final IntProperty<Drawable> ALPHA = new IntProperty<Drawable>("alpha") {
        @Override
        public void setValue(Drawable object, int value) {
            object.mutate();
            object.setAlpha(value);
            object.invalidateSelf();
        }

        @Override
        public Integer get(Drawable object) {
            return object.getAlpha();
        }
    };
}