-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMainActivity.java
55 lines (45 loc) · 1.36 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
package com.d.slidelayout;
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.slidelayout.activity.ListActivity;
import com.d.slidelayout.activity.SimpleActivity;
public class MainActivity extends BaseActivity<MvpBasePresenter>
implements View.OnClickListener {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_simple:
startActivity(new Intent(MainActivity.this, SimpleActivity.class));
break;
case R.id.btn_list:
startActivity(new Intent(MainActivity.this, ListActivity.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_simple,
R.id.btn_list
);
}
@Override
protected void init() {
}
}