Infairy platform define different layout object to let users interactive with bundle by graphic usere interface, each bundle can be put into many layout tag, each layout tag can design many layout object.
Let us see, how to do this?
First, you have to import Layout class:
Let us see, how to do this?
import com.infairy.cocina.SDK.Layout.Layout;Then, get Layout service
Layout layout=(Layout)Tools.getService(context, Layout.class.getName(), "(FUNCTION=LAYOUT)");Next, create layout tag and get LayoutID for other layout object used purpose:
LayoutTag ltag=new LayoutTag(); ltag.backgroundImage="img/background.png"; ltag.bundleID=BundleID; ltag.LayoutHeight=450; ltag.LayoutWidth=800; ltag.title="My App"; /* * Create layout tag and get layout id for other layout object use */ LayoutID=layout.createUI(this, ltag);or , you can create multi-layout in the bundle:
LayoutTag ltag=new LayoutTag(); ltag.backgroundImage="img/background0.png"; ltag.bundleID=BundleID; ltag.LayoutHeight=450; ltag.LayoutWidth=800; ltag.title="Page 0"; /* * Create first layout tag and get layout id for other layout object use */ LayoutID0=layout.createUI(this, ltag); ltag.backgroundImage="img/background1.png"; ltag.bundleID=BundleID; ltag.LayoutHeight=450; ltag.LayoutWidth=800; ltag.title="Page 2"; /* * Create second layout tag and get layout id for other layout object use */ LayoutID1=layout.createUI(this, ltag);now, you have two layout in the bundle.
The Layout tag properties show as below:
/** * Bundle id */ public String bundleID=""; /** * layout title */ public String title=""; //type /** * layout width in pixel, default is 10 */ public int LayoutWidth=10; /** * layout width in pixel, default is 10 */ public int LayoutHeight=10; /** * is default layout or not, default is false */ public boolean isDefault=false; /** * visibility, default is true */ public boolean visible=true; /** * background image * */ public String backgroundImage="";