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 | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.buildmlearn.toolkit.templates.FlashTemplate Class Reference

Flash Card template code implementing methods of TemplateInterface. More...

Inheritance diagram for org.buildmlearn.toolkit.templates.FlashTemplate:
Inheritance graph
[legend]
Collaboration diagram for org.buildmlearn.toolkit.templates.FlashTemplate:
Collaboration graph
[legend]

Public Member Functions

 FlashTemplate ()
 
BaseAdapter newTemplateEditorAdapter (Context context)
 Called from Template Editor when template editor is started for creating a new template project. More...
 
BaseAdapter newMetaEditorAdapter (Context context)
 Called from Template Editor when template editor is started for creating a new meta details of template project. More...
 
BaseAdapter currentTemplateEditorAdapter ()
 This function is used to get the adapter (containing template data) for a existing/current template project. More...
 
BaseAdapter currentMetaEditorAdapter ()
 This function is used to get the meta adapter (containing template meta details) for a existing/current template project. More...
 
BaseAdapter loadProjectMetaEditor (Context context, Document doc)
 
BaseAdapter loadProjectTemplateEditor (Context context, ArrayList< Element > data)
 
void setTemplateId (int templateId)
 Set templateId,that can be used to get Info about current template from enum Template. More...
 
String getTitle ()
 Used to get the title of the templaye. Mainly used to update ActionBar in Template Editor. More...
 
void addItem (final Activity activity)
 
void addMetaData (Activity activity)
 Add MetaData to template data. More...
 
void editItem (final Activity activity, final int position)
 
void deleteItem (Activity activity, int position)
 Remove an item form template data list. More...
 
ArrayList< Element > getItems (Document doc)
 
android.support.v4.app.Fragment getSimulatorFragment (String filePathWithName)
 Returns a fragment required for the Simulator Activity. More...
 
String getAssetsFileName (Context context)
 Name of the xml file congaing template data in the assets folders in the build apk. More...
 
String getAssetsFilePath ()
 Folder path in which the apk is stored in the build APK. More...
 
String getApkFilePath ()
 
void onActivityResult (Context context, int requestCode, int resultCode, Intent intent)
 Called whenever onActivityResult is called in Template Editor. Can be used to perform action related to intent and callbacks. More...
 
- Public Member Functions inherited from org.buildmlearn.toolkit.model.TemplateInterface
void addItem (Activity activity)
 Add an item to template data. More...
 
void editItem (Activity activity, int position)
 Called to edit an item in the template data. More...
 

Private Member Functions

boolean validateData (EditText question, EditText answer, EditText answerHint, Context context)
 
Bitmap getResizedBitmap (Bitmap image)
 
Bitmap grabImage (Context context)
 
Intent makePhotoIntent (String title, Context context)
 
File createTemporaryFile (Context context, String part) throws Exception
 
void setEmptyView (Activity activity)
 Toggles the visibility of empty text if Array has zero elements. More...
 

Private Attributes

ArrayList< FlashCardModelmData
 
transient Uri mImageUri
 
transient ImageView mBannerImage
 
boolean mIsPhotoAttached
 
transient FlashCardAdapter mAdapter
 
int templateId
 

Static Private Attributes

static final int REQUEST_TAKE_PHOTO = 6677
 
static final String TAG = "FLASH TEMPLATE"
 

Detailed Description

Flash Card template code implementing methods of TemplateInterface.

Created by abhishek on 11/07/15 at 7:33 PM.

Constructor & Destructor Documentation

org.buildmlearn.toolkit.templates.FlashTemplate.FlashTemplate ( )

Member Function Documentation

void org.buildmlearn.toolkit.templates.FlashTemplate.addItem ( final Activity  activity)
void org.buildmlearn.toolkit.templates.FlashTemplate.addMetaData ( Activity  activity)

Add MetaData to template data.

Parameters
activityCurrent Activity

Implements org.buildmlearn.toolkit.model.TemplateInterface.

File org.buildmlearn.toolkit.templates.FlashTemplate.createTemporaryFile ( Context  context,
String  part 
) throws Exception
private
BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.currentMetaEditorAdapter ( )

This function is used to get the meta adapter (containing template meta details) for a existing/current template project.

Returns
BaseAdapter inherited Object

Implements org.buildmlearn.toolkit.model.TemplateInterface.

BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.currentTemplateEditorAdapter ( )

This function is used to get the adapter (containing template data) for a existing/current template project.

Returns
BaseAdapter inherited Object

Implements org.buildmlearn.toolkit.model.TemplateInterface.

void org.buildmlearn.toolkit.templates.FlashTemplate.deleteItem ( Activity  activity,
int  position 
)

Remove an item form template data list.

Parameters
activityCurrent Activity
positionPosition of the item to be removed

Implements org.buildmlearn.toolkit.model.TemplateInterface.

void org.buildmlearn.toolkit.templates.FlashTemplate.editItem ( final Activity  activity,
final int  position 
)
String org.buildmlearn.toolkit.templates.FlashTemplate.getApkFilePath ( )

Path of the apk stored in assets

Returns
Apk file path

Implements org.buildmlearn.toolkit.model.TemplateInterface.

String org.buildmlearn.toolkit.templates.FlashTemplate.getAssetsFileName ( Context  context)

Name of the xml file congaing template data in the assets folders in the build apk.

Parameters
contextFor obtaining String from StringRes
Returns
Asset file name

Implements org.buildmlearn.toolkit.model.TemplateInterface.

String org.buildmlearn.toolkit.templates.FlashTemplate.getAssetsFilePath ( )

Folder path in which the apk is stored in the build APK.

Returns
Assets folder path

Implements org.buildmlearn.toolkit.model.TemplateInterface.

ArrayList<Element> org.buildmlearn.toolkit.templates.FlashTemplate.getItems ( Document  doc)
Bitmap org.buildmlearn.toolkit.templates.FlashTemplate.getResizedBitmap ( Bitmap  image)
private
android.support.v4.app.Fragment org.buildmlearn.toolkit.templates.FlashTemplate.getSimulatorFragment ( String  filePathWithName)

Returns a fragment required for the Simulator Activity.

Parameters
filePathWithNamePath of the generated .buildmlearn file
Returns
Returns a fragment required for the Simulator Activity. **Dev Note: File Path should be used to populate data from actual .buildmlearn file in the Simulator.

Implements org.buildmlearn.toolkit.model.TemplateInterface.

String org.buildmlearn.toolkit.templates.FlashTemplate.getTitle ( )

Used to get the title of the templaye. Mainly used to update ActionBar in Template Editor.

Returns
Title as a string

Implements org.buildmlearn.toolkit.model.TemplateInterface.

Bitmap org.buildmlearn.toolkit.templates.FlashTemplate.grabImage ( Context  context)
private
BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.loadProjectMetaEditor ( Context  context,
Document  doc 
)
BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.loadProjectTemplateEditor ( Context  context,
ArrayList< Element >  data 
)
Intent org.buildmlearn.toolkit.templates.FlashTemplate.makePhotoIntent ( String  title,
Context  context 
)
private
BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.newMetaEditorAdapter ( Context  context)

Called from Template Editor when template editor is started for creating a new meta details of template project.

Parameters
contextApplication context
Returns
BaseAdapter inherited Object

Implements org.buildmlearn.toolkit.model.TemplateInterface.

BaseAdapter org.buildmlearn.toolkit.templates.FlashTemplate.newTemplateEditorAdapter ( Context  context)

Called from Template Editor when template editor is started for creating a new template project.

Parameters
contextApplication context
Returns
BaseAdapter inherited Object

Implements org.buildmlearn.toolkit.model.TemplateInterface.

void org.buildmlearn.toolkit.templates.FlashTemplate.onActivityResult ( Context  context,
int  requestCode,
int  resultCode,
Intent  intent 
)

Called whenever onActivityResult is called in Template Editor. Can be used to perform action related to intent and callbacks.

Parameters
context
requestCode
resultCode
intent

Implements org.buildmlearn.toolkit.model.TemplateInterface.

void org.buildmlearn.toolkit.templates.FlashTemplate.setEmptyView ( Activity  activity)
private

Toggles the visibility of empty text if Array has zero elements.

void org.buildmlearn.toolkit.templates.FlashTemplate.setTemplateId ( int  templateId)

Set templateId,that can be used to get Info about current template from enum Template.

Parameters
templateId

Implements org.buildmlearn.toolkit.model.TemplateInterface.

boolean org.buildmlearn.toolkit.templates.FlashTemplate.validateData ( EditText  question,
EditText  answer,
EditText  answerHint,
Context  context 
)
private

Member Data Documentation

transient FlashCardAdapter org.buildmlearn.toolkit.templates.FlashTemplate.mAdapter
private
transient ImageView org.buildmlearn.toolkit.templates.FlashTemplate.mBannerImage
private
ArrayList<FlashCardModel> org.buildmlearn.toolkit.templates.FlashTemplate.mData
private
transient Uri org.buildmlearn.toolkit.templates.FlashTemplate.mImageUri
private
boolean org.buildmlearn.toolkit.templates.FlashTemplate.mIsPhotoAttached
private
final int org.buildmlearn.toolkit.templates.FlashTemplate.REQUEST_TAKE_PHOTO = 6677
staticprivate
final String org.buildmlearn.toolkit.templates.FlashTemplate.TAG = "FLASH TEMPLATE"
staticprivate
int org.buildmlearn.toolkit.templates.FlashTemplate.templateId
private

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