feat:add Navbar plugin for Android
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
import { Gravity } from "./gravity";
|
||||
import { Panel } from "../ui/panel";
|
||||
import { Color } from "./color";
|
||||
|
||||
export function modal(context: BridgeContext) {
|
||||
return {
|
||||
@@ -182,16 +184,30 @@ export function navigator(context: BridgeContext) {
|
||||
}
|
||||
|
||||
export function navbar(context: BridgeContext) {
|
||||
const entity = context.entity
|
||||
let panel: Panel | undefined = undefined
|
||||
if (entity instanceof Panel) {
|
||||
panel = entity
|
||||
}
|
||||
|
||||
return {
|
||||
isHidden: () => {
|
||||
return context.navbar.isHidden() as Promise<boolean>
|
||||
},
|
||||
setHidden: (hidden: boolean) => {
|
||||
return context.navbar.push({
|
||||
return context.navbar.setHidden({
|
||||
hidden,
|
||||
})
|
||||
},
|
||||
setTitle: (title: string) => {
|
||||
return context.navbar.push({
|
||||
return context.navbar.setTitle({
|
||||
title,
|
||||
})
|
||||
},
|
||||
setBgColor: (color: Color) => {
|
||||
return context.navbar.setBgColor({
|
||||
color: color.toModel(),
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user