From 5e0f6f76740e3541397d40a6eddff99a2cb5fbe7 Mon Sep 17 00:00:00 2001 From: Farshad Date: Tue, 20 Aug 2019 23:47:07 +0430 Subject: [PATCH 01/10] README updated --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c62a646..631287e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create ## What Vita does: - Creates ViewModels with **Single Owner**: - This is the default ViewModel behavior that already have, The ViewModels created in this way are only available to the owner. + This is the default ViewModel behavior that already has, The ViewModels created in this way are only available to the owner.

@@ -28,7 +28,7 @@ As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create

- Creates ViewModels with **No Owner**: - The ViewModels has no owner, they are available in the application scope and stay alive until the user closes the application + The ViewModels have no owner, they are available in the application scope and stay alive until the user closes the application

From b02816df53e0834f56dd0fbaaa10f7d388c31592 Mon Sep 17 00:00:00 2001 From: Farshad Date: Wed, 21 Aug 2019 09:32:51 +0430 Subject: [PATCH 02/10] README updated --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 631287e..168d03e 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,10 @@ An extension for android ViewModel

+**Vita** is a light and simple library that helps you to share ViewModel between fragments and activities, even you can create ViewModels in application scope As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create ViewModels, when the owner is at the end of its lifecycle the ViewModel will be cleared as well, Sometimes you need to share the ViewModel between multiple owners, By default we can only share ViewModel of an activity between its fragments for now, nothing more... -**Vita** is a light and simple library that helps you to share ViewModel between fragments and activities, even you can create ViewModels in application scope - ## What Vita does: - Creates ViewModels with **Single Owner**: This is the default ViewModel behavior that already has, The ViewModels created in this way are only available to the owner. From 07e994191babc605ded1c0803a1f4ce5f5735438 Mon Sep 17 00:00:00 2001 From: Farshad Date: Wed, 21 Aug 2019 11:10:26 +0430 Subject: [PATCH 03/10] README updated --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 168d03e..277e8cb 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Also you can pass a function as factory like this: MyViewModelWithFactory(initData) }` +### Don't forget to give it a star if you liked it! ## License From be40355f0a30ff0d40fdfd5b7ff6f93397622326 Mon Sep 17 00:00:00 2001 From: Farshad Date: Thu, 22 Aug 2019 14:01:57 +0430 Subject: [PATCH 04/10] README updated --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 277e8cb..0948b51 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,15 @@ Make sure your project includes jcenter in its repositories and add this to buil ## How to use +First startVita in application class: + + class App : Application() { + override fun onCreate() { + super.onCreate() + startVita() + } + } + There is an extension value named **vita** that gives you access to a singleton object of Vita everywhere, Just pass your desired VitaOwner and get the ViewModel you want: `val myViewModel = vita.with(VitaOwner.Multiple(this)).getViewModel()` From 6b3b7adaad0913a6e8b8d9a931fefa17cc1b5f20 Mon Sep 17 00:00:00 2001 From: Farshad Date: Thu, 22 Aug 2019 14:02:47 +0430 Subject: [PATCH 05/10] README updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0948b51..0ce162f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Make sure your project includes jcenter in its repositories and add this to buil ## How to use -First startVita in application class: +First start **Vita** in application class: class App : Application() { override fun onCreate() { From 357f57c9d1caa1e1056811bc4c94bd7937eeee31 Mon Sep 17 00:00:00 2001 From: Farshad Date: Sat, 7 Sep 2019 10:34:55 +0430 Subject: [PATCH 06/10] README updated --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ce162f..c44199c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# Vita [ ![Download](https://api.bintray.com/packages/farshad-tmb/Vita/vita/images/download.svg) ](https://bintray.com/farshad-tmb/Vita/vita/_latestVersion) -An extension for android ViewModel +# Vita [ ![Download](https://api.bintray.com/packages/farshad-tmb/Vita/vita/images/download.svg) ](https://bintray.com/farshad-tmb/Vita/vita/_latestVersion) +***Share ViewModels EVERYWHERE !***

-**Vita** is a light and simple library that helps you to share ViewModel between fragments and activities, even you can create ViewModels in application scope +**Vita** is a light and simple library that helps you to share ViewModel between fragments and even activities! Also you can create ViewModels that are available all over the application! Cool, right!? As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create ViewModels, when the owner is at the end of its lifecycle the ViewModel will be cleared as well, Sometimes you need to share the ViewModel between multiple owners, By default we can only share ViewModel of an activity between its fragments for now, nothing more... From d565286b36defa36b03dbd09b7bd5183fe5c3732 Mon Sep 17 00:00:00 2001 From: Farshad Date: Sat, 7 Sep 2019 10:40:04 +0430 Subject: [PATCH 07/10] README updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c44199c..ef3f6ae 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Also you can pass a function as factory like this: MyViewModelWithFactory(initData) }` -### Don't forget to give it a star if you liked it! +### ⭐️ Don't forget to give it a star if you liked it! ## License From ca405c33157314eeb0a3e974ac914a2f750eb569 Mon Sep 17 00:00:00 2001 From: Farshad Date: Sun, 30 May 2021 21:59:22 +0430 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef3f6ae..d2aa20d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Vita [ ![Download](https://api.bintray.com/packages/farshad-tmb/Vita/vita/images/download.svg) ](https://bintray.com/farshad-tmb/Vita/vita/_latestVersion) +# Vita [ ![Download](https://img.shields.io/maven-central/v/com.androidisland.arch/vita.svg?label=Maven%20Central) ](https://bintray.com/farshad-tmb/Vita/vita/_latestVersion) ***Share ViewModels EVERYWHERE !***

From fe1aeaaf8c668c367e68927c34df9592f7d05e92 Mon Sep 17 00:00:00 2001 From: Farshad Date: Sun, 30 May 2021 22:13:26 +0430 Subject: [PATCH 09/10] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2aa20d..3f3683d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ -# Vita [ ![Download](https://img.shields.io/maven-central/v/com.androidisland.arch/vita.svg?label=Maven%20Central) ](https://bintray.com/farshad-tmb/Vita/vita/_latestVersion) -***Share ViewModels EVERYWHERE !*** +# Vita + +![Maven Central](https://img.shields.io/maven-central/v/com.androidisland.arch/vita.svg?label=Maven%20Central) +![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License) +

+ **Vita** is a light and simple library that helps you to share ViewModel between fragments and even activities! Also you can create ViewModels that are available all over the application! Cool, right!? As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create ViewModels, when the owner is at the end of its lifecycle the ViewModel will be cleared as well, Sometimes you need to share the ViewModel between multiple owners, By default we can only share ViewModel of an activity between its fragments for now, nothing more... From f45b32adbc1dbd520157309f53f2127636ea153c Mon Sep 17 00:00:00 2001 From: Farshad Date: Sun, 30 May 2021 22:33:43 +0430 Subject: [PATCH 10/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f3683d..bd630ef 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ As we know we need a LifeCycleOwner (e.g Fragment or FragmentActivity) to create Make sure your project includes jcenter in its repositories and add this to build.gradle in app module dependencies { - implementation 'com.androidisland.arch:vita:0.1.0' + implementation 'com.androidisland.arch:vita:$latest_version' } ## How to use