Skip to content
This repository has been archived by the owner on Dec 17, 2020. It is now read-only.

Version 1.0.0 RC-1

Compare
Choose a tag to compare
@Rolf-Smit 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 of onFinish(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 or TaskFragmentCompat) needed to have a tag in order for them to support a TaskManager instance through the getTaskManager() 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 legacy Fragment implementation.
  • The TaskManagerProvider has been renamed to TaskManagerOwner
    The TaskManagerProvider has been renamed to TaskManagerOwner 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 an IllegalStateException
    The Task.getLastKnownProgress() method returns null in version 1.x instead of throwing an IllegalStateException 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 call onDestory()
    In version 1.x onDestroy() has been added to the TaskManagerLifeCycleProxy class, classes using
    the TaskManagerLifeCycleProxy need to call this method. Adjust your code accordingly, because not doing so can lead to temporary memory leaks.