-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathIView.java
31 lines (27 loc) · 1.17 KB
/
IView.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package eu.inloop.viewmodel;
import android.app.Activity;
import android.support.annotation.Nullable;
import eu.inloop.viewmodel.base.ViewModelBaseActivity;
import eu.inloop.viewmodel.base.ViewModelBaseFragment;
import eu.inloop.viewmodel.binding.ViewModelBindingConfig;
/**
* Any Activity or Fragment that needs a ViewModel needs to implement this interface.
* You don't need to implement it yourself - use {@link ViewModelBaseActivity} and
* {@link ViewModelBaseFragment} instead.
*/
public interface IView {
/**
* This method is used for Data Binding to bind correct layout and variable automatically
* Can return null value in case that Data Binding is not used.
*
* @return defined ViewModelBinding Config for a specific screen.
*/
@Nullable
ViewModelBindingConfig getViewModelBindingConfig();
/**
* Implement this method to remove the ViewModel associated with the Fragment or Activity.
* This is usually implemented by calling {@link ViewModelHelper#removeViewModel(Activity)},
* see {@link ViewModelBaseActivity#removeViewModel()} and {@link ViewModelBaseFragment#removeViewModel()}.
*/
void removeViewModel();
}