"ui";
importClass(android.content.pm.ActivityInfo);
importClass(android.view.WindowManager);
activity.window.addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); //设置状态栏透明
activity.window.addFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN); //设置全屏
var color = "#000000";
ui.layout(
<drawer id="drawer">
<vertical>
<appbar>
<horizontal bg="{{color}}" alpha="1">
<horizontal bg="{{color}}" gravity="left" w="*" h="*" layout_weight="1">
<toolbar id="toolbar" title="" bg="{{color}}" layout_weight="1"/>
<text id="patht" text="界面" textSize="16sp" bg="?selectableItemBackground" textColor="#ffffff" gravity="center" layout_gravity="left" bg="{{color}}" w="*" h="*" layout_weight="2" ellipsize="start" maxLines="1" textStyle="bold"/>
</horizontal>
<frame gravity="right" layout_gravity="right" w="*" h="*" layout_weight="8">
<img id="refresh" tint="#ffffff" w="33" h="33" layout_gravity="center" bg="{{color}}" layout_weight="1" padding="7" w="*" h="*" />
</frame>
</horizontal>
</appbar>
<viewpager id="viewpager">
</viewpager>
</vertical>
<vertical layout_gravity="left" gravity="top" bg="#ffffff" w="280">
<ScrollView>
<vertical gravity="left" w="*" h="*" layout_weight="1">
<text id="menut" h="55" textSize="22sp" text="侧边栏" bg="?selectableItemBackground" textColor="#ffffff" gravity="left" layout_gravity="left" w="*" bg="#000000" ellipsize="start" maxLines="1" padding="7" textStyle="bold"/>
<img id="menupic" w="280" h="200" scaleType="fitXY"/>
<list id="menu">
<horizontal bg="?selectableItemBackground" w="*">
<img w="50" h="50" padding="16" src="{{this.icon}}" tint="{{color}}"/>
<text id="menut" textColor="black" textSize="15sp" text="{{this.title}}" layout_gravity="center"/>
</horizontal>
</list>
</vertical>
</ScrollView>
</vertical>
</drawer>
);
ui.toolbar.setupWithDrawer(ui.drawer);
一个界面模板