This repository has been archived by the owner on Dec 17, 2020. It is now read-only.
Version 1.0.0 RC-1
Rolf-Smit
released this
26 Jun 06:40
·
20 commits
to master
since this release
Whats new?
- Annotation support:
- Compile-time, almost zero run-time performance impact;
- 5 different annotations:
@TaskPreExecute
,@TaskPostExecute
,@TaskProgress
,@TaskCancel
and@TaskAttach
; - Supports automatic casting to the correct (
Task
) type:onFinish(MyTaskType task)
instead ofonFinish(Task<?, ?> task)
;
- Support for the LifecycleObserver class from the Android Architecture Lifecycle library;
- The minimum supported Android version has changed from API 8 to API 14;
- General bug-fixes and improvements;
See the updated documentation and sample app for more information on how to use the new annotations!
How to migrate?
If you are using Android-Retainable-Tasks version 0.x and you want to upgrade to version 1.x most things should just work fine, but 100% compatibility cannot be guaranteed, consider the following changes:
- Fragments no longer need tags in order for them to support a
TaskManager
Prior to version 1.x Fragments (TaskFragment
orTaskFragmentCompat
) needed to have a tag in order for them to support aTaskManager
instance through thegetTaskManager()
method. In version 1.x this is no longer necessary. This is however still necessary when you are not using the Android Support library, because of some important APIs that are missing from the legacyFragment
implementation. - The
TaskManagerProvider
has been renamed toTaskManagerOwner
TheTaskManagerProvider
has been renamed toTaskManagerOwner
so it's more inline with the naming used in the Android Architecture Lifecycle library, the old name can still be used but it's deprecated and will probably be removed in later versions. - The
Task.getLastKnownProgress()
method no longer throws anIllegalStateException
TheTask.getLastKnownProgress()
method returns null in version 1.x instead of throwing anIllegalStateException
when no progress is available yet, when upgrading check if no code relies
on this behaviour! - When using the
TaskManagerLifeCycleProxy
you now also need to callonDestory()
In version 1.xonDestroy()
has been added to theTaskManagerLifeCycleProxy
class, classes using
theTaskManagerLifeCycleProxy
need to call this method. Adjust your code accordingly, because not doing so can lead to temporary memory leaks.