Skip to content

Commit 689cbe8

Browse files
author
jhonjson
committed
登陆注册成功
1 parent 6a8583d commit 689cbe8

24 files changed

Lines changed: 148 additions & 837 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ dependencies {
8585
implementation project(':module_news')
8686
//我的模块
8787
implementation project(':module_me')
88+
//登陆模块
89+
implementation project(':module_login')
8890

8991
}
9092
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:supportsRtl="true"
1313
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
1414
tools:ignore="GoogleAppIndexingWarning">
15-
<activity android:name="com.play.module_main.activity.SplashActivity">
15+
<activity android:name="com.play.module_login.activity.SplashActivity">
1616
<intent-filter>
1717
<action android:name="android.intent.action.MAIN" />
1818

library_base/src/main/java/com/play/library_base/moduleinterface/IModuleMaster.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

library_base/src/main/java/com/play/library_base/moduleinterface/ModuleMaster.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

library_base/src/main/java/com/play/library_base/moduleinterface/ModuleNativeModule.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

library_base/src/main/java/com/play/library_base/router/RouterActivityPath.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public static class Login {
2424
private static final String LOGIN = "/login";
2525
/*登陆业务界面*/
2626
public static final String PAGER_LOGIN = LOGIN +"/login";
27+
28+
/*注册业务界面*/
29+
public static final String PAGER_REGISTER = LOGIN +"/Register";
2730
}
2831

2932
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
package com.play.module_login.activity;
2+
3+
import android.view.View;
4+
import android.widget.TextView;
5+
6+
import com.alibaba.android.arouter.facade.annotation.Autowired;
7+
import com.alibaba.android.arouter.facade.annotation.Route;
8+
import com.alibaba.android.arouter.launcher.ARouter;
9+
import com.play.library_base.base.BaseAppManager;
10+
import com.play.library_base.router.RouterActivityPath;
11+
import com.play.library_base.utils.SharePreUtils;
12+
import com.play.library_base.utils.ToastUtils;
13+
import com.play.library_base.view.ClearEditText;
14+
import com.play.library_mvp.base.common.BaseActivity;
15+
import com.play.module_login.R;
16+
import com.play.module_login.bean.LoginBean;
17+
import com.play.module_login.bean.RegisterBean;
18+
import com.play.module_login.contract.LoginContract;
19+
import com.play.module_login.presenter.LoginPresenter;
20+
21+
/**
22+
* @author:jhonjson
23+
* @data:2019/6/28 下午16:40
24+
* @描述: 登陆
25+
*/
26+
@Route(path = RouterActivityPath.Login.PAGER_REGISTER)
27+
public class RegisterActivity extends BaseActivity<LoginContract.View, LoginContract.Presenter> implements
28+
LoginContract.View, View.OnClickListener {
29+
30+
@Autowired(name = "title")
31+
String title;
32+
private ClearEditText cetName1, cetPsd1, cetPsd2;
33+
private TextView tvRegister;
34+
35+
@Override
36+
public int getLayoutId() {
37+
return R.layout.activity_register;
38+
}
39+
40+
@Override
41+
public LoginContract.Presenter createPresenter() {
42+
return new LoginPresenter(this);
43+
}
44+
45+
@Override
46+
public LoginContract.View createView() {
47+
return this;
48+
}
49+
50+
@Override
51+
public void init() {
52+
cetName1 = findViewById(R.id.cetName1);
53+
cetPsd2 = findViewById(R.id.cetPsd2);
54+
cetPsd1 = findViewById(R.id.cetPsd1);
55+
tvRegister = findViewById(R.id.tvLogin1);
56+
57+
tvRegister.setOnClickListener(View -> {
58+
getPresenter().register(cetName1.getText().toString(), cetPsd1.getText().toString(), cetPsd2.getText().toString());
59+
});
60+
61+
}
62+
63+
@Override
64+
public boolean isOpenImmersive() {
65+
return true;
66+
}
67+
68+
@Override
69+
public void showLoading() {
70+
71+
}
72+
73+
@Override
74+
public void hideLoading() {
75+
76+
}
77+
78+
@Override
79+
public void backRegisterSuc(RegisterBean mRegisterBean) {
80+
SharePreUtils.setInteger("userid", mRegisterBean.getId());
81+
ARouter.getInstance().build(RouterActivityPath.Main.PAGER_MAIN)
82+
.navigation();
83+
BaseAppManager.getAppManager().finishActivity(LoginActivity.class);
84+
finish();
85+
}
86+
87+
@Override
88+
public void backLoginSuc(LoginBean mLoginBean) {
89+
ARouter.getInstance().build(RouterActivityPath.Main.PAGER_MAIN)
90+
.navigation();
91+
finish();
92+
}
93+
94+
@Override
95+
public void backRegisterFail(String msg) {
96+
ToastUtils.showToast(this, msg);
97+
98+
}
99+
100+
@Override
101+
public void backLoginFail(String msg) {
102+
ToastUtils.showToast(this, msg);
103+
}
104+
105+
@Override
106+
public void onClick(View v) {
107+
int id = v.getId();
108+
// if (R.id.tvLogin == id) {
109+
// getPresenter().login("jhonjson", "qs110134");
110+
// }
111+
}
112+
}

module_main/src/main/res/layout/activity_login.xml renamed to module_login/src/main/res/layout/activity_register.xml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
android:orientation="vertical"
77
tools:ignore="ResourceName">
88

9+
910
<ImageView
1011
android:id="@+id/ivPic"
1112
android:layout_width="wrap_content"
@@ -15,38 +16,48 @@
1516
android:src="@mipmap/ic_launcher" />
1617

1718
<com.play.library_base.view.ClearEditText
18-
android:id="@+id/cetName"
19+
android:id="@+id/cetName1"
1920
android:layout_width="match_parent"
2021
android:layout_height="wrap_content"
2122
android:layout_below="@+id/ivPic"
22-
android:hint="请输入账号"
2323
android:layout_marginLeft="@dimen/dimen_20_dp"
24-
android:layout_marginTop="@dimen/dimen_48_dp"
25-
android:layout_marginRight="@dimen/dimen_20_dp" />
24+
android:layout_marginTop="48dp"
25+
android:layout_marginRight="@dimen/dimen_20_dp"
26+
android:hint="请输入账号" />
27+
2628

29+
<com.play.library_base.view.ClearEditText
30+
android:id="@+id/cetPsd1"
31+
android:layout_width="match_parent"
32+
android:layout_height="wrap_content"
33+
android:layout_below="@+id/cetName1"
34+
android:layout_marginLeft="@dimen/dimen_20_dp"
35+
android:layout_marginTop="@dimen/dimen_20_dp"
36+
android:layout_marginRight="@dimen/dimen_20_dp"
37+
android:hint="请输入密码" />
2738

2839
<com.play.library_base.view.ClearEditText
29-
android:id="@+id/cetPsd"
40+
android:id="@+id/cetPsd2"
3041
android:layout_width="match_parent"
3142
android:layout_height="wrap_content"
32-
android:layout_below="@+id/cetName"
33-
android:hint="请输入密码"
43+
android:layout_below="@+id/cetPsd1"
3444
android:layout_marginLeft="@dimen/dimen_20_dp"
3545
android:layout_marginTop="@dimen/dimen_20_dp"
36-
android:layout_marginRight="@dimen/dimen_20_dp" />
46+
android:layout_marginRight="@dimen/dimen_20_dp"
47+
android:hint="请再次输入密码" />
3748

3849
<TextView
39-
android:id="@+id/tvLogin"
50+
android:id="@+id/tvLogin1"
4051
android:layout_width="match_parent"
4152
android:layout_height="40dp"
42-
android:layout_below="@+id/cetPsd"
43-
android:text="登录"
44-
android:gravity="center"
45-
android:textSize="18dp"
53+
android:layout_below="@+id/cetPsd2"
4654
android:layout_marginLeft="@dimen/dimen_20_dp"
4755
android:layout_marginTop="40dp"
4856
android:layout_marginRight="@dimen/dimen_20_dp"
49-
android:background="#6DD6DE" />
57+
android:background="#6DD6DE"
58+
android:gravity="center"
59+
android:text="注册"
60+
android:textSize="18dp" />
5061

5162

5263
</RelativeLayout>

module_main/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<application>
66
<!--在自己组件中注册Activity-->
77
<activity android:name=".activity.MainActivity"/>
8-
<activity android:name=".activity.LoginActivity"/>
98
</application>
109

1110
</manifest>

0 commit comments

Comments
 (0)