Skip to content

Commit 65396a0

Browse files
author
Daniel Novak
committed
Rename initWithView to bindView
1 parent 9b3b82f commit 65396a0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/src/main/java/eu/inloop/viewmodel/AbstractViewModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public String getUniqueIdentifier() {
3030
}
3131

3232
/**
33+
* Called when the ViewModel instance is created.
3334
* @param arguments initial ViewModel arguments passed from {@link Fragment#getArguments()} or
3435
* {@link Activity#getIntent()}.{@link Intent#getExtras()}
3536
* @param savedInstanceState bundle with saved state, will be not null
@@ -41,7 +42,7 @@ public void onCreate(@Nullable Bundle arguments, @Nullable Bundle savedInstanceS
4142

4243
}
4344

44-
public void initWithView(@NonNull T view) {
45+
public void bindView(@NonNull T view) {
4546
mView = view;
4647
}
4748

library/src/main/java/eu/inloop/viewmodel/ViewModelHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import android.util.Log;
1010

1111
import java.util.UUID;
12-
import java.util.concurrent.atomic.AtomicInteger;
1312

1413
public class ViewModelHelper<T extends IView, R extends AbstractViewModel<T>> {
1514

@@ -68,7 +67,7 @@ public void initWithView(@NonNull T view) {
6867
//no viewmodel for this fragment
6968
return;
7069
}
71-
mViewModel.initWithView(view);
70+
mViewModel.bindView(view);
7271
}
7372

7473
/**

sample/src/main/java/eu/inloop/viewmodel/sample/viewmodel/UserListViewModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public void onCreate(@Nullable Bundle arguments, @Nullable Bundle savedInstanceS
3232
}
3333

3434
@Override
35-
public void initWithView(@NonNull IUserListView view) {
36-
super.initWithView(view);
35+
public void bindView(@NonNull IUserListView view) {
36+
super.bindView(view);
3737

3838
//downloading list of users
3939
if (mLoadedUsers != null) {

0 commit comments

Comments
 (0)