Back to project page android-mvc-framework.
The source code is released under:
Apache License
If you think the Android project android-mvc-framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android_mvc.framework.ui; /*www. ja v a 2s .co m*/ import com.android_mvc.sample_project.R; import com.android_mvc.framework.common.FWUtil; import com.android_mvc.framework.ui.view.MLinearLayout; import android.app.Activity; import android.view.View; /** * XML???????????????????????????????????????????????????????? * @author id:language_and_engineering * */ public class UIBuilder { protected Activity context = null; // NOTE: Activity??????????????????context??????????????????????????? // Activity???????????????????????????????????????????????????? // ??????????????FW???????AP???????????????????????????????? // FW??????????????????????????AP????????????????????????????????????????????????????? // ???????????? MLinearLayout rootLayout; /** * ????? * ?????????????????????????????????????XML???????????????????????????rootLayout?????????????????????????????? */ public UIBuilder(Activity context) { this.context = context; // ???????XML???????????????????View?????????????????? context.setContentView(R.layout.fw_template_scroll); // ?????????????????????????XML?????? this.rootLayout = (MLinearLayout)context.findViewById(R.id._FWRootLayout); FWUtil.d("?????????????????"); } /** * ????????????????????????????? * * @param v ????????View */ public UIBuilder add(View...v) { //FWUtil.d("add??????????" + v.length + "????View??????????????????" + includingViews.size() ); for( int i = 0; i < v.length; i ++ ) { //FWUtil.d("???????View???" + v.toString() ); this.rootLayout.add( v[i] ); } //FWUtil.d("add??????????" + v.length + "????View??????????????????" + includingViews.size() ); return this; } /** * ????????????????????????????????? */ public UIBuilder display() { FWUtil.d("????????????"); // ??????????????????????????? rootLayout.inflateInside(); FWUtil.d("????????????"); return this; } // TODO: toXML() ????????????????UI???????????????????????????????XML??????????????????????? }