@LevelUpApi(contract=PUBLIC) public final class AsyncTaskCodeLoader extends LevelUpCodeLoader
LevelUpQrCodeGenerator.LevelUpQrCodeImage
s using AsyncTask
s.Constructor and Description |
---|
AsyncTaskCodeLoader(LevelUpQrCodeGenerator qrCodeGenerator,
LevelUpCodeCache codeCache) |
Modifier and Type | Method and Description |
---|---|
protected void |
onCancelLoad(String loadKey)
Implement this to handle any load cancellation.
|
void |
onCancelLoads()
Cancel all loads.
|
protected void |
onStartLoadInBackground(String qrCodeContents,
String key,
PendingImage.OnImageLoaded<LevelUpQrCodeGenerator.LevelUpQrCodeImage> onImageLoaded)
Implement this to start the loading of the given QR code into an image in the background.
|
cancelLoad, cancelLoads, dispatchOnImageLoaded, generateQrCode, getCodeCache, getKey, getLevelUpCode, getQrCodeGenerator, loadLevelUpCode, registerOnImageLoadedCallback, startLoadInBackground, unregisterOnImageLoadedCallback
public AsyncTaskCodeLoader(LevelUpQrCodeGenerator qrCodeGenerator, LevelUpCodeCache codeCache)
qrCodeGenerator
- the LevelUpQrCodeGenerator
used in this loader.codeCache
- the LevelUpCodeCache
to store the generated QR codes.public void onCancelLoads()
LevelUpCodeLoader
onCancelLoads
in class LevelUpCodeLoader
protected void onCancelLoad(String loadKey)
LevelUpCodeLoader
onCancelLoad
in class LevelUpCodeLoader
loadKey
- the key under which the QR code is tracked.protected void onStartLoadInBackground(String qrCodeContents, String key, PendingImage.OnImageLoaded<LevelUpQrCodeGenerator.LevelUpQrCodeImage> onImageLoaded)
LevelUpCodeLoader
Implement this to start the loading of the given QR code into an image in the background. If an existing request for the same content has been made, the second request will be dropped unless the previous request has been cancelled. This must be called on the main thread.
Subclasses shouldn't call this method directly, instead call
LevelUpCodeLoader.startLoadInBackground(String, String,
com.scvngr.levelup.core.ui.view.PendingImage.OnImageLoaded)
)}.
onStartLoadInBackground
in class LevelUpCodeLoader
qrCodeContents
- the contents to render into a QR code.key
- the key under which the QR code is tracked.onImageLoaded
- called when the image has been loaded.