doum
6 天以前 2b287056e2f59518888d05a1bbc7e5a55fbd84d5
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.doumee.lib_coremodel.base;
 
import android.os.Bundle;
 
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModel;
 
/**
 * 用来规范{@link BaseActivity} 和{@link BaseFragment} 风格。
 * @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
 */
public interface IView<VM extends ViewModel> {
 
    /**
     * 根布局id
     * @return
     */
    @LayoutRes
    int getLayoutId();
 
    /**
     * 初始化UI
     * @param savedInstanceState
     */
    void initView(@Nullable Bundle savedInstanceState);
 
    /**
     * 初始化数据
     * @param savedInstanceState
     */
    void initData(@Nullable Bundle savedInstanceState);
 
    /**
     * 是否使用DataBinding
     * @return
     */
    boolean isBinding();
 
    /**
     * 创建ViewModel
     * @return
     */
    VM createViewModel();
 
}