wechat/ui
ui module provides UI category bindings details in wechat document
Types
Font description for loadFontFace
pub type DescFontFace {
DescFontFace(style: String, weight: String, variant: String)
}
Constructors
-
DescFontFace(style: String, weight: String, variant: String)
Values
pub fn animation_background_color(
anim: object.JsObject,
color c: String,
) -> object.JsObject
Animation.backgroundColor
Set background color
pub fn animation_bottom(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.bottom
Set bottom position
pub fn animation_export(anim: object.JsObject) -> object.JsObject
Animation.export
Export animation
pub fn animation_height(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.height
Set height
pub fn animation_left(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.left
Set left position
pub fn animation_matrix(
anim: object.JsObject,
a: Float,
b: Float,
c: Float,
d: Float,
tx: Float,
ty: Float,
) -> object.JsObject
Animation.matrix
Transform with matrix
pub fn animation_matrix3d(
anim: object.JsObject,
m11: Float,
m12: Float,
m13: Float,
m14: Float,
m21: Float,
m22: Float,
m23: Float,
m24: Float,
m31: Float,
m32: Float,
m33: Float,
m34: Float,
m41: Float,
m42: Float,
m43: Float,
m44: Float,
) -> object.JsObject
Animation.matrix3d
Transform with 3D matrix
pub fn animation_opacity(
anim: object.JsObject,
value v: Float,
) -> object.JsObject
Animation.opacity
Set opacity
pub fn animation_right(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.right
Set right position
pub fn animation_rotate(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.rotate
Rotate element
pub fn animation_rotate_x(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.rotateX
Rotate element on X axis
pub fn animation_rotate_y(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.rotateY
Rotate element on Y axis
pub fn animation_rotate_z(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.rotateZ
Rotate element on Z axis
pub fn animation_scale(
anim: object.JsObject,
sx: Float,
sy: Float,
) -> object.JsObject
Animation.scale
Scale element
pub fn animation_scale3d(
anim: object.JsObject,
sx: Float,
sy: Float,
sz: Float,
) -> object.JsObject
Animation.scale3d
Scale element in 3D
pub fn animation_scale_x(
anim: object.JsObject,
scale s: Float,
) -> object.JsObject
Animation.scaleX
Scale element on X axis
pub fn animation_scale_y(
anim: object.JsObject,
scale s: Float,
) -> object.JsObject
Animation.scaleY
Scale element on Y axis
pub fn animation_scale_z(
anim: object.JsObject,
scale s: Float,
) -> object.JsObject
Animation.scaleZ
Scale element on Z axis
pub fn animation_skew(
anim: object.JsObject,
ax: Float,
ay: Float,
) -> object.JsObject
Animation.skew
Skew element
pub fn animation_skew_x(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.skewX
Skew element on X axis
pub fn animation_skew_y(
anim: object.JsObject,
angle a: Float,
) -> object.JsObject
Animation.skewY
Skew element on Y axis
pub fn animation_step(
anim: object.JsObject,
options o: object.JsObject,
) -> object.JsObject
Animation.step
Mark the start of an animation step
pub fn animation_top(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.top
Set top position
pub fn animation_translate(
anim: object.JsObject,
x: String,
y: String,
) -> object.JsObject
Animation.translate
Translate element
pub fn animation_translate3d(
anim: object.JsObject,
x: String,
y: String,
z: String,
) -> object.JsObject
Animation.translate3d
Translate element in 3D
pub fn animation_translate_x(
anim: object.JsObject,
distance d: String,
) -> object.JsObject
Animation.translateX
Translate element on X axis
pub fn animation_translate_y(
anim: object.JsObject,
distance d: String,
) -> object.JsObject
Animation.translateY
Translate element on Y axis
pub fn animation_translate_z(
anim: object.JsObject,
distance d: String,
) -> object.JsObject
Animation.translateZ
Translate element on Z axis
pub fn animation_width(
anim: object.JsObject,
value v: String,
) -> object.JsObject
Animation.width
Set width
pub fn check_is_picture_in_picture_active() -> Bool
wx.checkIsPictureInPictureActive
Check if picture-in-picture is active
pub fn create_animation(
options o: object.JsObject,
) -> object.JsObject
wx.createAnimation
Create an animation instance
pub fn disable_alert_before_unload(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.disableAlertBeforeUnload
Disable alert before page unload
pub fn enable_alert_before_unload(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.enableAlertBeforeUnload
Enable alert before page unload
pub fn get_menu_button_bounding_rect() -> object.JsObject
wx.getMenuButtonBoundingClientRect
Get menu button bounding rectangle
pub fn hide_home_button(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.hideHomeButton
Hide home button
pub fn hide_navigation_bar_loading(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.hideNavigationBarLoading
Hide navigation bar loading animation on the current page
pub fn hide_tab_bar_red_dot(
index i: Int,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.hideTabBarRedDot
Hide tabBar red dot
pub fn hide_toast(
no_conflict nc: Bool,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.hideToast
Hide the message prompt box
pub fn load_built_in_font_face(
family f: String,
source s: String,
global g: Bool,
scopes sc: List(#(String, Bool)),
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.loadBuiltInFontFace
Load built-in font
pub fn load_font_face(
family f: String,
source s: String,
global g: Bool,
scopes sc: List(#(String, Bool)),
desc d: DescFontFace,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.loadFontFace
Load custom font
pub fn next_tick(callback cb: fn(object.JsObject) -> Nil) -> Nil
Custom Component APIs
wx.nextTick
Delay some execution until next time next tick
pub fn off_menu_button_bounding_rect_weight_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.offMenuButtonBoundingClientRectWeightChange
Remove menu button bounding rectangle weight change listener
pub fn off_on_parallel_state_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.offOnParallelStateChange
Remove parallel state change listener
pub fn off_on_user_trigger_translation(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.offOnUserTriggerTranslation
Remove user trigger translation listener
pub fn off_window_resize(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.offWindowResize
Remove window resize listener
pub fn off_window_state_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.offWindowStateChange
Remove window state change listener
pub fn on_menu_button_bounding_rect_weight_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
Menu APIs
wx.onMenuButtonBoundingClientRectWeightChange
Listen for menu button bounding rectangle weight changes
pub fn on_on_parallel_state_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.onOnParallelStateChange
Listen for parallel state change events
pub fn on_on_user_trigger_translation(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.onOnUserTriggerTranslation
Listen for user trigger translation events
pub fn on_window_resize(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.onWindowResize
Listen for window resize events
pub fn on_window_state_change(
callback cb: fn(object.JsObject) -> Nil,
) -> Nil
wx.onWindowStateChange
Listen for window state change events
pub fn page_scroll_to(
scroll_top st: Int,
selector s: String,
duration d: Int,
) -> Nil
Phase 15: UI Advanced
Scroll APIs
wx.pageScrollTo
Scroll page to specified position
pub fn remove_tab_bar_badge(
index i: Int,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.removeTabBarBadge
Remove tabBar badge text
pub fn set_background_color(
background_color bc: String,
background_color_top bct: String,
background_color_bottom bcb: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setBackgroundColor
Set window background color
pub fn set_background_text_style(
text_style ts: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setBackgroundTextStyle
Set pull-down background font and loading icon style
pub fn set_navigation_bar_color(
front_color fc: String,
background_color bc: String,
animation ani: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setNavigationBarColor
Set page navigation bar color
pub fn set_tab_bar_badge(
index i: Int,
text t: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setTabBarBadge
Set tabBar badge text
pub fn set_tab_bar_item(
index i: Int,
text t: String,
icon_path ip: String,
selected_icon_path sip: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setTabBarItem
Set tabBar item content
pub fn set_tab_bar_style(
color c: String,
selected_color sc: String,
background_color bc: String,
border_style bs: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.setTabBarStyle
Set tabBar style
pub fn set_top_bar_text(
text t: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
Sticky Bar APIs
wx.setTopBarText
Set top bar text
pub fn set_window_size(
width w: Int,
height h: Int,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
Window APIs
wx.setWindowSize
Set window size
pub fn show_action_sheet(
item_list il: List(String),
item_color icolor: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.showActionSheet
Display an action sheet
pub fn show_modal(
title t: String,
content c: String,
show_cancel sc: Bool,
cancel_text clt: String,
cancel_color cc: String,
confirm_text ct: String,
confirm_color cf: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.showModal
Display a modal dialog
pub fn show_navigation_bar_loading(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.showNavigationBarLoading
Show navigation bar loading animation on the current page
pub fn show_tab_bar_red_dot(
index i: Int,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.showTabBarRedDot
Show red dot on tabBar item
pub fn start_pull_down_refresh(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.startPullDownRefresh
Start pull-down refresh
pub fn stop_pull_down_refresh(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.stopPullDownRefresh
Stop pull-down refresh