-
- All Implemented Interfaces:
-
app.rive.runtime.kotlin.core.RefCount
public final class FallbackAssetLoader extends FileAssetLoader
The default asset loader used by RiveAnimationView when loading assets. This allows for setting up cascading asset loaders which may be useful when each represents a different source or policy, e.g. a memory cache, local storage, and network.
-
-
Field Summary
Fields Modifier and Type Field Description private final <ERROR CLASS>loadersprivate final BooleanhasCppObjectprivate AtomicIntegerrefsprivate LongcppPointerprivate final List<RefCount>dependenciesprivate final IntegerrefCount
-
Constructor Summary
Constructors Constructor Description FallbackAssetLoader(Context context, Boolean loadCDNAssets, FileAssetLoader loader)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>getLoaders()final BooleangetHasCppObject()final AtomicIntegergetRefs()final UnitsetRefs(AtomicInteger refs)final LonggetCppPointer()final UnitsetCppPointer(Long cppPointer)final List<RefCount>getDependencies()IntegergetRefCount()final UnitappendLoader(FileAssetLoader loader)Add a FileAssetLoader to the end of the list of loaders, i.e. final UnitprependLoader(FileAssetLoader loader)Add a FileAssetLoader to the start of the list of loaders, i.e. <ERROR CLASS>loadContents(FileAsset asset, ByteArray inBandBytes)Attempts to load the asset using each loader in order until one succeeds or all refuse. -
Methods inherited from class app.rive.runtime.kotlin.core.FallbackAssetLoader
acquire, cppDelete, cppRef, setRendererType -
Methods inherited from class app.rive.runtime.kotlin.core.FileAssetLoader
release -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FallbackAssetLoader
FallbackAssetLoader(Context context, Boolean loadCDNAssets, FileAssetLoader loader)
- Parameters:
context- The application context.loadCDNAssets- Whether to load assets from Rive's CDN.loader- An optional initial FileAssetLoader to add to the list of loaders.
-
-
Method Detail
-
getLoaders
final <ERROR CLASS> getLoaders()
-
getHasCppObject
final Boolean getHasCppObject()
-
getRefs
final AtomicInteger getRefs()
-
setRefs
final Unit setRefs(AtomicInteger refs)
-
getCppPointer
final Long getCppPointer()
-
setCppPointer
final Unit setCppPointer(Long cppPointer)
-
getDependencies
final List<RefCount> getDependencies()
-
getRefCount
Integer getRefCount()
-
appendLoader
final Unit appendLoader(FileAssetLoader loader)
Add a FileAssetLoader to the end of the list of loaders, i.e. lowest priority. Note that if the constructor parameter loadCDNAssets is true (default) a CDNAssetLoader will be the current last loader, and this will be added after it.
- Parameters:
loader- The FileAssetLoader to add.
-
prependLoader
final Unit prependLoader(FileAssetLoader loader)
Add a FileAssetLoader to the start of the list of loaders, i.e. highest priority.
- Parameters:
loader- The FileAssetLoader to add.
-
loadContents
<ERROR CLASS> loadContents(FileAsset asset, ByteArray inBandBytes)
Attempts to load the asset using each loader in order until one succeeds or all refuse.
- Parameters:
asset- The FileAsset being loaded.inBandBytes- The embedded bytes that were included in the Rive file.
-
-
-
-