parent
e3f364cdd9
commit
163e238eef
@ -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注解
|
||||
} |
||||
} |
@ -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 { |
||||
|
||||
} |
@ -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)); |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
@ -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)); |
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.resetpwd.ResetPwdActivity"> |
||||
|
||||
|
||||
<include layout="@layout/titlebar_layout" /> |
||||
|
||||
<include layout="@layout/fragment" /> |
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,19 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
||||
|
||||
<androidx.fragment.app.FragmentContainerView |
||||
android:id="@+id/nav_host_fragment" |
||||
android:name="androidx.navigation.fragment.NavHostFragment" |
||||
android:layout_width="0dp" |
||||
android:layout_height="0dp" |
||||
app:defaultNavHost="true" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintLeft_toLeftOf="parent" |
||||
app:layout_constraintRight_toRightOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
app:navGraph="@navigation/nav_reset_pwd" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,70 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.resetpwd.ResetPwdStep1"> |
||||
|
||||
<EditText |
||||
android:id="@+id/username" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
android:layout_marginTop="96dp" |
||||
android:layout_marginEnd="24dp" |
||||
|
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:hint="@string/prompt_user" |
||||
android:inputType="text" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<EditText |
||||
android:id="@+id/email" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
|
||||
android:layout_marginTop="8dp" |
||||
android:layout_marginEnd="24dp" |
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:hint="@string/prompt_email" |
||||
android:inputType="text|textEmailAddress" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/username" |
||||
tools:layout_constraintTop_toBottomOf="@id/username" /> |
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/email"> |
||||
|
||||
<Button |
||||
android:id="@+id/next" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="@dimen/size_50" |
||||
android:text="@string/next" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<Button |
||||
android:id="@+id/back" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="@dimen/size_50" |
||||
android:text="@string/action_back" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,81 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.resetpwd.ResetPwdStep2"> |
||||
|
||||
<EditText |
||||
android:id="@+id/username" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
android:layout_marginTop="96dp" |
||||
android:layout_marginEnd="24dp" |
||||
|
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:enabled="false" |
||||
android:hint="@string/prompt_user" |
||||
android:inputType="text" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<EditText |
||||
android:id="@+id/email" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
android:layout_marginTop="8dp" |
||||
|
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:enabled="false" |
||||
android:hint="@string/prompt_email" |
||||
android:inputType="text|textEmailAddress" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toStartOf="@id/sendcode" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@+id/username" |
||||
tools:layout_constraintTop_toBottomOf="@id/username" /> |
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/email"> |
||||
|
||||
<Button |
||||
android:id="@+id/next" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="@dimen/size_50" |
||||
android:text="@string/next" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<Button |
||||
android:id="@+id/back" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="@dimen/size_50" |
||||
android:text="@string/previous" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
|
||||
<Button |
||||
android:id="@+id/sendcode" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:text="@string/action_sendcode" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/username" /> |
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,67 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
|
||||
<EditText |
||||
android:id="@+id/password" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
android:layout_marginTop="96dp" |
||||
android:layout_marginEnd="24dp" |
||||
|
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:hint="@string/prompt_password" |
||||
android:inputType="text|textPassword" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<EditText |
||||
android:id="@+id/confirmPwd" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="24dp" |
||||
android:layout_marginTop="8dp" |
||||
|
||||
android:layout_marginEnd="24dp" |
||||
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" |
||||
android:hint="@string/prompt_confirm_password" |
||||
android:inputType="text|textPassword" |
||||
android:selectAllOnFocus="true" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/password" /> |
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/confirmPwd"> |
||||
|
||||
<Button |
||||
android:id="@+id/back" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="@dimen/size_50" |
||||
android:text="@string/action_back" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<Button |
||||
android:id="@+id/reset_pwd" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="@dimen/size_50" |
||||
android:text="@string/action_reset_password" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,34 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:id="@+id/nav_graph2" |
||||
app:startDestination="@id/First2Fragment" |
||||
tools:ignore="UnusedNavigation"> |
||||
|
||||
<fragment |
||||
android:id="@+id/First2Fragment" |
||||
android:name="com.community.pocket.ui.resetpwd.ResetPwdStep1" |
||||
tools:layout="@layout/step1"> |
||||
|
||||
<action |
||||
android:id="@+id/action_First2Fragment_to_Second2Fragment" |
||||
app:destination="@id/Second2Fragment" /> |
||||
</fragment> |
||||
<fragment |
||||
android:id="@+id/Second2Fragment" |
||||
android:name="com.community.pocket.ui.resetpwd.ResetPwdStep2" |
||||
tools:layout="@layout/step2"> |
||||
|
||||
<action |
||||
android:id="@+id/action_Second2Fragment_to_First2Fragment" |
||||
app:destination="@id/First2Fragment" /> |
||||
<action |
||||
android:id="@+id/action_Second2Fragment_to_threeFragment" |
||||
app:destination="@id/threeFragment" /> |
||||
</fragment> |
||||
<fragment |
||||
android:id="@+id/threeFragment" |
||||
android:name="com.community.pocket.ui.resetpwd.ResetPwdStep3" |
||||
android:label="ThreeFragment" /> |
||||
</navigation> |
Loading…
Reference in new issue