Skip to content

Commit 5454d06

Browse files
author
Daniel Novak
committed
Update README and CHANGELONG
1 parent 54a7d1a commit 5454d06

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.3.2(2015-05-18)
2+
3+
Breaking changes:
4+
5+
- Add setModelView() method which has to be called in every Fragment/Activity after the view was initialized. This is usually on the end of onCreate / onViewCreated - [commit](https://github.com/inloop/AndroidViewModel/commit/54a7d1a96d38d1a17c8bc7c81b081d52064bde28)
6+
17
## 0.3.1(2015-05-14)
28

39
Bugfixes:

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,28 @@ How to implement
3030
```
3131
3. Each <b>Fragment</b> or <b>Activity</b> that you would like to associate with a ViewModel will need either to extend [ViewModelActivityBase](library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseActivity.java)/[ViewModelBaseFragment](library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseFragment.java) or copy the implementation from these classes to your base activity/fragment class (in case you can't inherit directly). Override ```getViewModelClass()``` to return the corresponding ViewModel class. For example: <br/>
3232

33-
```java
34-
public class UserListFragment extends ViewModelBaseFragment<IUserListView, UserListViewModel>
33+
```java
34+
public class UserListFragment extends ViewModelBaseFragment<IUserListView, UserListViewModel>
3535
implements IUserListView {
3636

3737
@Override
3838
public Class<UserListViewModel> getViewModelClass() {
3939
return UserListViewModel.class;
4040
}
4141

42-
}
43-
```
42+
}
43+
```
44+
45+
4. Also each <b>Fragment</b> or <b>Activity</b> has to call ```setModelView()``` after the View (Fragment/Activity) was created and initialized. This is usually on the end of onViewCreated (or onCreate in case of an Activity) <br/>
46+
47+
```java
48+
@Override
49+
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
50+
super.onViewCreated(view, savedInstanceState);
51+
ButterKnife.inject(this, view);
52+
setModelView(this);
53+
}
54+
```
4455

4556
How to use
4657
--------
@@ -95,14 +106,14 @@ Download
95106

96107
Grab via Gradle:
97108
```groovy
98-
compile 'eu.inloop:androidviewmodel:0.3'
109+
compile 'eu.inloop:androidviewmodel:0.3.2'
99110
```
100111
or Maven:
101112
```xml
102113
<dependency>
103114
<groupId>eu.inloop</groupId>
104115
<artifactId>androidviewmodel</artifactId>
105-
<version>0.3</version>
116+
<version>0.3.2</version>
106117
</dependency>
107118
```
108119
Build and study sample application from source code or download from Google Play.<br/>

sample/src/main/java/eu/inloop/viewmodel/sample/fragment/SampleBundleFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.view.View;
88
import android.view.ViewGroup;
99

10+
import butterknife.ButterKnife;
1011
import eu.inloop.viewmodel.IView;
1112
import eu.inloop.viewmodel.base.ViewModelBaseFragment;
1213
import eu.inloop.viewmodel.sample.R;
@@ -32,6 +33,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
3233
@Override
3334
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
3435
super.onViewCreated(view, savedInstanceState);
36+
ButterKnife.inject(this, view);
3537
setModelView(this);
3638
}
3739

0 commit comments

Comments
 (0)