BuildmLearn-Toolkit-Android  2.0.0
The Android version of the BuildmLearn Toolkit. BuildmLearn Toolkit is an easy-to-use program that helps the users make mobile apps without any knowledge of application development.
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.buildmlearn.toolkit.activity.TemplateEditor Class Reference

Placeholder activity for all the templates A placeholder activty in which all the templates are loaded and allows the user to enter respective template data, generate and save projects, APKs and sharing options. More...

Inheritance diagram for org.buildmlearn.toolkit.activity.TemplateEditor:
Inheritance graph
[legend]
Collaboration diagram for org.buildmlearn.toolkit.activity.TemplateEditor:
Collaboration graph
[legend]

Public Member Functions

void onActivityResult (int requestCode, int resultCode, Intent intent)
 
boolean onCreateOptionsMenu (Menu menu)
 
boolean onPrepareOptionsMenu (Menu menu)
 
boolean onOptionsItemSelected (MenuItem item)
 
void restoreSelectedView ()
 Removes selected color from the selected ListView item when switching from edit mode to normal mode. More...
 
void onBackPressed ()
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 
void onSaveInstanceState (Bundle outState)
 

Private Member Functions

void populateMetaView (final BaseAdapter adapter)
 Populates meta ListView item by setting adapter to ListView. More...
 
void populateListView (final BaseAdapter adapter)
 Populates ListView item by setting adapter to ListView. Also inflates Header View. Header view contains the editable author name and template title fields. More...
 
void setUpActionBar ()
 Initialization function for setting up action bar. More...
 
void setUpTemplateEditor ()
 Initialization function when the Temlpate Editor is created. More...
 
void restoreTemplateEditor (Bundle savedInstanceState)
 Initialization function when the Temlpate Editor is restored. More...
 
void changeColorScheme ()
 Changes the color scheme when switching from normal mode to edit mode. Edit mode is triggered, when the list item is long pressed. More...
 
void restoreColorScheme ()
 Restores the color scheme when switching from edit mode to normal mode. Edit mode is triggered, when the list item is long pressed. More...
 
String saveProject ()
 Saves the current project into a .buildmlearn file. More...
 
String saveDraft ()
 Saves the current project into a .buildmlearn file. More...
 
void startSimulator ()
 Start the simulator activity Start the simulator with the fragment returned by the selected template. Simulator is started as a new activity. More...
 
void parseSavedFile (String path)
 Converts an existing .buildmlearn file to TemplateInterface Object This function is used in loading existing files to editor. Reads file at a given path, parse the file and convert into and convert it into TemplateInterface object. More...
 
void updateHeaderDetails (String name, String title)
 Updates the title and author name in the header view. More...
 
void setAdapter (BaseAdapter adapter)
 Sets the adapter to the ListView. More...
 
void setAdapterMeta (BaseAdapter adapter)
 Sets the adapter to the ListView. More...
 

Private Attributes

final Handler handlerToast
 
ListView templateEdtiorList
 
ListView templateMetaList
 
int templateId
 
Template template
 
TemplateInterface selectedTemplate
 
int selectedPosition = -1
 
boolean showTemplateSelectedMenu
 
View selectedView
 
ToolkitApplication toolkit
 
String oldFileName
 
MaterialDialog mApkGenerationDialog
 

Static Private Attributes

static final String TAG = "TEMPLATE EDITOR"
 
static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE_RESULT = 100
 

Detailed Description

Placeholder activity for all the templates

A placeholder activty in which all the templates are loaded and allows the user to enter respective template data, generate and save projects, APKs and sharing options.

Member Function Documentation

void org.buildmlearn.toolkit.activity.TemplateEditor.changeColorScheme ( )
private

Changes the color scheme when switching from normal mode to edit mode. Edit mode is triggered, when the list item is long pressed.

void org.buildmlearn.toolkit.activity.TemplateEditor.onActivityResult ( int  requestCode,
int  resultCode,
Intent  intent 
)
void org.buildmlearn.toolkit.activity.TemplateEditor.onBackPressed ( )
void org.buildmlearn.toolkit.activity.TemplateEditor.onCreate ( Bundle  savedInstanceState)
protected
boolean org.buildmlearn.toolkit.activity.TemplateEditor.onCreateOptionsMenu ( Menu  menu)
boolean org.buildmlearn.toolkit.activity.TemplateEditor.onOptionsItemSelected ( MenuItem  item)
boolean org.buildmlearn.toolkit.activity.TemplateEditor.onPrepareOptionsMenu ( Menu  menu)
void org.buildmlearn.toolkit.activity.TemplateEditor.onSaveInstanceState ( Bundle  outState)
protected
void org.buildmlearn.toolkit.activity.TemplateEditor.parseSavedFile ( String  path)
private

Converts an existing .buildmlearn file to TemplateInterface Object This function is used in loading existing files to editor. Reads file at a given path, parse the file and convert into and convert it into TemplateInterface object.

Parameters
pathPath of the existing .buildmlearn file
void org.buildmlearn.toolkit.activity.TemplateEditor.populateListView ( final BaseAdapter  adapter)
private

Populates ListView item by setting adapter to ListView. Also inflates Header View. Header view contains the editable author name and template title fields.

Parameters
adapterAdapter containing template data
void org.buildmlearn.toolkit.activity.TemplateEditor.populateMetaView ( final BaseAdapter  adapter)
private

Populates meta ListView item by setting adapter to ListView.

Parameters
adapterAdapter containing template meta data
void org.buildmlearn.toolkit.activity.TemplateEditor.restoreColorScheme ( )
private

Restores the color scheme when switching from edit mode to normal mode. Edit mode is triggered, when the list item is long pressed.

void org.buildmlearn.toolkit.activity.TemplateEditor.restoreSelectedView ( )

Removes selected color from the selected ListView item when switching from edit mode to normal mode.

void org.buildmlearn.toolkit.activity.TemplateEditor.restoreTemplateEditor ( Bundle  savedInstanceState)
private

Initialization function when the Temlpate Editor is restored.

String org.buildmlearn.toolkit.activity.TemplateEditor.saveDraft ( )
private

Saves the current project into a .buildmlearn file.

Converts the current TemplateInterface object into a xml file. Xml file is saved in DRAFT Directory (defined in constants). File name is of the format: draft<0-X>.buildmlearn

Returns
Absolute path of the saved file. Null if there is some error.
String org.buildmlearn.toolkit.activity.TemplateEditor.saveProject ( )
private

Saves the current project into a .buildmlearn file.

Converts the current TemplateInterface object into a xml file. Xml file is saved in SAVE Directory (defined in constants). File name is of the format: <title>_by_<author>.buildmlearn

Returns
Absolute path of the saved file. Null if there is some error.
void org.buildmlearn.toolkit.activity.TemplateEditor.setAdapter ( BaseAdapter  adapter)
private

Sets the adapter to the ListView.

Parameters
adapter
void org.buildmlearn.toolkit.activity.TemplateEditor.setAdapterMeta ( BaseAdapter  adapter)
private

Sets the adapter to the ListView.

Parameters
adapter
void org.buildmlearn.toolkit.activity.TemplateEditor.setUpActionBar ( )
private

Initialization function for setting up action bar.

void org.buildmlearn.toolkit.activity.TemplateEditor.setUpTemplateEditor ( )
private

Initialization function when the Temlpate Editor is created.

void org.buildmlearn.toolkit.activity.TemplateEditor.startSimulator ( )
private

Start the simulator activity Start the simulator with the fragment returned by the selected template. Simulator is started as a new activity.

void org.buildmlearn.toolkit.activity.TemplateEditor.updateHeaderDetails ( String  name,
String  title 
)
private

Updates the title and author name in the header view.

Parameters
nameName of the author
titleTitle of the template app

Member Data Documentation

final Handler org.buildmlearn.toolkit.activity.TemplateEditor.handlerToast
private
Initial value:
= new Handler() {
public void handleMessage(Message message) {
if (message.arg1 == -1) {
Toast.makeText(TemplateEditor.this, "Build unsuccessful", Toast.LENGTH_SHORT).show();
}
}
}
MaterialDialog org.buildmlearn.toolkit.activity.TemplateEditor.mApkGenerationDialog
private
String org.buildmlearn.toolkit.activity.TemplateEditor.oldFileName
private
final int org.buildmlearn.toolkit.activity.TemplateEditor.PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE_RESULT = 100
staticprivate
int org.buildmlearn.toolkit.activity.TemplateEditor.selectedPosition = -1
private
TemplateInterface org.buildmlearn.toolkit.activity.TemplateEditor.selectedTemplate
private
View org.buildmlearn.toolkit.activity.TemplateEditor.selectedView
private
boolean org.buildmlearn.toolkit.activity.TemplateEditor.showTemplateSelectedMenu
private
final String org.buildmlearn.toolkit.activity.TemplateEditor.TAG = "TEMPLATE EDITOR"
staticprivate
Template org.buildmlearn.toolkit.activity.TemplateEditor.template
private
ListView org.buildmlearn.toolkit.activity.TemplateEditor.templateEdtiorList
private
int org.buildmlearn.toolkit.activity.TemplateEditor.templateId
private
ListView org.buildmlearn.toolkit.activity.TemplateEditor.templateMetaList
private
ToolkitApplication org.buildmlearn.toolkit.activity.TemplateEditor.toolkit
private

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