Commit d310981e59cddbd64babb255399817acdc1f2e12
1 parent
9cd738be
Exists in
yxb_dev
and in
2 other branches
no message
Showing
17 changed files
with
233 additions
and
46 deletions
Show diff stats
.idea/gradle.xml
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | <option value="$PROJECT_DIR$" /> |
11 | 11 | <option value="$PROJECT_DIR$/app" /> |
12 | 12 | <option value="$PROJECT_DIR$/mvpsdk" /> |
13 | + <option value="$PROJECT_DIR$/roundedimageview-2.2.1" /> | |
13 | 14 | </set> |
14 | 15 | </option> |
15 | 16 | <option name="resolveModulePerSourceSet" value="false" /> | ... | ... |
app/build.gradle
... | ... | @@ -27,4 +27,5 @@ dependencies { |
27 | 27 | androidTestImplementation 'com.android.support.test:runner:1.0.1' |
28 | 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' |
29 | 29 | implementation project(':mvpsdk') |
30 | + implementation project(':roundedimageview-2.2.1') | |
30 | 31 | } | ... | ... |
app/src/main/AndroidManifest.xml
... | ... | @@ -10,14 +10,14 @@ |
10 | 10 | android:roundIcon="@mipmap/ic_launcher_round" |
11 | 11 | android:supportsRtl="true" |
12 | 12 | android:theme="@style/AppTheme"> |
13 | - <activity android:name=".ui.MainActivity"> | |
13 | + <activity android:name=".ui.activity.LoginAndRegistActivity"> | |
14 | 14 | <intent-filter> |
15 | 15 | <action android:name="android.intent.action.MAIN" /> |
16 | 16 | |
17 | 17 | <category android:name="android.intent.category.LAUNCHER" /> |
18 | 18 | </intent-filter> |
19 | 19 | </activity> |
20 | - <activity android:name=".ui.activity.LoginAndRegistActivity" /> | |
20 | + <!--<activity android:name=".ui.activity.LoginAndRegistActivity" />--> | |
21 | 21 | <activity android:name=".ui.activity.StartActivity"></activity> |
22 | 22 | </application> |
23 | 23 | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
... | ... | @@ -21,15 +21,6 @@ public interface LoginAndRegisterContract { |
21 | 21 | } |
22 | 22 | interface ILoginView extends IBaseFragment { |
23 | 23 | |
24 | - //显示网络错误 | |
25 | - void showNetworkError(); | |
26 | - | |
27 | - //显示加载更多错误 | |
28 | - void showLoadMoreError(); | |
29 | - | |
30 | - //显示没有更多数据 | |
31 | - void showNomoreData(); | |
32 | - | |
33 | 24 | //更新用户信息 |
34 | 25 | void getUserInfo(); |
35 | 26 | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
1 | 1 | package com.shunzhi.parent.presenter.loginandregister; |
2 | 2 | |
3 | +import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * Created by Administrator on 2018/3/6 0006. |
5 | 7 | */ |
6 | 8 | |
7 | -public class LoginAndRegisterPresenter { | |
9 | +public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPresenter { | |
10 | + @Override | |
11 | + public void loginResult(String loginName, String loginPwd) { | |
12 | + | |
13 | + } | |
14 | + | |
15 | + @Override | |
16 | + public void getUserInfo() { | |
17 | + | |
18 | + } | |
19 | + | |
20 | + @Override | |
21 | + public LoginAndRegisterContract.ILoginModel getModel() { | |
22 | + return null; | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public void onStart() { | |
27 | + | |
28 | + } | |
8 | 29 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/LoginAndRegistActivity.java
1 | 1 | package com.shunzhi.parent.ui.activity; |
2 | 2 | |
3 | 3 | import android.os.Bundle; |
4 | -import android.support.v4.app.FragmentTransaction; | |
5 | -import android.support.v7.app.AppCompatActivity; | |
6 | 4 | |
5 | +import com.share.mvpsdk.base.activity.BaseCompatActivity; | |
7 | 6 | import com.shunzhi.parent.R; |
8 | 7 | import com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment; |
9 | 8 | |
10 | -public class LoginAndRegistActivity extends AppCompatActivity { | |
11 | - | |
12 | - LoginAndRegistFragment loginAndRegistFragment = new LoginAndRegistFragment(); | |
13 | - FragmentTransaction ft; | |
9 | +import me.yokeyword.fragmentation.SupportFragment; | |
14 | 10 | |
11 | +public class LoginAndRegistActivity extends BaseCompatActivity { | |
15 | 12 | |
13 | + private SupportFragment[] mFragments = new SupportFragment[1]; | |
16 | 14 | @Override |
17 | - protected void onCreate(Bundle savedInstanceState) { | |
18 | - super.onCreate(savedInstanceState); | |
19 | - setContentView(R.layout.activity_regist); | |
20 | - initViews(); | |
15 | + protected void initView(Bundle savedInstanceState) { | |
16 | + if (savedInstanceState==null){ | |
17 | + mFragments[0]= LoginAndRegistFragment.getInstance(); | |
18 | + loadRootFragment(R.id.frame,mFragments[0]); | |
19 | + }else { | |
20 | + mFragments[0]=findFragment(LoginAndRegistFragment.class); | |
21 | + } | |
21 | 22 | } |
22 | 23 | |
23 | - private void initViews() { | |
24 | - ft = getSupportFragmentManager().beginTransaction(); | |
25 | - ft.add(R.id.frame, loginAndRegistFragment); | |
26 | - ft.commit(); | |
24 | + @Override | |
25 | + protected int getLayoutId() { | |
26 | + return R.layout.activity_regist; | |
27 | 27 | } |
28 | - | |
29 | 28 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
... | ... | @@ -9,26 +9,28 @@ import com.share.mvpsdk.base.BasePresenter; |
9 | 9 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
10 | 10 | import com.shunzhi.parent.R; |
11 | 11 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
12 | +import com.shunzhi.parent.presenter.loginandregister.LoginAndRegisterPresenter; | |
12 | 13 | |
13 | 14 | |
14 | -public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter,LoginAndRegisterContract.ILoginModel>{ | |
15 | +public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter,LoginAndRegisterContract.ILoginModel> | |
16 | +implements LoginAndRegisterContract.ILoginView{ | |
15 | 17 | |
16 | 18 | |
17 | -// public static LoginAndRegistFragment getInstance(){ | |
18 | -// LoginAndRegistFragment loginFragment=new LoginAndRegistFragment(); | |
19 | -// return loginFragment; | |
20 | -// } | |
19 | + public static LoginAndRegistFragment getInstance(){ | |
20 | + LoginAndRegistFragment loginFragment=new LoginAndRegistFragment(); | |
21 | + return loginFragment; | |
22 | + } | |
21 | 23 | |
22 | 24 | |
23 | 25 | @NonNull |
24 | 26 | @Override |
25 | 27 | public BasePresenter initPresenter() { |
26 | - return null; | |
28 | + return new LoginAndRegisterPresenter(); | |
27 | 29 | } |
28 | 30 | |
29 | 31 | @Override |
30 | 32 | public int getLayoutId() { |
31 | - return R.layout.activity_regist; | |
33 | + return R.layout.fragment_login_and_regist; | |
32 | 34 | } |
33 | 35 | |
34 | 36 | @Override |
... | ... | @@ -38,12 +40,8 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
38 | 40 | |
39 | 41 | |
40 | 42 | |
43 | + @Override | |
44 | + public void getUserInfo() { | |
41 | 45 | |
42 | -// @Override | |
43 | -// public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
44 | -// Bundle savedInstanceState) { | |
45 | -// // Inflate the layout for this fragment | |
46 | -// return inflater.inflate(R.layout.fragment_login_and_regist, container, false); | |
47 | -// } | |
48 | - | |
46 | + } | |
49 | 47 | } | ... | ... |
866 Bytes
1.65 KB
... | ... | @@ -0,0 +1,6 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + <stroke android:color="#00000000" android:width="1dp"/> | |
4 | + <solid android:color="#a4c4fd"/> | |
5 | + <corners android:radius="5dp"/> | |
6 | +</shape> | |
0 | 7 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,6 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + <stroke android:color="#b8b8b9" android:width="1dp"/> | |
4 | + <solid android:color="#00000000"/> | |
5 | + <corners android:radius="180dp"/> | |
6 | +</shape> | |
0 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_regist.xml
... | ... | @@ -5,5 +5,9 @@ |
5 | 5 | android:layout_width="match_parent" |
6 | 6 | android:layout_height="match_parent" |
7 | 7 | tools:context="com.shunzhi.parent.ui.activity.LoginAndRegistActivity"> |
8 | - | |
8 | +<FrameLayout | |
9 | + android:id="@+id/frame" | |
10 | + android:layout_width="match_parent" | |
11 | + android:layout_height="match_parent" | |
12 | + /> | |
9 | 13 | </android.support.constraint.ConstraintLayout> | ... | ... |
app/src/main/res/layout/fragment_login_and_regist.xml
1 | 1 | <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
2 | 3 | xmlns:tools="http://schemas.android.com/tools" |
3 | 4 | android:layout_width="match_parent" |
4 | 5 | android:layout_height="match_parent" |
5 | 6 | tools:context="com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment"> |
6 | 7 | |
7 | - <!-- TODO: Update blank fragment layout --> | |
8 | - <TextView | |
8 | + | |
9 | + <LinearLayout | |
9 | 10 | android:layout_width="match_parent" |
10 | 11 | android:layout_height="match_parent" |
11 | - android:text="@string/hello_blank_fragment" /> | |
12 | + android:orientation="vertical"> | |
13 | + | |
14 | + <com.makeramen.roundedimageview.RoundedImageView | |
15 | + android:layout_width="60dp" | |
16 | + android:layout_height="60dp" | |
17 | + android:layout_gravity="center" | |
18 | + android:layout_marginTop="100dp" | |
19 | + android:background="#a4c4fd" | |
20 | + app:riv_corner_radius_bottom_right="10dp" /> | |
21 | + | |
22 | + <LinearLayout | |
23 | + android:layout_width="match_parent" | |
24 | + android:layout_height="match_parent" | |
25 | + android:layout_marginLeft="40dp" | |
26 | + android:layout_marginRight="40dp" | |
27 | + android:layout_marginTop="30dp" | |
28 | + android:orientation="vertical"> | |
29 | + | |
30 | + <LinearLayout | |
31 | + android:layout_width="match_parent" | |
32 | + android:layout_height="wrap_content" | |
33 | + android:orientation="vertical"> | |
34 | + | |
35 | + <EditText | |
36 | + android:layout_width="match_parent" | |
37 | + android:layout_height="50dp" | |
38 | + android:background="@null" | |
39 | + android:hint="请输入手机号码" | |
40 | + android:textColorHint="@color/hintTextColor" | |
41 | + android:textSize="@dimen/sp_16" /> | |
42 | + | |
43 | + <TextView | |
44 | + android:layout_width="match_parent" | |
45 | + android:layout_height="1dp" | |
46 | + android:background="@color/bottomline" /> | |
47 | + </LinearLayout> | |
48 | + | |
49 | + <LinearLayout | |
50 | + android:layout_width="match_parent" | |
51 | + android:layout_height="wrap_content" | |
52 | + android:orientation="vertical"> | |
53 | + | |
54 | + <LinearLayout | |
55 | + android:layout_width="match_parent" | |
56 | + android:layout_height="wrap_content"> | |
57 | + | |
58 | + <EditText | |
59 | + android:layout_width="wrap_content" | |
60 | + android:layout_height="50dp" | |
61 | + android:layout_weight="1" | |
62 | + android:background="@null" | |
63 | + android:hint="请输入验证码" | |
64 | + android:textColorHint="@color/hintTextColor" | |
65 | + android:textSize="@dimen/sp_16" /> | |
66 | + | |
67 | + <TextView | |
68 | + android:layout_width="wrap_content" | |
69 | + android:layout_height="wrap_content" | |
70 | + android:background="@drawable/rudiobtn2" | |
71 | + android:paddingBottom="5dp" | |
72 | + android:paddingLeft="15dp" | |
73 | + android:paddingRight="15dp" | |
74 | + android:paddingTop="5dp" | |
75 | + android:text="获取" | |
76 | + android:textColor="@color/hintTextColor" | |
77 | + android:textSize="@dimen/sp_16" | |
78 | + | |
79 | + /> | |
80 | + | |
81 | + </LinearLayout> | |
82 | + | |
83 | + <TextView | |
84 | + android:layout_width="match_parent" | |
85 | + android:layout_height="1dp" | |
86 | + android:background="@color/bottomline" /> | |
87 | + | |
88 | + </LinearLayout> | |
89 | + | |
90 | + <LinearLayout | |
91 | + android:layout_width="match_parent" | |
92 | + android:layout_height="wrap_content" | |
93 | + android:orientation="vertical"> | |
94 | + | |
95 | + <LinearLayout | |
96 | + android:layout_width="match_parent" | |
97 | + android:layout_height="wrap_content"> | |
98 | + | |
99 | + <EditText | |
100 | + android:layout_width="wrap_content" | |
101 | + android:layout_height="50dp" | |
102 | + android:layout_weight="1" | |
103 | + android:background="@null" | |
104 | + android:hint="请设置密码:6~8个字符" | |
105 | + android:textColorHint="@color/hintTextColor" | |
106 | + android:textSize="@dimen/sp_16" /> | |
107 | + | |
108 | + <ImageView | |
109 | + android:layout_width="wrap_content" | |
110 | + android:layout_height="match_parent" | |
111 | + android:layout_gravity="center" | |
112 | + android:layout_marginRight="10dp" | |
113 | + android:src="@drawable/eye_close" /> | |
114 | + | |
115 | + </LinearLayout> | |
116 | + | |
117 | + <TextView | |
118 | + android:layout_width="match_parent" | |
119 | + android:layout_height="1dp" | |
120 | + android:background="@color/bottomline" /> | |
121 | + | |
122 | + </LinearLayout> | |
123 | + | |
124 | + <TextView | |
125 | + android:layout_width="match_parent" | |
126 | + android:layout_height="wrap_content" | |
127 | + android:layout_marginTop="40dp" | |
128 | + android:background="@drawable/rudiobtn" | |
129 | + android:gravity="center" | |
130 | + android:paddingBottom="10dp" | |
131 | + android:paddingTop="10dp" | |
132 | + android:text="注册" | |
133 | + android:textColor="@color/white" | |
134 | + android:textSize="@dimen/sp_16" /> | |
135 | + | |
136 | + <LinearLayout | |
137 | + android:layout_marginTop="30dp" | |
138 | + android:layout_width="match_parent" | |
139 | + android:layout_height="wrap_content" | |
140 | + android:orientation="horizontal" | |
141 | + android:gravity="center" | |
142 | + > | |
143 | + <TextView | |
144 | + android:layout_width="wrap_content" | |
145 | + android:layout_height="wrap_content" | |
146 | + android:textSize="@dimen/sp_16" | |
147 | + android:textColor="@color/hintTextColor" | |
148 | + android:text="已注册,直接登录" | |
149 | + /> | |
150 | + <TextView | |
151 | + android:layout_marginLeft="20dp" | |
152 | + android:layout_width="wrap_content" | |
153 | + android:layout_height="wrap_content" | |
154 | + android:text="登录" | |
155 | + android:textColor="#acc9fc" | |
156 | + android:textSize="@dimen/sp_16" | |
157 | + /> | |
158 | + | |
159 | + </LinearLayout> | |
160 | + | |
161 | + | |
162 | + </LinearLayout> | |
163 | + | |
164 | + </LinearLayout> | |
12 | 165 | |
13 | 166 | </FrameLayout> | ... | ... |
app/src/main/res/values/colors.xml
No preview for this file type
settings.gradle