/** * Creates a new CheckBox component. * * @param container container, component will be placed in */ public CheckBox(ComponentContainer container) { super(container); view = new android.widget.CheckBox(container.$context()); // Listen to focus changes view.setOnFocusChangeListener(this); view.setOnCheckedChangeListener(this); // Adds the component to its designated container container.$add(this); BackgroundColor(Component.COLOR_NONE); Enabled(true); fontTypeface = Component.TYPEFACE_DEFAULT; TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic); FontSize(Component.FONT_DEFAULT_SIZE); Text(""); TextColor(Component.COLOR_BLACK); Checked(false); }
public CheckBox(ComponentContainer container, int resourceId) { super(container, resourceId); // view = (android.widget.CheckBox) form.findViewById(resourceId); view = null; android.widget.CheckBox view = (android.widget.CheckBox) container.$form().findViewById(resourceId); // Listen to focus changes view.setOnFocusChangeListener(this); view.setOnCheckedChangeListener(this); // BackgroundColor(Component.COLOR_NONE); // Enabled(true); // fontTypeface = Component.TYPEFACE_DEFAULT; // TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic); // FontSize(Component.FONT_DEFAULT_SIZE); // Text(""); // TextColor(Component.COLOR_BLACK); getfontTypeFace(); Checked(false); }