Loading app/src/main/java/foundation/e/blisslauncher/core/Utilities.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -177,4 +177,12 @@ public class Utilities { return defaultValue; return defaultValue; } } /** * Ensures that a value is within given bounds. Specifically: * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound, * return upperBound; else return value unchanged. */ public static int boundToRange(int value, int lowerBound, int upperBound) { return Math.max(lowerBound, Math.min(value, upperBound)); } } } app/src/main/java/foundation/e/blisslauncher/core/customviews/PagedView.java 0 → 100644 +1595 −0 File added.Preview size limit exceeded, changes collapsed. Show changes app/src/main/java/foundation/e/blisslauncher/core/customviews/Workspace.java 0 → 100644 +4 −0 Original line number Original line Diff line number Diff line package foundation.e.blisslauncher.core.customviews; public class Workspace { } app/src/main/java/foundation/e/blisslauncher/core/touch/OverScroll.java 0 → 100644 +40 −0 Original line number Original line Diff line number Diff line package foundation.e.blisslauncher.core.touch; /** * Utility methods for overscroll damping and related effect. */ public class OverScroll { private static final float OVERSCROLL_DAMP_FACTOR = 0.07f; /** * This curve determines how the effect of scrolling over the limits of the page diminishes * as the user pulls further and further from the bounds * * @param f The percentage of how much the user has overscrolled. * @return A transformed percentage based on the influence curve. */ private static float overScrollInfluenceCurve(float f) { f -= 1.0f; return f * f * f + 1.0f; } /** * @param amount The original amount overscrolled. * @param max The maximum amount that the View can overscroll. * @return The dampened overscroll amount. */ public static int dampedScroll(float amount, int max) { if (Float.compare(amount, 0) == 0) return 0; float f = amount / max; f = f / (Math.abs(f)) * (overScrollInfluenceCurve(Math.abs(f))); // Clamp this factor, f, to -1 < f < 1 if (Math.abs(f) >= 1) { f /= Math.abs(f); } return Math.round(OVERSCROLL_DAMP_FACTOR * f * max); } } app/src/main/res/values/strings.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -167,4 +167,6 @@ <string name="tap_to_setup_usageaccess">Tap to setup App Suggestions</string> <string name="tap_to_setup_usageaccess">Tap to setup App Suggestions</string> <string name="activity_not_found">App isn\'t installed</string> <string name="activity_not_found">App isn\'t installed</string> <string name="default_scroll_format">Page %1$d of %2$d</string> </resources> </resources> Loading
app/src/main/java/foundation/e/blisslauncher/core/Utilities.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -177,4 +177,12 @@ public class Utilities { return defaultValue; return defaultValue; } } /** * Ensures that a value is within given bounds. Specifically: * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound, * return upperBound; else return value unchanged. */ public static int boundToRange(int value, int lowerBound, int upperBound) { return Math.max(lowerBound, Math.min(value, upperBound)); } } }
app/src/main/java/foundation/e/blisslauncher/core/customviews/PagedView.java 0 → 100644 +1595 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
app/src/main/java/foundation/e/blisslauncher/core/customviews/Workspace.java 0 → 100644 +4 −0 Original line number Original line Diff line number Diff line package foundation.e.blisslauncher.core.customviews; public class Workspace { }
app/src/main/java/foundation/e/blisslauncher/core/touch/OverScroll.java 0 → 100644 +40 −0 Original line number Original line Diff line number Diff line package foundation.e.blisslauncher.core.touch; /** * Utility methods for overscroll damping and related effect. */ public class OverScroll { private static final float OVERSCROLL_DAMP_FACTOR = 0.07f; /** * This curve determines how the effect of scrolling over the limits of the page diminishes * as the user pulls further and further from the bounds * * @param f The percentage of how much the user has overscrolled. * @return A transformed percentage based on the influence curve. */ private static float overScrollInfluenceCurve(float f) { f -= 1.0f; return f * f * f + 1.0f; } /** * @param amount The original amount overscrolled. * @param max The maximum amount that the View can overscroll. * @return The dampened overscroll amount. */ public static int dampedScroll(float amount, int max) { if (Float.compare(amount, 0) == 0) return 0; float f = amount / max; f = f / (Math.abs(f)) * (overScrollInfluenceCurve(Math.abs(f))); // Clamp this factor, f, to -1 < f < 1 if (Math.abs(f) >= 1) { f /= Math.abs(f); } return Math.round(OVERSCROLL_DAMP_FACTOR * f * max); } }
app/src/main/res/values/strings.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -167,4 +167,6 @@ <string name="tap_to_setup_usageaccess">Tap to setup App Suggestions</string> <string name="tap_to_setup_usageaccess">Tap to setup App Suggestions</string> <string name="activity_not_found">App isn\'t installed</string> <string name="activity_not_found">App isn\'t installed</string> <string name="default_scroll_format">Page %1$d of %2$d</string> </resources> </resources>