|
AI2 Component
(Version nb184)
|
Go to the documentation of this file.
7 package com.google.appinventor.components.runtime;
18 import android.view.View;
19 import android.view.View.OnFocusChangeListener;
20 import android.widget.CompoundButton;
21 import android.widget.CompoundButton.OnCheckedChangeListener;
30 implements OnCheckedChangeListener, OnFocusChangeListener {
35 private int backgroundColor;
38 private int fontTypeface;
44 private boolean italic;
47 private int textColor;
54 @SuppressWarnings(
"WeakerAccess")
59 @SuppressWarnings(
"WeakerAccess")
62 view.setOnFocusChangeListener(
this);
63 view.setOnCheckedChangeListener(
this);
85 @
SimpleEvent(description =
"User tapped and released the %type%.")
93 @
SimpleEvent(description =
"%type% became the focused component.")
101 @
SimpleEvent(description =
"%type% stopped being the focused component.")
114 @
SimpleProperty(description =
"The background color of the %type% as an alpha-red-green-blue integer.")
116 backgroundColor = argb;
135 return backgroundColor;
144 defaultValue =
"True")
145 @
SimpleProperty(description =
"True if the %type% is active and clickable.")
159 return view.isEnabled();
169 defaultValue =
"False")
172 description =
"Set to true if the text of the %type% should be bold.")
200 defaultValue =
"False")
203 description =
"Set to true if the text of the %type% should be italic.")
205 this.italic = italic;
231 @
SimpleProperty(description =
"Specifies the text font size of the %type% in scale-independent "
261 description =
"Specifies the text font face of the %type%.",
264 fontTypeface = typeface;
291 @
SimpleProperty(description =
"Specifies the text displayed by the %type%.")
292 public
void Text(String text) {
316 @
SimpleProperty(description =
"Specifies the text color of the %type% as an "
317 +
"alpha-red-green-blue integer.")
static void setText(TextView textview, String text)
static final int COLOR_DEFAULT
static final String PROPERTY_TYPE_TYPEFACE
-*- mode: java; c-basic-offset: 2; -*-
static final String DEFAULT_VALUE_COLOR_NONE
static final String PROPERTY_TYPE_STRING
static final String PROPERTY_TYPE_BOOLEAN
static void setFontTypeface(TextView textview, int typeface, boolean bold, boolean italic)
static String getText(TextView textview)
void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
void $add(AndroidViewComponent component)
static float getFontSize(TextView textview, Context context)
static final int COLOR_NONE
static boolean dispatchEvent(Component component, String eventName, Object...args)
static void setBackgroundColor(TextView textview, int argb)
static void setFontSize(TextView textview, float size)
static final int COLOR_BLACK
Copyright 2009-2011 Google, All Rights reserved.
static final int TYPEFACE_DEFAULT
void onFocusChange(View previouslyFocused, boolean gainFocus)
static final String PROPERTY_TYPE_COLOR
static final int COLOR_WHITE
final ComponentContainer container
static final String PROPERTY_TYPE_NON_NEGATIVE_FLOAT
static void setEnabled(TextView textview, boolean enabled)
static void setTextColor(TextView textview, int argb)
static final float FONT_DEFAULT_SIZE
static final String DEFAULT_VALUE_COLOR_BLACK