diff --git a/app/build.gradle b/app/build.gradle
index 5adc89f..debf2a4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -20,6 +20,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
+ sourceSets {
+ main {
+ res {
+ srcDirs 'src/main/res', 'src/main/res/layout/resetpwd', 'src/main/res/layout/resetpwd/layout'
+ }
+ }
+ }
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index fcf330f..4ef0eaf 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -10,7 +10,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">
-
+
diff --git a/app/src/main/java/com/community/pocket/ui/BaseFragment.java b/app/src/main/java/com/community/pocket/ui/BaseFragment.java
new file mode 100644
index 0000000..5c8c5b4
--- /dev/null
+++ b/app/src/main/java/com/community/pocket/ui/BaseFragment.java
@@ -0,0 +1,20 @@
+package com.community.pocket.ui;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import org.xutils.x;
+
+public abstract class BaseFragment extends Fragment {
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return x.view().inject(this, inflater, container);//fragment注解
+ }
+}
diff --git a/app/src/main/java/com/community/pocket/ui/login/LoginActivity.java b/app/src/main/java/com/community/pocket/ui/login/LoginActivity.java
index 525a69b..cc6d552 100644
--- a/app/src/main/java/com/community/pocket/ui/login/LoginActivity.java
+++ b/app/src/main/java/com/community/pocket/ui/login/LoginActivity.java
@@ -22,6 +22,7 @@ import androidx.lifecycle.ViewModelProvider;
import com.community.pocket.R;
import com.community.pocket.ui.BaseActivity;
import com.community.pocket.ui.register.RegisterActivity;
+import com.community.pocket.ui.resetpwd.ResetPwdActivity;
import com.community.pocket.util.PropertiesUtil;
import org.xutils.view.annotation.ContentView;
@@ -46,7 +47,7 @@ public class LoginActivity extends BaseActivity {
private EditText passwordEditText;
//登录按钮
- @ViewInject(R.id.login)
+ @ViewInject(R.id.back)
private Button loginButton;
//进度条
@@ -123,7 +124,7 @@ public class LoginActivity extends BaseActivity {
}
//登录按钮触发登录请求操作
- @Event(value = R.id.login)
+ @Event(value = R.id.back)
private void login(View v) {
//显示登录请求处理进度
loadingProgressBar.setVisibility(View.VISIBLE);
@@ -148,6 +149,11 @@ public class LoginActivity extends BaseActivity {
return false;
}
+ @Event(value = R.id.login_to_resetPwd)
+ private void resetRwd(View v) {
+ startActivity(new Intent(this, ResetPwdActivity.class));
+ }
+
//登陆成功信息
private void updateUiWithUser(LoggedInUserView model) {
String welcome = getString(R.string.welcome) + model.getDisplayName();
diff --git a/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdActivity.java b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdActivity.java
new file mode 100644
index 0000000..6c839ff
--- /dev/null
+++ b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdActivity.java
@@ -0,0 +1,11 @@
+package com.community.pocket.ui.resetpwd;
+
+import com.community.pocket.R;
+import com.community.pocket.ui.BaseActivity;
+
+import org.xutils.view.annotation.ContentView;
+
+@ContentView(R.layout.activity)
+public class ResetPwdActivity extends BaseActivity {
+
+}
diff --git a/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep1.java b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep1.java
new file mode 100644
index 0000000..ef83c06
--- /dev/null
+++ b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep1.java
@@ -0,0 +1,29 @@
+package com.community.pocket.ui.resetpwd;
+
+import android.content.Intent;
+import android.view.View;
+
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.community.pocket.R;
+import com.community.pocket.ui.BaseFragment;
+import com.community.pocket.ui.login.LoginActivity;
+
+import org.xutils.view.annotation.ContentView;
+import org.xutils.view.annotation.Event;
+
+@ContentView(R.layout.step1)
+public class ResetPwdStep1 extends BaseFragment {
+ //进入下一步发送验证码
+ @Event(value = R.id.next)
+ private void onClick(View view) {
+ NavHostFragment.findNavController(ResetPwdStep1.this)
+ .navigate(R.id.action_First2Fragment_to_Second2Fragment);
+ }
+
+ //返回登陆
+ @Event(value = R.id.back)
+ private void back(View view) {
+ startActivity(new Intent(getContext(), LoginActivity.class));
+ }
+}
diff --git a/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep2.java b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep2.java
new file mode 100644
index 0000000..fb7758c
--- /dev/null
+++ b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep2.java
@@ -0,0 +1,42 @@
+package com.community.pocket.ui.resetpwd;
+
+import android.view.View;
+import android.widget.Toast;
+
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.community.pocket.R;
+import com.community.pocket.ui.BaseFragment;
+
+import org.xutils.view.annotation.ContentView;
+import org.xutils.view.annotation.Event;
+
+@ContentView(R.layout.step2)
+public class ResetPwdStep2 extends BaseFragment {
+
+ /**
+ * 返回第一步输入账号邮箱
+ */
+ @Event(value = R.id.back)
+ private void onClick(View view) {
+ NavHostFragment.findNavController(ResetPwdStep2.this)
+ .navigate(R.id.action_Second2Fragment_to_First2Fragment);
+ }
+
+ /**
+ * 进入下一步重置密码
+ */
+ @Event(value = R.id.next)
+ private void next(View view) {
+ NavHostFragment.findNavController(ResetPwdStep2.this)
+ .navigate(R.id.action_Second2Fragment_to_threeFragment);
+ }
+
+ /**
+ * 发送验证码
+ */
+ @Event(value = R.id.sendcode)
+ private void sendCode(View view) {
+ Toast.makeText(getContext(), R.string.action_sendcode, Toast.LENGTH_SHORT).show();
+ }
+}
diff --git a/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep3.java b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep3.java
new file mode 100644
index 0000000..81d9632
--- /dev/null
+++ b/app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep3.java
@@ -0,0 +1,29 @@
+package com.community.pocket.ui.resetpwd;
+
+import android.content.Intent;
+import android.view.View;
+import android.widget.Toast;
+
+import com.community.pocket.R;
+import com.community.pocket.ui.BaseFragment;
+import com.community.pocket.ui.login.LoginActivity;
+
+import org.xutils.view.annotation.ContentView;
+import org.xutils.view.annotation.Event;
+
+/**
+ * 重置密码第三步,输入密码
+ */
+@ContentView(R.layout.step3)
+public class ResetPwdStep3 extends BaseFragment {
+
+ @Event(value = R.id.reset_pwd)
+ private void resetPwd(View v) {
+ Toast.makeText(getContext(), R.string.action_reset_password, Toast.LENGTH_SHORT).show();
+ }
+
+ @Event(value = R.id.back)
+ private void back(View v) {
+ startActivity(new Intent(getContext(), LoginActivity.class));
+ }
+}
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 27b1073..b545546 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -35,7 +35,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
- android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_PASSWORD"
android:hint="@string/prompt_password"
@@ -43,7 +42,7 @@
android:imeOptions="actionDone"
android:inputType="textPassword"
android:selectAllOnFocus="true"
- app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/login_to_resetPwd"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" />
@@ -74,7 +73,7 @@
app:layout_constraintTop_toBottomOf="@+id/password">
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/resetpwd/layout/activity.xml b/app/src/main/res/layout/resetpwd/layout/activity.xml
new file mode 100644
index 0000000..765fade
--- /dev/null
+++ b/app/src/main/res/layout/resetpwd/layout/activity.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/resetpwd/layout/fragment.xml b/app/src/main/res/layout/resetpwd/layout/fragment.xml
new file mode 100644
index 0000000..6c2c303
--- /dev/null
+++ b/app/src/main/res/layout/resetpwd/layout/fragment.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/app/src/main/res/layout/resetpwd/layout/step1.xml b/app/src/main/res/layout/resetpwd/layout/step1.xml
new file mode 100644
index 0000000..c564ee4
--- /dev/null
+++ b/app/src/main/res/layout/resetpwd/layout/step1.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/resetpwd/layout/step2.xml b/app/src/main/res/layout/resetpwd/layout/step2.xml
new file mode 100644
index 0000000..a8eba41
--- /dev/null
+++ b/app/src/main/res/layout/resetpwd/layout/step2.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/resetpwd/layout/step3.xml b/app/src/main/res/layout/resetpwd/layout/step3.xml
new file mode 100644
index 0000000..f1abdab
--- /dev/null
+++ b/app/src/main/res/layout/resetpwd/layout/step3.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/navigation/nav_reset_pwd.xml b/app/src/main/res/navigation/nav_reset_pwd.xml
new file mode 100644
index 0000000..f6c3155
--- /dev/null
+++ b/app/src/main/res/navigation/nav_reset_pwd.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml
index 2da10ad..25d931c 100644
--- a/app/src/main/res/values-en-rUS/strings.xml
+++ b/app/src/main/res/values-en-rUS/strings.xml
@@ -21,4 +21,9 @@
please input confirm password
please input email
please input phone
+ reset password
+ reset password
+ Next
+ Previous
+ send code
\ No newline at end of file
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 9715920..60fb858 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -21,4 +21,9 @@
请输入确认密码
请输入邮箱
请输入手机号
+ 重置密码
+ 重置密码
+ 下一步
+ 上一步
+ 发送验证码
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 352a632..deed374 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -4,4 +4,5 @@
16dp
8dp
50dp
+ 16dp
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b4fb84c..a8f3b83 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -21,6 +21,14 @@
please input confirm password
please input email
please input phone
+ reset password
+ reset password
+
+ Next
+ Previous
+ send code
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index a515d0b..619b443 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -17,4 +17,13 @@
+
+
+
+
+
+