示例#1
0
 /**
  * Specifies the checkbox's text's font face as default, serif, sans serif, or monospace.
  *
  * @param typeface one of {@link Component#TYPEFACE_DEFAULT}, {@link Component#TYPEFACE_SERIF},
  *     {@link Component#TYPEFACE_SANSSERIF} or {@link Component#TYPEFACE_MONOSPACE}
  */
 public void FontTypeface(int typeface) {
   fontTypeface = typeface;
   if (resourceId != -1) {
     TextViewUtil.setFontTypeface(
         (android.widget.CheckBox) container.$context().findViewById(resourceId),
         fontTypeface,
         bold,
         italic);
   } else {
     TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
   }
 }
示例#2
0
 /**
  * Specifies whether the checkbox's text should be italic. Some fonts do not support italic.
  *
  * @param italic {@code true} indicates italic, {@code false} normal
  */
 public void FontItalic(boolean italic) {
   this.italic = italic;
   if (resourceId != -1) {
     TextViewUtil.setFontTypeface(
         (android.widget.CheckBox) container.$context().findViewById(resourceId),
         fontTypeface,
         bold,
         italic);
   } else {
     TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
   }
 }
示例#3
0
  /**
   * Creates a new TextBoxBase component
   *
   * @param container container that the component will be placed in
   * @param textview the underlying EditText object that maintains the text
   */
  public TextBoxBase(ComponentContainer container, EditText textview) {
    super(container);

    view = textview;

    // Listen to focus changes
    view.setOnFocusChangeListener(this);

    defaultTextBoxDrawable = view.getBackground();

    // Add a transformation method to provide input validation
    /*
     * TODO(user): see comment above) setTransformationMethod(new
     * ValidationTransformationMethod());
     */

    // Adds the component to its designated container
    container.$add(this);

    container.setChildWidth(this, ComponentConstants.TEXTBOX_PREFERRED_WIDTH);

    TextAlignment(Component.ALIGNMENT_NORMAL);
    // Leave the nice default background color. Users can change it to
    // "none" if they like
    //
    // TODO(user): if we make a change here we also need to change the
    // default property value.
    // Eventually I hope to simplify this so it has to be changed in one
    // location
    // only). Maybe we need another color value which would be
    // 'SYSTEM_DEFAULT' which
    // will not attempt to explicitly initialize with any of the properties
    // with any
    // particular value.
    // BackgroundColor(Component.COLOR_NONE);
    Enabled(true);
    fontTypeface = Component.TYPEFACE_DEFAULT;
    TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
    FontSize(Component.FONT_DEFAULT_SIZE);
    Hint("");
    Text("");
    TextColor(Component.COLOR_BLACK);
  }
示例#4
0
  /**
   * 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);
  }
示例#5
0
 /**
  * Specifies the textbox's text's font face as default, serif, sans serif, or monospace.
  *
  * @param typeface one of {@link Component#TYPEFACE_DEFAULT}, {@link Component#TYPEFACE_SERIF},
  *     {@link Component#TYPEFACE_SANSSERIF} or {@link Component#TYPEFACE_MONOSPACE}
  */
 public void FontTypeface(int typeface) {
   fontTypeface = typeface;
   TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
 }
示例#6
0
 /**
  * Specifies whether the textbox's text should be italic. Some fonts do not support italic.
  *
  * @param italic {@code true} indicates italic, {@code false} normal
  */
 public void FontItalic(boolean italic) {
   this.italic = italic;
   TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
 }
示例#7
0
 /**
  * Specifies whether the textbox's text should be bold. Some fonts do not support bold.
  *
  * @param bold {@code true} indicates bold, {@code false} normal
  */
 public void FontBold(boolean bold) {
   this.bold = bold;
   TextViewUtil.setFontTypeface(view, fontTypeface, bold, italic);
 }