JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
jarmos.app.activity.ModelListActivity Class Reference

This activity generates a simple ListView to allow selection of a model. More...

Inheritance diagram for jarmos.app.activity.ModelListActivity:

Public Member Functions

void onCreateContextMenu (ContextMenu menu, View v, ContextMenuInfo menuInfo)
 
boolean onContextItemSelected (MenuItem item)
 

Static Public Attributes

static final int NO_MODELS_DIALOG_ID = 2
 Dialog ID for the dialog that tells the user there are no models for the selected source. More...
 
static final int NOSRC_DIALOG_ID = 1
 Dialog ID for the case of an invalid or nonexistent Source ID. More...
 

Protected Member Functions

void onActivityResult (int requestCode, int resultCode, Intent data)
 
void onCreate (Bundle savedInstanceState)
 
Dialog onCreateDialog (int id)
 Helper method that takes a list of folders and a source which creates the ModelDescriptors using the ModelManager class. More...
 

Detailed Description

This activity generates a simple ListView to allow selection of a model.

Renamed the former CaptionImageAdapter to ModelsGridViewAdapter.

Depending on the selected Source (passed in the Intent-IntExtra "Source") a list (compiled at runtime) from the asset or sd card folder contents is displayed. The Source ID's are defined in the ModelManager class.

In difference to the former version (which worked with "demo+position" folders) the GridView items are now of a small private class containing the model folder name, the title and a Drawable as thumbnail. Those items are used to populate the GridView in the ModelsGridViewAdapter.getView() method. This way, the models can be loaded dynamically at runtime. This allows to add models to the SD-Card (or exchange it) and run them straightaway.

Author
Daniel Wirtz
Date
2013-08-07

Definition at line 57 of file ModelListActivity.java.

Member Function Documentation

void jarmos.app.activity.ModelListActivity.onActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)
protected

Definition at line 155 of file ModelListActivity.java.

boolean jarmos.app.activity.ModelListActivity.onContextItemSelected ( MenuItem  item)

Definition at line 294 of file ModelListActivity.java.

void jarmos.app.activity.ModelListActivity.onCreate ( Bundle  savedInstanceState)
protected
See Also
android.app.Activity::onCreate(android.os.Bundle)

Definition at line 163 of file ModelListActivity.java.

void jarmos.app.activity.ModelListActivity.onCreateContextMenu ( ContextMenu  menu,
View  v,
ContextMenuInfo  menuInfo 
)

Definition at line 283 of file ModelListActivity.java.

Dialog jarmos.app.activity.ModelListActivity.onCreateDialog ( int  id)
protected

Helper method that takes a list of folders and a source which creates the ModelDescriptors using the ModelManager class.

Parses the corresponding "model.xml" file which is (so far) of the structure { <rbappmodel title="SomeTitle" image="someimage.png">} The title and image attributes are used for the GridView.

Parameters
foldersThe model folder names
srcThe Source - See ModelManager SRC_ constants.
Returns
The ModelDescriptors for each model

Definition at line 253 of file ModelListActivity.java.

Member Data Documentation

final int jarmos.app.activity.ModelListActivity.NO_MODELS_DIALOG_ID = 2
static

Dialog ID for the dialog that tells the user there are no models for the selected source.

Definition at line 137 of file ModelListActivity.java.

final int jarmos.app.activity.ModelListActivity.NOSRC_DIALOG_ID = 1
static

Dialog ID for the case of an invalid or nonexistent Source ID.

Definition at line 142 of file ModelListActivity.java.


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