Fix wallpaper transparency, Recents setup guide, drawer animation, and widget resizing (#2)
This commit was merged in pull request #2.
This commit is contained in:
1 parent
2fa7bd745b
commit
3070db4fb4
15 files changed
+1011
-161
No files matched your search
+17
-14
@@ -155,7 +155,7 @@ extern "js" fn fetch_text(url : String, f : (Bool, String) -> Unit) -> Unit =
|
||||
///|
|
||||
/// Measure the viewport and the home grid (into `window.__m`); false without a grid.
|
||||
extern "js" fn measure() -> Bool =
|
||||
#|() => { const s = document.querySelector(".slots"), h = document.querySelector(".home"); if (!s || !h) return false; const r = s.getBoundingClientRect(); window.__m = [innerWidth, innerHeight, r.left, r.top, r.width, parseFloat(getComputedStyle(h).paddingBottom) || 0]; return true; }
|
||||
#|() => { const s = document.querySelector(".slots"), h = document.querySelector(".home"); if (!s || !h) return false; const r = s.getBoundingClientRect(); window.__m = [innerWidth, innerHeight, r.left, r.top, r.width, parseFloat(getComputedStyle(h).paddingBottom) || 0, window.scrollY || 0]; return true; }
|
||||
|
||||
///|
|
||||
/// Measurement i: viewport width, height, grid left, top, width, the home's bottom padding.
|
||||
@@ -172,23 +172,18 @@ extern "js" fn resize_handles() -> String =
|
||||
#|() => JSON.stringify([...document.querySelectorAll(".resize-handle")].map((h) => { const r = h.getBoundingClientRect(); return [Math.round(r.left), Math.round(r.top), Math.round(r.width), Math.round(r.height)]; }))
|
||||
|
||||
///|
|
||||
/// The drawer covers the page down to this y (px); -1 once it covers the screen, 0 when
|
||||
/// there is no drawer. `last` is the previous bottom edge, so the answer can run ahead of it.
|
||||
extern "js" fn drawer_cover(last : Double) -> Double =
|
||||
#|(last) => { const d = document.querySelector(".drawer"); if (!d) return 0; const b = d.getBoundingClientRect().bottom; if (b >= innerHeight - 1) return -1; return Math.min(innerHeight - 1, Math.max(0, Math.ceil(b + 2 * Math.max(0, b - last)))); }
|
||||
/// Whether the drawer is open and not animating out.
|
||||
extern "js" fn drawer_covering() -> Bool =
|
||||
#|() => !!document.querySelector(".drawer:not(.closing)")
|
||||
|
||||
///|
|
||||
extern "js" fn drawer_bottom() -> Double =
|
||||
#|() => { const d = document.querySelector(".drawer"); return d ? d.getBoundingClientRect().bottom : 0 }
|
||||
|
||||
///|
|
||||
/// A drawer or sheet over the home screen's widgets (the shell has them step aside).
|
||||
/// A drawer over the home screen's widgets without a sheet on top (the shell keeps widget views placed while `cover` hides them).
|
||||
extern "js" fn has_drawer() -> Bool =
|
||||
#|() => !!document.querySelector(".drawer") && !document.querySelector(".sheet-overlay")
|
||||
#|() => !!document.querySelector(".drawer:not(.closing)") && !document.querySelector(".sheet-overlay")
|
||||
|
||||
///|
|
||||
extern "js" fn focus_search() -> Unit =
|
||||
#|() => { const i = document.querySelector(".drawer:not(.picking) .drawer-head input"); if (i) i.focus({ preventScroll: true }) }
|
||||
#|() => { const i = document.querySelector(".drawer:not(.picking):not(.closing) .drawer-head input"); if (i) i.focus({ preventScroll: true }) }
|
||||
|
||||
///|
|
||||
extern "js" fn blur_active() -> Unit =
|
||||
@@ -308,8 +303,16 @@ extern "js" fn h_pick_wallpaper() -> Unit =
|
||||
#|() => window.Android.pickWallpaper()
|
||||
|
||||
///|
|
||||
extern "js" fn h_open_recents() -> Unit =
|
||||
#|() => window.Android.openRecents()
|
||||
extern "js" fn h_open_recents() -> Bool =
|
||||
#|() => window.Android.openRecents() !== false
|
||||
|
||||
///|
|
||||
extern "js" fn h_open_accessibility_settings() -> Unit =
|
||||
#|() => window.Android.openAccessibilitySettings && window.Android.openAccessibilitySettings()
|
||||
|
||||
///|
|
||||
extern "js" fn h_open_self_app_info() -> Unit =
|
||||
#|() => window.Android.openSelfAppInfo && window.Android.openSelfAppInfo()
|
||||
|
||||
///|
|
||||
extern "js" fn h_http_get(url : String, tag : Int32) -> Unit =
|
||||
|
||||
Reference in new issue
Block a user