AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.ReplForm Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.ReplForm:
com.google.appinventor.components.runtime.Form com.google.appinventor.components.runtime.AppInventorCompatActivity com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.ComponentContainer com.google.appinventor.components.runtime.HandlesEventDispatching

Classes

class  SchemeInterface
 

Public Member Functions

 ReplForm ()
 
void onCreate (Bundle icicle)
 
void setFormName (String formName)
 
boolean onCreateOptionsMenu (Menu menu)
 
void addSettingsButton (Menu menu)
 
void addLogcatButton (Menu menu)
 
boolean isDirect ()
 
void setIsUSBrepl ()
 
void startHTTPD (boolean secure)
 
boolean isAssetsLoaded ()
 
void setAssetsLoaded ()
 
void loadComponents (List< String > extensionNames)
 
void Theme (String theme)
 
void sendToCompanion (String data)
 
void setWebRTCMgr (WebRTCNativeMgr mgr)
 
void evalScheme (String sexp)
 
String getAssetPath (String asset)
 
String getAssetPathForExtension (Component component, String asset) throws FileNotFoundException
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.Form
void onConfigurationChanged (Configuration newConfig)
 
void onGlobalLayout ()
 
void onBackPressed ()
 
boolean BackPressed ()
 
int registerForActivityResult (ActivityResultListener listener)
 
void registerForActivityResult (ActivityResultListener listener, int requestCode)
 
void unregisterForActivityResult (ActivityResultListener listener)
 
void registerPercentLength (AndroidViewComponent component, int length, PercentStorageRecord.Dim dim)
 
void unregisterPercentLength (AndroidViewComponent component, PercentStorageRecord.Dim dim)
 
void registerForOnResume (OnResumeListener component)
 
void registerForOnOrientationChange (OnOrientationChangeListener component)
 
void registerForOnInitialize (OnInitializeListener component)
 
void registerForOnNewIntent (OnNewIntentListener component)
 
void registerForOnPause (OnPauseListener component)
 
void registerForOnStop (OnStopListener component)
 
void registerForOnClear (OnClearListener component)
 
void registerForOnDestroy (OnDestroyListener component)
 
void registerForOnCreateOptionsMenu (OnCreateOptionsMenuListener component)
 
void registerForOnOptionsItemSelected (OnOptionsItemSelectedListener component)
 
Dialog onCreateDialog (int id)
 
void onPrepareDialog (int id, Dialog dialog)
 
boolean canDispatchEvent (Component component, String eventName)
 
boolean dispatchEvent (Component component, String componentName, String eventName, Object[] args)
 
void dispatchGenericEvent (Component component, String eventName, boolean notAlreadyHandled, Object[] args)
 
void Initialize ()
 
void ScreenOrientationChanged ()
 
void ErrorOccurred (Component component, String functionName, int errorNumber, String message)
 
void ErrorOccurredDialog (Component component, String functionName, int errorNumber, String message, String title, String buttonText)
 
void dispatchPermissionDeniedEvent (final Component component, final String functionName, final PermissionException exception)
 
void dispatchPermissionDeniedEvent (final Component component, final String functionName, final String permissionName)
 
void dispatchErrorOccurredEvent (final Component component, final String functionName, final int errorNumber, final Object... messageArgs)
 
void dispatchErrorOccurredEventDialog (final Component component, final String functionName, final int errorNumber, final Object... messageArgs)
 
void runtimeFormErrorOccurredEvent (String functionName, int errorNumber, String message)
 
void PermissionDenied (Component component, String functionName, String permissionName)
 
void PermissionGranted (String permissionName)
 
void AskForPermission (String permissionName)
 
boolean Scrollable ()
 
void Scrollable (boolean scrollable)
 
int BackgroundColor ()
 
void BackgroundColor (int argb)
 
String BackgroundImage ()
 
void BackgroundImage (String path)
 
String Title ()
 
void Title (String title)
 
String AboutScreen ()
 
void AboutScreen (String aboutScreen)
 
boolean TitleVisible ()
 
void TitleVisible (boolean show)
 
boolean ShowStatusBar ()
 
void ShowStatusBar (boolean show)
 
String ScreenOrientation ()
 
void ScreenOrientation (String screenOrientation)
 
void ActionBar (boolean enabled)
 
int AlignHorizontal ()
 
void AlignHorizontal (int alignment)
 
int AlignVertical ()
 
void AlignVertical (int alignment)
 
String OpenScreenAnimation ()
 
void OpenScreenAnimation (String animType)
 
String CloseScreenAnimation ()
 
void CloseScreenAnimation (String animType)
 
String getOpenAnimType ()
 
void Icon (String name)
 
void VersionCode (int vCode)
 
void VersionName (String vName)
 
void Sizing (String value)
 
void ShowListsAsJson (boolean asJson)
 
boolean ShowListsAsJson ()
 
void AppName (String aName)
 
void PrimaryColor (final int color)
 
int PrimaryColor ()
 
void PrimaryColorDark (int color)
 
int PrimaryColorDark ()
 
void AccentColor (int color)
 
int AccentColor ()
 
int Width ()
 
int Height ()
 
void TutorialURL (String url)
 
void BlocksToolkit (String json)
 
String Platform ()
 
String PlatformVersion ()
 
void OtherScreenClosed (String otherScreenName, Object result)
 
HandlesEventDispatching getDispatchDelegate ()
 
Activity $context ()
 
Form $form ()
 
void $add (AndroidViewComponent component)
 
float deviceDensity ()
 
float compatScalingFactor ()
 
void setChildWidth (final AndroidViewComponent component, int width)
 
void setChildHeight (final AndroidViewComponent component, int height)
 
void addExitButtonToMenu (Menu menu)
 
void addAboutInfoToMenu (Menu menu)
 
boolean onOptionsItemSelected (MenuItem item)
 
void clear ()
 
void deleteComponent (Object component)
 
void dontGrabTouchEventsForComponent ()
 
void callInitialize (Object component) throws Throwable
 
synchronized Bundle fullScreenVideoAction (int action, VideoPlayer source, Object data)
 
void HideKeyboard ()
 
boolean isDarkTheme ()
 
boolean isDeniedPermission (String permission)
 
void assertPermission (String permission)
 
void askPermission (final String permission, final PermissionResultHandler responseRequestor)
 
void askPermission (final BulkPermissionRequest request)
 
void onRequestPermissionsResult (int requestCode, String permissions[], int[] grantResults)
 
boolean doesAppDeclarePermission (String permissionName)
 
InputStream openAsset (String asset) throws IOException
 
InputStream openAssetForExtension (Component component, String asset) throws IOException
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.AppInventorCompatActivity
final boolean isAppCompatMode ()
 
void onSupportActionModeStarted (ActionMode actionMode)
 
void onSupportActionModeFinished (ActionMode actionMode)
 
ActionMode onWindowStartingSupportActionMode (Callback callback)
 
void setContentView (View view)
 
ActionBar getSupportActionBar ()
 

Static Public Member Functions

static void returnRetvals (final String retvals)
 
- Static Public Member Functions inherited from com.google.appinventor.components.runtime.Form
static void switchForm (String nextFormName)
 
static void switchFormWithStartValue (String nextFormName, Object startValue)
 
static Form getActiveForm ()
 
static String getStartText ()
 
static Object getStartValue ()
 
static void finishActivity ()
 
static void finishActivityWithResult (Object result)
 
static void finishActivityWithTextResult (String result)
 
static void finishApplication ()
 
static boolean getCompatibilityMode ()
 
- Static Public Member Functions inherited from com.google.appinventor.components.runtime.AppInventorCompatActivity
static boolean isEmulator ()
 
static boolean isClassicMode ()
 
static void setClassicModeFromYail (boolean newClassicMode)
 

Static Public Attributes

static ReplForm topform
 
- Static Public Attributes inherited from com.google.appinventor.components.runtime.Form
static final String APPINVENTOR_URL_SCHEME = "appinventor"
 
static final String ASSETS_PREFIX = "file:///android_asset/"
 
static final int MAX_PERMISSION_NONCE = 100000
 
- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
static final String ASSET_DIRECTORY = "component"
 
static final int ALIGNMENT_NORMAL = 0
 
static final int ALIGNMENT_CENTER = 1
 
static final int ALIGNMENT_OPPOSITE = 2
 
static final int ACCELEROMETER_SENSITIVITY_WEAK = 1
 
static final int ACCELEROMETER_SENSITIVITY_MODERATE = 2
 
static final int ACCELEROMETER_SENSITIVITY_STRONG = 3
 
static final int BUTTON_SHAPE_DEFAULT = 0
 
static final int BUTTON_SHAPE_ROUNDED = 1
 
static final int BUTTON_SHAPE_RECT = 2
 
static final int BUTTON_SHAPE_OVAL = 3
 
static final int COLOR_NONE = 0x00FFFFFF
 
static final int COLOR_BLACK = 0xFF000000
 
static final int COLOR_BLUE = 0xFF0000FF
 
static final int COLOR_CYAN = 0xFF00FFFF
 
static final int COLOR_DKGRAY = 0xFF444444
 
static final int COLOR_GRAY = 0xFF888888
 
static final int COLOR_GREEN = 0xFF00FF00
 
static final int COLOR_LTGRAY = 0xFFCCCCCC
 
static final int COLOR_MAGENTA = 0xFFFF00FF
 
static final int COLOR_ORANGE = 0xFFFFC800
 
static final int COLOR_PINK = 0xFFFFAFAF
 
static final int COLOR_RED = 0xFFFF0000
 
static final int COLOR_WHITE = 0xFFFFFFFF
 
static final int COLOR_YELLOW = 0xFFFFFF00
 
static final int COLOR_DEFAULT = 0x00000000
 
static final String DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF"
 
static final String DEFAULT_VALUE_COLOR_BLACK = "&HFF000000"
 
static final String DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF"
 
static final String DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF"
 
static final String DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444"
 
static final String DEFAULT_VALUE_COLOR_GRAY = "&HFF888888"
 
static final String DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00"
 
static final String DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC"
 
static final String DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF"
 
static final String DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800"
 
static final String DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF"
 
static final String DEFAULT_VALUE_COLOR_RED = "&HFFFF0000"
 
static final String DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF"
 
static final String DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00"
 
static final String DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000"
 
static final float FONT_DEFAULT_SIZE = 14
 
static final int LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL
 
static final int LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL
 
static final int SCALING_SCALE_PROPORTIONALLY = 0
 
static final int SCALING_SCALE_TO_FIT = 1
 
static final int TYPEFACE_DEFAULT = 0
 
static final int TYPEFACE_SANSSERIF = 1
 
static final int TYPEFACE_SERIF = 2
 
static final int TYPEFACE_MONOSPACE = 3
 
static final int LENGTH_PREFERRED = -1
 
static final int LENGTH_FILL_PARENT = -2
 
static final int LENGTH_UNKNOWN = -3
 
static final int LENGTH_PERCENT_TAG = -1000
 
static final int TOAST_LENGTH_SHORT = 0
 
static final int TOAST_LENGTH_LONG = 1
 
static final int DIRECTION_NORTH = 1
 
static final int DIRECTION_NORTHEAST = 2
 
static final int DIRECTION_EAST = 3
 
static final int DIRECTION_SOUTHEAST = 4
 
static final int DIRECTION_SOUTH = -1
 
static final int DIRECTION_SOUTHWEST = -2
 
static final int DIRECTION_WEST = -3
 
static final int DIRECTION_NORTHWEST = -4
 
static final int DIRECTION_NONE = 0
 
static final int DIRECTION_MIN = -4
 
static final int DIRECTION_MAX = 4
 
static float SLIDER_MIN_VALUE = 10
 
static float SLIDER_MAX_VALUE = 50
 
static float SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = ""
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = ""
 

Protected Member Functions

void onResume ()
 
void onStop ()
 
void onDestroy ()
 
void startNewForm (String nextFormName, Object startupValue)
 
void closeForm (Intent resultIntent)
 
void setResult (Object result)
 
void closeApplicationFromBlocks ()
 
void onNewIntent (Intent intent)
 
boolean isRepl ()
 
void updateTitle ()
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.Form
void onActivityResult (int requestCode, int resultCode, Intent data)
 
void onPause ()
 
void $define ()
 
boolean toastAllowed ()
 
void maybeShowTitleBar ()
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.AppInventorCompatActivity
void onPostCreate (Bundle savedInstanceState)
 
void onPostResume ()
 
void onTitleChanged (CharSequence title, int color)
 
void setActionBarEnabled (boolean enabled)
 
void setClassicMode (boolean classic)
 
void setPrimaryColor (int color)
 
void hideTitleBar ()
 
void styleTitleBar ()
 
void setAppInventorTheme (Theme theme)
 

Additional Inherited Members

- Static Protected Member Functions inherited from com.google.appinventor.components.runtime.Form
static String jsonEncodeForForm (Object value, String functionName)
 
- Static Protected Member Functions inherited from com.google.appinventor.components.runtime.AppInventorCompatActivity
static boolean isActionBarEnabled ()
 
static int getPrimaryColor ()
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.Form
final Handler androidUIHandler = new Handler()
 
String formName
 
String title = ""
 
String startupValue = ""
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.AppInventorCompatActivity
ThemeHelper themeHelper
 
- Static Protected Attributes inherited from com.google.appinventor.components.runtime.Form
static Form activeForm
 

Detailed Description

Subclass of Form used by the 'stem cell apk', i.e. the Android app that allows communication via the Repl

Author
markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)

Definition at line 62 of file ReplForm.java.

Constructor & Destructor Documentation

◆ ReplForm()

com.google.appinventor.components.runtime.ReplForm.ReplForm ( )

Definition at line 83 of file ReplForm.java.

Member Function Documentation

◆ addLogcatButton()

void com.google.appinventor.components.runtime.ReplForm.addLogcatButton ( Menu  menu)

Definition at line 247 of file ReplForm.java.

◆ addSettingsButton()

void com.google.appinventor.components.runtime.ReplForm.addSettingsButton ( Menu  menu)

Definition at line 235 of file ReplForm.java.

◆ closeApplicationFromBlocks()

void com.google.appinventor.components.runtime.ReplForm.closeApplicationFromBlocks ( )
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 212 of file ReplForm.java.

◆ closeForm()

void com.google.appinventor.components.runtime.ReplForm.closeForm ( Intent  resultIntent)
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 201 of file ReplForm.java.

◆ evalScheme()

void com.google.appinventor.components.runtime.ReplForm.evalScheme ( String  sexp)

Definition at line 467 of file ReplForm.java.

◆ getAssetPath()

String com.google.appinventor.components.runtime.ReplForm.getAssetPath ( String  asset)

Gets the path to an asset.

Parameters
assetThe filename of an application asset
Returns
A file: URI to the asset

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 472 of file ReplForm.java.

◆ getAssetPathForExtension()

String com.google.appinventor.components.runtime.ReplForm.getAssetPathForExtension ( Component  component,
String  asset 
) throws FileNotFoundException

Determines a WebView compatible, REPL-sensitive path for an asset provided by a given extension.

Parameters
componentThe extension that is requesting an asset
assetThe asset filename
Returns
A string containing the path to the asset
Exceptions
FileNotFoundExceptionif the asset cannot be located

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 477 of file ReplForm.java.

◆ isAssetsLoaded()

boolean com.google.appinventor.components.runtime.ReplForm.isAssetsLoaded ( )

Definition at line 391 of file ReplForm.java.

◆ isDirect()

boolean com.google.appinventor.components.runtime.ReplForm.isDirect ( )

Definition at line 348 of file ReplForm.java.

◆ isRepl()

boolean com.google.appinventor.components.runtime.ReplForm.isRepl ( )
protected

◆ loadComponents()

void com.google.appinventor.components.runtime.ReplForm.loadComponents ( List< String >  extensionNames)

This is a nasty hack. For loading external component's dex file so that they can be accessible for kawa to load it, when required. This assumes classloader checks class via delegation through the parent classloaders. For multiple dex files, we just cascade the classloaders in the hierarchy

Definition at line 404 of file ReplForm.java.

◆ onCreate()

void com.google.appinventor.components.runtime.ReplForm.onCreate ( Bundle  icicle)

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 122 of file ReplForm.java.

◆ onCreateOptionsMenu()

boolean com.google.appinventor.components.runtime.ReplForm.onCreateOptionsMenu ( Menu  menu)

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 226 of file ReplForm.java.

◆ onDestroy()

void com.google.appinventor.components.runtime.ReplForm.onDestroy ( )
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 177 of file ReplForm.java.

◆ onNewIntent()

void com.google.appinventor.components.runtime.ReplForm.onNewIntent ( Intent  intent)
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 266 of file ReplForm.java.

◆ onResume()

void com.google.appinventor.components.runtime.ReplForm.onResume ( )
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 167 of file ReplForm.java.

◆ onStop()

void com.google.appinventor.components.runtime.ReplForm.onStop ( )
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 172 of file ReplForm.java.

◆ returnRetvals()

static void com.google.appinventor.components.runtime.ReplForm.returnRetvals ( final String  retvals)
static

Definition at line 449 of file ReplForm.java.

◆ sendToCompanion()

void com.google.appinventor.components.runtime.ReplForm.sendToCompanion ( String  data)

Definition at line 455 of file ReplForm.java.

◆ setAssetsLoaded()

void com.google.appinventor.components.runtime.ReplForm.setAssetsLoaded ( )

Definition at line 395 of file ReplForm.java.

◆ setFormName()

void com.google.appinventor.components.runtime.ReplForm.setFormName ( String  formName)

Definition at line 195 of file ReplForm.java.

◆ setIsUSBrepl()

void com.google.appinventor.components.runtime.ReplForm.setIsUSBrepl ( )

Definition at line 352 of file ReplForm.java.

◆ setResult()

void com.google.appinventor.components.runtime.ReplForm.setResult ( Object  result)
protected

Definition at line 205 of file ReplForm.java.

◆ setWebRTCMgr()

void com.google.appinventor.components.runtime.ReplForm.setWebRTCMgr ( WebRTCNativeMgr  mgr)

Definition at line 463 of file ReplForm.java.

◆ startHTTPD()

void com.google.appinventor.components.runtime.ReplForm.startHTTPD ( boolean  secure)

Definition at line 357 of file ReplForm.java.

◆ startNewForm()

void com.google.appinventor.components.runtime.ReplForm.startNewForm ( String  nextFormName,
Object  startupValue 
)
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 188 of file ReplForm.java.

◆ Theme()

Selects the theme for the application. Theme can only be set at compile time and the Companion will approximate changes during live development. Possible options are:

  • Classic, which is the same as older versions of App Inventor;
  • Device Default, which gives the same theme as the version of Android running on the device and uses PrimaryColor for the Action Bar and has light buttons;
  • Black Title Text, which is the Device Default theme but with black title text; and
  • Dark, which is a dark version of the Device Default theme using PrimaryColorDark and having dark grey components.

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 443 of file ReplForm.java.

◆ updateTitle()

void com.google.appinventor.components.runtime.ReplForm.updateTitle ( )
protected

Reimplemented from com.google.appinventor.components.runtime.Form.

Definition at line 517 of file ReplForm.java.

Member Data Documentation

◆ topform

ReplForm com.google.appinventor.components.runtime.ReplForm.topform
static

Definition at line 66 of file ReplForm.java.


The documentation for this class was generated from the following file: