-
Notifications
You must be signed in to change notification settings - Fork 8
/
MainActivity.java
81 lines (66 loc) · 2.37 KB
/
MainActivity.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.d.pulllayout;
import android.content.Intent;
import android.view.View;
import com.d.lib.common.component.mvp.MvpBasePresenter;
import com.d.lib.common.component.mvp.MvpView;
import com.d.lib.common.component.mvp.app.BaseActivity;
import com.d.lib.common.util.ViewHelper;
import com.d.pulllayout.edge.EdgeListActivity;
import com.d.pulllayout.list.activity.CoordinatorTabActivity;
import com.d.pulllayout.list.activity.ListActivity;
import com.d.pulllayout.pull.activity.PullActivity;
public class MainActivity extends BaseActivity<MvpBasePresenter>
implements View.OnClickListener {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_pull:
startActivity(new Intent(MainActivity.this, PullActivity.class));
break;
case R.id.btn_edge:
startActivity(new Intent(MainActivity.this, EdgeListActivity.class));
break;
case R.id.btn_simple:
ListActivity.openActivity(mActivity, ListActivity.TYPE_SIMPLE);
break;
case R.id.btn_multiple:
ListActivity.openActivity(mActivity, ListActivity.TYPE_MULTIPLE);
break;
case R.id.btn_item_touch:
ListActivity.openActivity(mActivity, ListActivity.TYPE_ITEM_TOUCH);
break;
case R.id.btn_coordinator_list:
ListActivity.openActivity(mActivity, ListActivity.TYPE_COORDINATOR_LIST);
break;
case R.id.btn_coordinator_tab:
startActivity(new Intent(MainActivity.this, CoordinatorTabActivity.class));
break;
}
}
@Override
protected int getLayoutRes() {
return R.layout.activity_main;
}
@Override
public MvpBasePresenter getPresenter() {
return new MvpBasePresenter(getApplicationContext());
}
@Override
protected MvpView getMvpView() {
return this;
}
@Override
protected void bindView() {
ViewHelper.setOnClickListener(this, this,
R.id.btn_pull,
R.id.btn_edge,
R.id.btn_simple,
R.id.btn_multiple,
R.id.btn_item_touch,
R.id.btn_coordinator_list,
R.id.btn_coordinator_tab);
}
@Override
protected void init() {
}
}