Builder class for constructing MiniAppInitConfig objects.
Builder class for MiniAppInitConfig. Constructs miniapp initialization configuration objects.
public static class Builder
setAccessKey
public MiniAppInitConfig.Builder setAccessKey(String accessKey)
Sets an AccessKey.
|
Parameters |
|
|
accessKey |
String: the AccessKey, which can be obtained from Application Open Platform. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setSecretKey
public MiniAppInitConfig.Builder setSecretKey(String secret)
Sets a SecretKey.
|
Parameters |
|
|
secretKey |
String: the SecretKey, which can be obtained from Application Open Platform. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setUseUniApp
public MiniAppInitConfig.Builder setUseUniApp(boolean use)
Enables the uni-app miniapp container. Disabled by default.
|
Parameters |
|
|
use |
Boolean: true to enable, false to disable. Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setUseWindVane
public MiniAppInitConfig.Builder setUseWindVane(boolean use)
Enables the WindVane miniapp container. Disabled by default.
|
Parameters |
|
|
use |
Boolean: true to enable, false to disable. Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setAppCode
public MiniAppInitConfig.Builder setChannel(String appCode)
Sets an App Code.
|
Parameters |
|
|
appCode |
String: the app ID, which can be obtained from Application Open Platform. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setHost
public MiniAppInitConfig.Builder setHost(String host)
Sets a backend service host for a miniapp.
|
Parameters |
|
|
host |
String: the backend service host. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setUseHttp
public MiniAppInitConfig.Builder setUseHttp(boolean http)
Switches the protocol to HTTP. HTTPS is used by default.
|
Parameters |
|
|
http |
Boolean: true for HTTP, false for HTTPS. Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
openLog
public MiniAppInitConfig.Builder openLog(boolean open)
Enables logging. Disabled by default.
|
Parameters |
|
|
open |
Boolean: true to enable, false to disable. Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setCustomOAID
public MiniAppInitConfig.Builder setCustomOAID(String oaid)
Sets the OAID to connect the Alibaba Cloud account system with the app account system.
|
Parameters |
|
|
oaid |
String: the OAID used by the account system of the app. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setCapsule
public MiniAppInitConfig.Builder setCapsule(boolean isCapsule)
Enables capsule buttons. Enabled by default. This method is applicable only to uni-app miniapps.
Capsule buttons require navigationBar or titleNView configuration in the uni-app miniapp.
|
Parameters |
|
|
isCapsule |
Boolean: true to show, false to hide. Default: true. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setMenuDefFontColor
public MiniAppInitConfig.Builder setMenuDefFontColor(String menuDefFontColor)
Sets the default color of text on menu buttons. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
String: the font color. Valid values: strings in the #RRGGBB or rgba(R,G,B,A) format. Default value: #000000. |
|
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setMenuDefFontSize
public MiniAppInitConfig.Builder setMenuDefFontSize(String menuDefFontSize)
Sets the default font size of text on menu buttons. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
menuDefFontSize |
String: the font size of text on menu buttons. Valid values: strings in the "digits+px" format. Default value: 22px. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setMenuDefFontWeight
public MiniAppInitConfig.Builder setMenuDefFontWeight(String menuDefFontWeight)
Sets the default font weight of text on menu buttons. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
String: the font weight of text on menu buttons. Valid values: normal and bold. Default value: normal. |
|
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setMenuActionSheetItems
public MiniAppInitConfig.Builder setMenuActionSheetItems(List<MiniAppMenuActionSheetItem> list)
Sets the default menu buttons. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
List<MiniAppMenuActionSheetItem>: a list of default menu buttons. The setting takes effect only if setCapsule is set to true. |
|
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setEnableBackground
public MiniAppInitConfig.Builder setEnableBackground(boolean isEnableBackground)
Allows the miniapp to run in the background after exit. This method is applicable only to uni-app miniapps.
Enabling background mode also shows the multitasking window. Disable this feature if the miniapp does not need a separate task window. The background mode and multitasking window features are coupled.
|
Parameters |
|
|
isEnableBackground |
Boolean: Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setUniMPFromRecents
public MiniAppInitConfig.Builder setUniMPFromRecents(boolean isFromRecents)
Controls the miniapp task window. Visible only when the miniapp runs in the background. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
isFromRecents |
Boolean: true to show, false to hide. The task window is displayed only when the miniapp runs in the background. Default: true. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setCapsuleButtonStyle
public MiniAppInitConfig.Builder setCapsuleButtonStyle(MiniAppCapsuleButtonStyle style)
Sets the capsule button style. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
style |
MiniAppCapsuleButtonStyle: the capsule button style. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNJS
public MiniAppInitConfig.Builder setNJS(boolean enable)
Enables the NJS feature. Disabled by default. This method is applicable only to uni-app miniapps.
|
Parameters |
|
|
enable |
Boolean: Default: false. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNavigationBarTransparent
public void setNavigationBarTransparent(boolean navigationBarTransparent)
Sets the navigation bar background transparency. WindVane miniapps only.
|
Parameters |
|
|
navigationBarTransparent |
boolean: true for transparent, false for opaque. Default: false. Transparent mode enables full-screen layout and hides the status bar under gesture navigation. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNavigationBarColorInt
public MiniAppInitConfig.Builder setNavigationBarColorInt(int colorInt)
Sets the navigation bar background color. WindVane miniapps only.
|
Parameters |
|
|
colorInt |
int: the navigation bar background color. Default: black. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNavigationBarDarkIcon
public MiniAppInitConfig.Builder setNavigationBarDarkIcon(boolean darkIcon)
Sets the navigation bar icon color. WindVane miniapps only.
|
Parameters |
|
|
darkIcon |
boolean: true for dark icons, false for light icons. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNavigationBarWithKitkatEnable
public MiniAppInitConfig.Builder setNavigationBarWithKitkatEnable(boolean navigationBarWithKitkatEnable)
Enables navigation bar color customization on Android 4.4 (KitKat) devices. WindVane miniapps only.
|
Parameters |
|
|
navigationBarWithKitkatEnable |
boolean: Default is true. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNavigationBarWithEMUI3Enable
public MiniAppInitConfig.Builder setNavigationBarWithEMUI3Enable(boolean navigationBarWithEMUI3Enable)
Enables navigation bar color customization on EMUI 3.x devices. WindVane miniapps only.
|
Parameters |
|
|
navigationBarWithEMUI3Enable |
boolean: Default is true. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setAppAuthPopStyle
public MiniAppInitConfig.Builder setAppAuthPopStyle(MiniAppAuthPopStyle appAuthPopStyle)
Sets the authorization pop-up style for device information API calls. WindVane miniapps only.
|
Parameters |
|
|
MiniAppAuthPopStyle |
MiniAppAuthPopStyle: the authorization pop-up style. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setMiniAppFavoriteStyle
public MiniAppInitConfig.Builder setMiniAppFavoriteStyle(MiniAppFavoriteStyle miniAppFavoriteStyle)
Sets the pop-up style for the More menu in the navigation bar. WindVane miniapps only.
|
Parameters |
|
|
MiniAppFavoriteStyle |
MiniAppFavoriteStyle: the pop-up menu style. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setNeedAuthFromApp
public MiniAppInitConfig.Builder setNeedAuthFromApp(boolean needAuthFromApp)
Enables user authorization when the miniapp calls device information APIs. (See also Authorization). WindVane miniapps only.
|
Parameters |
|
|
needAuthFromApp |
boolean: true to enable, false to disable. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setSuperNameSpace
public MiniAppInitConfig.Builder setSuperAppNameSpace(String superNameSpace)
Sets the JsApi window object namespace. Default: "window.WindVane". WindVane miniapps only. How to use the Mini App JsApi white label
|
Parameters |
|
|
superAppNameSpace |
String: the JsApi namespace. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setJsApiClassNamePrefix
public MiniAppInitConfig.Builder setJsApiClassNamePrefix(String jsApiClassNamePrefix)
Sets the class name prefix for miniapp JsApi method calls. Default: window.WindVane. WindVane miniapps only.How to use the Mini App JsApi white label
|
Parameters |
|
|
jsApiClassNamePrefix |
String: the JsApi class name prefix. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
setWindVaneBackwardCompatible
public MiniAppInitConfig.Builder setWindVaneBackwardCompatible(boolean isWindVaneBackwardCompatible)
Enables backward-compatible window.WindVane.call for JsApi methods. Default: true. WindVane miniapps only.How to use the Mini App JsApi white label
|
Parameters |
|
|
isWindVaneBackwardCompatible |
boolean: false to disable, true to enable. Default: true. |
|
Returns |
|
|
MiniAppInitConfig.Builder |
The Builder instance. |
build
public MiniAppInitConfig build()
Builds the MiniAppInitConfig from the current builder state.
|
Returns |
|
|
MiniAppInitConfig |
The miniapp container initialization configuration. |