Class AssetController
-
- All Implemented Interfaces:
public class AssetController extends AssetDelegate
-
-
Field Summary
Fields Modifier and Type Field Description public String
path
public boolean
isUpdateLocked
public String
reportingValues
public String
schemaPath
-
Constructor Summary
Constructors Constructor Description AssetController(Context context, String assetPath)
-
Method Summary
Modifier and Type Method Description boolean
isUpdateLocked()
String
getReportingValues()
void
setReportingValues(String reportingValues)
String
getSchemaPath()
void
setupAssetUpdate(AssetContext assetContext, IAssetDelegate callback)
Sets up the AssetController with a context to the Trainer project and a delegate to handle callbacks. void
lockUpdate()
void
resetAssetUpdate()
Resets the asset update functionality. void
createBackup()
Creates a backup of the current assets void
restoreBackup()
Restores assets from a backup if it exists boolean
deleteBackup()
Deletes the backup folder String
getPath()
Gets the asset path void
setPath(String path)
Sets the asset path List<String>
getAssetFiles()
* Gets a list of all local assets that have been stored for this project. String
getAssetVersion()
Gets the asset version boolean
areLocalAssetsAvailable()
* Returns true if local assets are available. boolean
isActive()
* Returns true if the AssetController if 'SetupAssetUpdate' was called. void
checkForUpdates()
Checks whether asset updates are available void
updateAssets()
Updates the assets, only after checkForUpdates was successfully called void
cancelUpdate()
Cancel an ongoing update String
getAssetId()
boolean
deleteLocalAssets()
Delete the local assets void
onAssetDownloadProgress(String assetName, float progress)
void
onAssetUpdateAvailable(boolean updateAvailable)
void
onAssetUpdateError(String error)
void
onAssetUpdateFinished()
-
-
Method Detail
-
isUpdateLocked
boolean isUpdateLocked()
-
getReportingValues
String getReportingValues()
-
setReportingValues
void setReportingValues(String reportingValues)
-
getSchemaPath
String getSchemaPath()
-
setupAssetUpdate
void setupAssetUpdate(AssetContext assetContext, IAssetDelegate callback)
Sets up the AssetController with a context to the Trainer project and a delegate to handle callbacks. After this method is called, the AssetController is considered 'active'.
- Parameters:
assetContext
- The contextcallback
- The callback
-
lockUpdate
void lockUpdate()
-
resetAssetUpdate
void resetAssetUpdate()
Resets the asset update functionality. After this is called, setupAssetUpdate must be called again
-
createBackup
void createBackup()
Creates a backup of the current assets
-
restoreBackup
void restoreBackup()
Restores assets from a backup if it exists
-
deleteBackup
boolean deleteBackup()
Deletes the backup folder
- Returns:
success of the function
-
getAssetFiles
List<String> getAssetFiles()
* Gets a list of all local assets that have been stored for this project.
-
getAssetVersion
String getAssetVersion()
Gets the asset version
- Returns:
asset version
-
areLocalAssetsAvailable
boolean areLocalAssetsAvailable()
* Returns true if local assets are available.
-
isActive
boolean isActive()
* Returns true if the AssetController if 'SetupAssetUpdate' was called. Returns false if 'ResetAssetUpdate' was called or 'SetupAssetUpdate' has not been called.
-
checkForUpdates
void checkForUpdates()
Checks whether asset updates are available
-
updateAssets
void updateAssets()
Updates the assets, only after checkForUpdates was successfully called
-
cancelUpdate
void cancelUpdate()
Cancel an ongoing update
-
getAssetId
String getAssetId()
-
deleteLocalAssets
boolean deleteLocalAssets()
Delete the local assets
-
onAssetDownloadProgress
void onAssetDownloadProgress(String assetName, float progress)
-
onAssetUpdateAvailable
void onAssetUpdateAvailable(boolean updateAvailable)
-
onAssetUpdateError
void onAssetUpdateError(String error)
-
onAssetUpdateFinished
void onAssetUpdateFinished()
-
-
-
-