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 insert inner layout tag object.
Let us see, how to do this?
First, you have to import Layout and inner layout class:
Let us see, how to do this?
import com.infairy.cocina.SDK.Layout.Layout; import com.infairy.cocina.SDK.Layout.LayoutInnerLayout;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);Next, create inner layout by LayoutID:
//Create Inner layout LayoutInnerLayout lil=new LayoutInnerLayout(); lil.bundleID=BundleID; //Bundle ID lil.LayoutID=LayoutID; //Note, LayoutID which indicate thies innerlayout hosted in. lil.left=0; lil.top=20; lil.width=800; lil.height=400; //create inner layout and get inner layout id innerLayoutID=layout.createUI(this, lil);now, you have a layout tag which contain inner layout in the bundle.
The Layout tag properties show as below:
/** * Bundle ID */ public String bundleID=""; /** * Inner Layout ID */ public String LayoutID=""; /** * Inner Layout axis of top, default is 0 */ public int top=0; /** * Inner Layout axis of left default is 0 */ public int left=0; /** * Inner Layout Width, default is 100 */ public int width=100; /** * Inner Layout Height, default is 50 */ public int height=50; /** * Define the bundle id of key from */ public String originalBundleID=""; /** * BackgroundImage */ public String backgroundImage=""; /** * Auto scroll */ public boolean AutoScroll=false;