add navbar custom left & right view api
This commit is contained in:
3
doric-js/lib/src/native/navbar.d.ts
vendored
3
doric-js/lib/src/native/navbar.d.ts
vendored
@@ -1,8 +1,11 @@
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
import { Color } from "../util/color";
|
||||
import { View } from "../ui/view";
|
||||
export declare function navbar(context: BridgeContext): {
|
||||
isHidden: () => Promise<boolean>;
|
||||
setHidden: (hidden: boolean) => Promise<any>;
|
||||
setTitle: (title: string) => Promise<any>;
|
||||
setBgColor: (color: Color) => Promise<any>;
|
||||
setLeft: (view: View) => Promise<any>;
|
||||
setRight: (view: View) => Promise<any>;
|
||||
};
|
||||
|
@@ -24,5 +24,19 @@ export function navbar(context) {
|
||||
color: color.toModel(),
|
||||
});
|
||||
},
|
||||
setLeft: (view) => {
|
||||
if (panel) {
|
||||
panel.clearHeadViews("navbar_left");
|
||||
panel.addHeadView("navbar_left", view);
|
||||
}
|
||||
return context.navbar.setLeft(view.toModel());
|
||||
},
|
||||
setRight: (view) => {
|
||||
if (panel) {
|
||||
panel.clearHeadViews("navbar_right");
|
||||
panel.addHeadView("navbar_right", view);
|
||||
}
|
||||
return context.navbar.setRight(view.toModel());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user