登录、注册、忘记密码UI基本完成
@ -203,6 +203,12 @@ dependencies {
|
||||
//RecyclerView ViewHolder复用错乱解决方案:https://blog.csdn.net/qq_43278826/article/details/105146153/
|
||||
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.3'
|
||||
|
||||
//图片选择器
|
||||
implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'
|
||||
|
||||
//hawk缓存数据simple key-value storage for Android:https://github.com/orhanobut/hawk
|
||||
implementation 'com.orhanobut:hawk:2.0.1'
|
||||
|
||||
// 内存泄漏监测框架:https://github.com/square/leakcanary
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
||||
//previewImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
||||
|
@ -26,7 +26,7 @@
|
||||
<!-- Application 节点详解:https://developer.android.google.cn/guide/topics/manifest/application-element -->
|
||||
<!-- Activity 节点详解:https://developer.android.google.cn/guide/topics/manifest/activity-element -->
|
||||
<application
|
||||
android:name="com.yinhetairui.digitalagriculture.app.AppApplication"
|
||||
android:name=".app.AppApplication"
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/launcher_ic"
|
||||
android:label="${app_name}"
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
<!-- 闪屏页 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.ui.splash.SplashActivity"
|
||||
android:name=".ui.splash.SplashActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/SplashTheme">
|
||||
@ -75,87 +75,105 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<!-- 注册结果 -->
|
||||
<activity
|
||||
android:name=".ui.login.RegisterResultActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 设置密码 -->
|
||||
<activity
|
||||
android:name=".ui.login.SetPasswordActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 注册 -->
|
||||
<activity
|
||||
android:name=".ui.login.RegisterActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 引导页 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.ui.splash.GuideActivity"
|
||||
android:name=".ui.splash.GuideActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 首页 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.ui.HomeActivity"
|
||||
android:name=".ui.HomeActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<!-- 登录页 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.ui.login.LoginActivity"
|
||||
android:name=".ui.login.LoginActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
|
||||
<!-- 崩溃展示(必须在独立进程) -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.CrashActivity"
|
||||
android:name=".uitools.activity.CrashActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:process=":crash"
|
||||
android:screenOrientation="landscape" />
|
||||
|
||||
<!-- 重启应用(必须在独立进程) -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.RestartActivity"
|
||||
android:name=".uitools.activity.RestartActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:process=":restart" />
|
||||
|
||||
<!-- 拍照选择 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.CameraActivity"
|
||||
android:name=".uitools.activity.CameraActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 图片选择 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.ImageSelectActivity"
|
||||
android:name=".uitools.activity.ImageSelectActivity"
|
||||
android:label="@string/image_select_title"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 查看大图 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.ImagePreviewActivity"
|
||||
android:name=".uitools.activity.ImagePreviewActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 播放视频(自适应方向) -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.VideoPlayActivity"
|
||||
android:name=".uitools.activity.VideoPlayActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/FullScreenTheme" />
|
||||
|
||||
<!-- 播放视频(竖屏方向) -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.VideoPlayActivity$Portrait"
|
||||
android:name=".uitools.activity.VideoPlayActivity$Portrait"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/FullScreenTheme" />
|
||||
|
||||
<!-- 播放视频(横屏方向) -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.VideoPlayActivity$Landscape"
|
||||
android:name=".uitools.activity.VideoPlayActivity$Landscape"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@style/FullScreenTheme" />
|
||||
|
||||
<!-- 选择视频 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.VideoSelectActivity"
|
||||
android:name=".uitools.activity.VideoSelectActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- 对话框案例 -->
|
||||
<activity
|
||||
android:name="com.yinhetairui.digitalagriculture.uitools.activity.DialogActivity"
|
||||
android:name=".uitools.activity.DialogActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
|
@ -13,6 +13,7 @@ import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.hjq.bar.TitleBar;
|
||||
import com.orhanobut.hawk.Hawk;
|
||||
import com.scwang.smart.refresh.footer.ClassicsFooter;
|
||||
import com.scwang.smart.refresh.header.ClassicsHeader;
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
@ -38,10 +39,10 @@ import okhttp3.OkHttpClient;
|
||||
import timber.log.Timber;
|
||||
|
||||
/**
|
||||
* author : Android 轮子哥
|
||||
* github : https://github.com/getActivity/AndroidProject
|
||||
* time : 2018/10/18
|
||||
* desc : 应用入口
|
||||
* author : Android 轮子哥
|
||||
* github : https://github.com/getActivity/AndroidProject
|
||||
* time : 2018/10/18
|
||||
* desc : 应用入口
|
||||
*/
|
||||
public final class AppApplication extends Application {
|
||||
|
||||
@ -78,6 +79,9 @@ public final class AppApplication extends Application {
|
||||
// 设置标题栏初始化器
|
||||
TitleBar.setDefaultStyle(new TitleBarStyle());
|
||||
|
||||
//数据存储
|
||||
Hawk.init(application).build();
|
||||
|
||||
// // 设置全局的 Header 构建器
|
||||
// SmartRefreshLayout.setDefaultRefreshHeaderCreator((cx, layout) ->
|
||||
// new MaterialHeader(application).setColorSchemeColors(ContextCompat.getColor(application, R.color.common_accent_color)));
|
||||
|
@ -11,6 +11,7 @@ import com.yinhetairui.digitalagriculture.manager.ActivityManager;
|
||||
import com.yinhetairui.digitalagriculture.other.DoubleClickHelper;
|
||||
import com.yinhetairui.digitalagriculture.ui.home.HomeFragment;
|
||||
import com.yinhetairui.digitalagriculture.ui.mine.MineFragment;
|
||||
import com.yinhetairui.digitalagriculture.ui.workbenches.WorkbenchesFragment;
|
||||
import com.yinhetairui.digitalagriculture.uitools.adapter.MyFragmentPagerAdapter;
|
||||
import com.yinhetairui.digitalagriculture.uitools.dto.MainTabDto;
|
||||
import com.hjq.widget.layout.NoScrollViewPager;
|
||||
@ -29,8 +30,8 @@ public final class HomeActivity extends AppActivity {
|
||||
private CommonTabLayout tlMain;
|
||||
|
||||
private List<String> mTitles = new ArrayList<>();
|
||||
private int[] mIconUnSelectIds = {R.drawable.home_home_off_ic, R.drawable.home_me_off_ic};
|
||||
private int[] mIconSelectIds = {R.drawable.home_home_on_ic, R.drawable.home_me_on_ic};
|
||||
private int[] mIconUnSelectIds = {R.drawable.home_home_off_ic,R.drawable.home_home_off_ic, R.drawable.home_me_off_ic};
|
||||
private int[] mIconSelectIds = {R.drawable.home_home_on_ic,R.drawable.home_home_on_ic, R.drawable.home_me_on_ic};
|
||||
private ArrayList<Fragment> mFragments = new ArrayList<>();
|
||||
private ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>();
|
||||
|
||||
@ -41,7 +42,6 @@ public final class HomeActivity extends AppActivity {
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
vpHomePager = (NoScrollViewPager) findViewById(R.id.vp_home_pager);
|
||||
tlMain = (CommonTabLayout) findViewById(R.id.tl_main);
|
||||
|
||||
@ -63,9 +63,11 @@ public final class HomeActivity extends AppActivity {
|
||||
protected void initData() {
|
||||
|
||||
mFragments.add(HomeFragment.newInstance());
|
||||
mFragments.add(WorkbenchesFragment.newInstance());
|
||||
mFragments.add(MineFragment.newInstance());
|
||||
|
||||
mTitles.add(getString(R.string.home_nav_index));
|
||||
mTitles.add("工作台");
|
||||
mTitles.add(getString(R.string.home_nav_me));
|
||||
|
||||
for (int i = 0; i < mTitles.size(); i++) {
|
||||
|
@ -1,32 +1,33 @@
|
||||
package com.yinhetairui.digitalagriculture.ui.login;
|
||||
|
||||
import android.view.KeyEvent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.shape.view.ShapeEditText;
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
import com.yinhetairui.digitalagriculture.aop.SingleClick;
|
||||
import com.yinhetairui.digitalagriculture.app.AppActivity;
|
||||
import com.yinhetairui.digitalagriculture.manager.InputTextManager;
|
||||
import com.yinhetairui.digitalagriculture.ui.HomeActivity;
|
||||
import com.hjq.widget.view.SubmitButton;
|
||||
import com.yinhetairui.digitalagriculture.utils.CustomTextWatcher;
|
||||
|
||||
/**
|
||||
* 创建日期:2022/11/4
|
||||
* 作者:llb
|
||||
* 描述:登录界面
|
||||
*/
|
||||
public final class LoginActivity extends AppActivity implements TextView.OnEditorActionListener {
|
||||
public final class LoginActivity extends AppActivity {
|
||||
|
||||
private EditText mPhoneView;
|
||||
private EditText mPasswordView;
|
||||
private SubmitButton mCommitView;
|
||||
private AppCompatImageView ivLoginLogo;
|
||||
private ShapeEditText etLoginAccount;
|
||||
private ShapeEditText etLoginPassword;
|
||||
private AppCompatTextView tvForgotPassword;
|
||||
private AppCompatTextView tvRegister;
|
||||
private AppCompatButton btnLogin;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@ -35,20 +36,36 @@ public final class LoginActivity extends AppActivity implements TextView.OnEdito
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
ivLoginLogo = (AppCompatImageView) findViewById(R.id.iv_login_logo);
|
||||
etLoginAccount = (ShapeEditText) findViewById(R.id.et_login_account);
|
||||
etLoginPassword = (ShapeEditText) findViewById(R.id.et_login_password);
|
||||
tvForgotPassword = (AppCompatTextView) findViewById(R.id.tv_forgot_password);
|
||||
tvRegister = (AppCompatTextView) findViewById(R.id.tv_register);
|
||||
btnLogin = (AppCompatButton) findViewById(R.id.btn_login);
|
||||
|
||||
mPhoneView = findViewById(R.id.et_login_phone);
|
||||
mPasswordView = findViewById(R.id.et_login_password);
|
||||
mCommitView = findViewById(R.id.btn_login_commit);
|
||||
|
||||
setOnClickListener(mCommitView);
|
||||
|
||||
mPasswordView.setOnEditorActionListener(this);
|
||||
|
||||
InputTextManager.with(this)
|
||||
.addView(mPhoneView)
|
||||
.addView(mPasswordView)
|
||||
.setMain(mCommitView)
|
||||
.build();
|
||||
setOnClickListener(tvForgotPassword, tvRegister, btnLogin);
|
||||
etLoginAccount.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etLoginAccount.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etLoginPassword.getText().toString().trim())) {
|
||||
btnLogin.setEnabled(true);
|
||||
} else {
|
||||
btnLogin.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
etLoginPassword.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etLoginAccount.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etLoginPassword.getText().toString().trim())) {
|
||||
btnLogin.setEnabled(true);
|
||||
} else {
|
||||
btnLogin.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,43 +76,28 @@ public final class LoginActivity extends AppActivity implements TextView.OnEdito
|
||||
@SingleClick
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (view == mCommitView) {
|
||||
if (mPhoneView.getText().toString().length() != 11) {
|
||||
mPhoneView.startAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.shake_anim));
|
||||
mCommitView.showError(3000);
|
||||
toast(R.string.common_phone_input_error);
|
||||
if (view == tvForgotPassword) {
|
||||
RegisterActivity.start(getContext(), 1);
|
||||
} else if (view == tvRegister) {
|
||||
RegisterActivity.start(getContext(), 0);
|
||||
} else if (view == btnLogin) {
|
||||
if (TextUtils.isEmpty(etLoginAccount.getText().toString().trim())) {
|
||||
toast("请输入账号");
|
||||
return;
|
||||
}
|
||||
|
||||
// 隐藏软键盘
|
||||
hideKeyboard(getCurrentFocus());
|
||||
|
||||
mCommitView.showProgress();
|
||||
postDelayed(() -> {
|
||||
mCommitView.showSucceed();
|
||||
postDelayed(() -> {
|
||||
startActivity(HomeActivity.class);
|
||||
finish();
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
|
||||
return;
|
||||
if (TextUtils.isEmpty(etLoginPassword.getText().toString().trim())) {
|
||||
toast("请输入密码");
|
||||
return;
|
||||
}
|
||||
login();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link TextView.OnEditorActionListener}
|
||||
* 密码登录
|
||||
*/
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE && mCommitView.isEnabled()) {
|
||||
// 模拟点击登录按钮
|
||||
onClick(mCommitView);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
private void login() {
|
||||
toast("执行登录");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.yinhetairui.digitalagriculture.ui.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.appcompat.widget.AppCompatEditText;
|
||||
|
||||
import com.hjq.bar.TitleBar;
|
||||
import com.hjq.widget.view.CountdownView;
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
import com.yinhetairui.digitalagriculture.aop.SingleClick;
|
||||
import com.yinhetairui.digitalagriculture.app.AppActivity;
|
||||
import com.yinhetairui.digitalagriculture.utils.CustomTextWatcher;
|
||||
|
||||
/**
|
||||
* 创建日期:2025/4/18
|
||||
* 作者:November
|
||||
* 描述:注册界面
|
||||
*/
|
||||
public final class RegisterActivity extends AppActivity {
|
||||
|
||||
private TitleBar title;
|
||||
private AppCompatEditText etPhone;
|
||||
private AppCompatEditText etCode;
|
||||
private CountdownView btnSend;
|
||||
private AppCompatButton btnConfirm;
|
||||
|
||||
/**
|
||||
* 来源:0-注册,1-忘记密码
|
||||
*/
|
||||
private int mSource = 0;
|
||||
|
||||
public static void start(Context context, int source) {
|
||||
Intent intent = new Intent(context, RegisterActivity.class);
|
||||
intent.putExtra("source", source);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_register;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
title = (TitleBar) findViewById(R.id.title);
|
||||
etPhone = (AppCompatEditText) findViewById(R.id.et_phone);
|
||||
etCode = (AppCompatEditText) findViewById(R.id.et_code);
|
||||
btnSend = (CountdownView) findViewById(R.id.btn_send);
|
||||
btnConfirm = (AppCompatButton) findViewById(R.id.btn_confirm);
|
||||
|
||||
setOnClickListener(btnSend, btnConfirm);
|
||||
etPhone.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etPhone.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etCode.getText().toString().trim())) {
|
||||
btnConfirm.setEnabled(true);
|
||||
} else {
|
||||
btnConfirm.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
etCode.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etPhone.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etCode.getText().toString().trim())) {
|
||||
btnConfirm.setEnabled(true);
|
||||
} else {
|
||||
btnConfirm.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mSource = getInt("source");
|
||||
title.setTitle(mSource == 0 ? "注册" : "忘记密码");
|
||||
}
|
||||
|
||||
@SingleClick
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == btnSend) {
|
||||
if (TextUtils.isEmpty(etPhone.getText().toString().trim())) {
|
||||
toast("请输入手机号");
|
||||
return;
|
||||
}
|
||||
btnSend.start();
|
||||
} else if (view == btnConfirm) {
|
||||
SetPasswordActivity.start(getContext(), mSource);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.yinhetairui.digitalagriculture.ui.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.hjq.bar.TitleBar;
|
||||
import com.hjq.shape.view.ShapeButton;
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
import com.yinhetairui.digitalagriculture.aop.SingleClick;
|
||||
import com.yinhetairui.digitalagriculture.app.AppActivity;
|
||||
|
||||
/**
|
||||
* 创建日期:2025/4/18
|
||||
* 作者:November
|
||||
* 描述:注册结果
|
||||
*/
|
||||
public final class RegisterResultActivity extends AppActivity {
|
||||
|
||||
private TitleBar title;
|
||||
private ShapeButton btnLogin;
|
||||
|
||||
/**
|
||||
* 来源:0-注册,1-忘记密码
|
||||
*/
|
||||
private int mSource = 0;
|
||||
|
||||
public static void start(Context context, int source) {
|
||||
Intent intent = new Intent(context, RegisterResultActivity.class);
|
||||
intent.putExtra("source", source);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_register_result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
title = (TitleBar) findViewById(R.id.title);
|
||||
btnLogin = (ShapeButton) findViewById(R.id.btn_login);
|
||||
|
||||
setOnClickListener(btnLogin);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mSource = getInt("source");
|
||||
title.setTitle(mSource == 0 ? "注册" : "忘记密码");
|
||||
}
|
||||
|
||||
@SingleClick
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == btnLogin) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.yinhetairui.digitalagriculture.ui.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
|
||||
import com.hjq.bar.TitleBar;
|
||||
import com.hjq.shape.view.ShapeEditText;
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
import com.yinhetairui.digitalagriculture.aop.SingleClick;
|
||||
import com.yinhetairui.digitalagriculture.app.AppActivity;
|
||||
import com.yinhetairui.digitalagriculture.utils.CustomTextWatcher;
|
||||
|
||||
/**
|
||||
* 创建日期:2025/4/18
|
||||
* 作者:November
|
||||
* 描述:设置密码
|
||||
*/
|
||||
public final class SetPasswordActivity extends AppActivity {
|
||||
|
||||
private TitleBar title;
|
||||
private ShapeEditText etPassword;
|
||||
private ShapeEditText etConfirmPassword;
|
||||
private AppCompatButton btnConfirm;
|
||||
|
||||
/**
|
||||
* 来源:0-注册,1-忘记密码
|
||||
*/
|
||||
private int mSource = 0;
|
||||
|
||||
public static void start(Context context, int source) {
|
||||
Intent intent = new Intent(context, SetPasswordActivity.class);
|
||||
intent.putExtra("source", source);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_set_password;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
title = (TitleBar) findViewById(R.id.title);
|
||||
etPassword = (ShapeEditText) findViewById(R.id.et_password);
|
||||
etConfirmPassword = (ShapeEditText) findViewById(R.id.et_confirm_password);
|
||||
btnConfirm = (AppCompatButton) findViewById(R.id.btn_confirm);
|
||||
|
||||
setOnClickListener(btnConfirm);
|
||||
|
||||
etPassword.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etPassword.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etConfirmPassword.getText().toString().trim())) {
|
||||
btnConfirm.setEnabled(true);
|
||||
} else {
|
||||
btnConfirm.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
etConfirmPassword.addTextChangedListener(new CustomTextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(etPassword.getText().toString().trim())
|
||||
&& !TextUtils.isEmpty(etConfirmPassword.getText().toString().trim())) {
|
||||
btnConfirm.setEnabled(true);
|
||||
} else {
|
||||
btnConfirm.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mSource = getInt("source");
|
||||
title.setTitle(mSource == 0 ? "注册" : "忘记密码");
|
||||
}
|
||||
|
||||
@SingleClick
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == btnConfirm) {
|
||||
RegisterResultActivity.start(getContext(), mSource);
|
||||
}
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ import com.yinhetairui.digitalagriculture.app.AppActivity;
|
||||
import com.yinhetairui.digitalagriculture.other.AppConfig;
|
||||
import com.yinhetairui.digitalagriculture.ui.HomeActivity;
|
||||
import com.hjq.widget.view.SlantedTextView;
|
||||
import com.yinhetairui.digitalagriculture.ui.login.LoginActivity;
|
||||
|
||||
/**
|
||||
* author : Android 轮子哥
|
||||
@ -42,7 +43,7 @@ public final class SplashActivity extends AppActivity {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mLottieView.removeAnimatorListener(this);
|
||||
startActivity(HomeActivity.class);
|
||||
startActivity(LoginActivity.class);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
@ -0,0 +1,32 @@
|
||||
package com.yinhetairui.digitalagriculture.ui.workbenches;
|
||||
|
||||
import com.yinhetairui.digitalagriculture.R;
|
||||
import com.yinhetairui.digitalagriculture.app.AppFragment;
|
||||
import com.yinhetairui.digitalagriculture.uitools.activity.CopyActivity;
|
||||
|
||||
/**
|
||||
* 创建日期:2025/4/18
|
||||
* 作者:November
|
||||
* 描述:工作台
|
||||
*/
|
||||
public final class WorkbenchesFragment extends AppFragment<CopyActivity> {
|
||||
|
||||
public static WorkbenchesFragment newInstance() {
|
||||
return new WorkbenchesFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_workbenches;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.yinhetairui.digitalagriculture.utils;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
/**
|
||||
* author November
|
||||
* time 2022/8/13 14:14
|
||||
* desc 实现接口,只复写需要的接口方法,简化代码
|
||||
*/
|
||||
public class CustomTextWatcher implements TextWatcher {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.yinhetairui.digitalagriculture.widget;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 创建日期:2025/4/18
|
||||
* 作者:November
|
||||
* 描述:生成验证码
|
||||
*/
|
||||
public class CodeView {
|
||||
/**
|
||||
* 随机数数组
|
||||
* 去除了易混淆的 数字 0 和 字母 o O
|
||||
* 数字 1 和 字母 i I l L
|
||||
* 数字 6 和 字母 b
|
||||
* 数字 9 和 字母 q
|
||||
* 字母 c C 和 G
|
||||
* 字母 t (经常和随机线混在一起看不清)
|
||||
*/
|
||||
private static final char[] CHARS = {
|
||||
'2', '3', '4', '5', '7', '8',
|
||||
'a', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm',
|
||||
'n', 'p', 'r', 's', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'A', 'B', 'D', 'E', 'F', 'H', 'J', 'K', 'M',
|
||||
'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
||||
};
|
||||
|
||||
private static CodeView bmpCode;
|
||||
|
||||
public static CodeView getInstance() {
|
||||
if (bmpCode == null)
|
||||
bmpCode = new CodeView();
|
||||
return bmpCode;
|
||||
}
|
||||
|
||||
//default settings
|
||||
//验证码默认随机数的个数
|
||||
private static final int DEFAULT_CODE_LENGTH = 4;
|
||||
//默认字体大小
|
||||
private static final int DEFAULT_FONT_SIZE = 25;
|
||||
//默认线条的条数
|
||||
private static final int DEFAULT_LINE_NUMBER = 5;
|
||||
//padding值
|
||||
private static final int BASE_PADDING_LEFT = 10, RANGE_PADDING_LEFT = 15, BASE_PADDING_TOP = 15, RANGE_PADDING_TOP = 20;
|
||||
//验证码的默认宽高
|
||||
private static final int DEFAULT_WIDTH = 100, DEFAULT_HEIGHT = 40;
|
||||
|
||||
//settings decided by the layout xml
|
||||
//canvas width and height
|
||||
private int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT;
|
||||
|
||||
//random word space and pading_top
|
||||
private int base_padding_left = BASE_PADDING_LEFT, range_padding_left = RANGE_PADDING_LEFT,
|
||||
base_padding_top = BASE_PADDING_TOP, range_padding_top = RANGE_PADDING_TOP;
|
||||
|
||||
//number of chars, lines; font size
|
||||
private int codeLength = DEFAULT_CODE_LENGTH, line_number = DEFAULT_LINE_NUMBER, font_size = DEFAULT_FONT_SIZE;
|
||||
|
||||
//variables
|
||||
private String code;
|
||||
private int padding_left, padding_top;
|
||||
private Random random = new Random();
|
||||
|
||||
//验证码图片
|
||||
public Bitmap createBitmap() {
|
||||
padding_left = 0;
|
||||
|
||||
Bitmap bp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
Canvas c = new Canvas(bp);
|
||||
|
||||
code = createCode();
|
||||
|
||||
c.drawColor(Color.WHITE);
|
||||
Paint paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
paint.setTextSize(font_size);
|
||||
//画验证码
|
||||
for (int i = 0; i < code.length(); i++) {
|
||||
randomTextStyle(paint);
|
||||
randomPadding();
|
||||
c.drawText(code.charAt(i) + "", padding_left, padding_top, paint);
|
||||
}
|
||||
//画线条
|
||||
for (int i = 0; i < line_number; i++) {
|
||||
drawLine(c, paint);
|
||||
}
|
||||
|
||||
// c.save( Canvas.ALL_SAVE_FLAG );//保存
|
||||
c.save();//保存
|
||||
c.restore();//
|
||||
return bp;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
//生成验证码
|
||||
private String createCode() {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (int i = 0; i < codeLength; i++) {
|
||||
buffer.append(CHARS[random.nextInt(CHARS.length)]);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
//画干扰线
|
||||
private void drawLine(Canvas canvas, Paint paint) {
|
||||
int color = randomColor();
|
||||
int startX = random.nextInt(width);
|
||||
int startY = random.nextInt(height);
|
||||
int stopX = random.nextInt(width);
|
||||
int stopY = random.nextInt(height);
|
||||
paint.setStrokeWidth(1);
|
||||
paint.setColor(color);
|
||||
canvas.drawLine(startX, startY, stopX, stopY, paint);
|
||||
}
|
||||
|
||||
//生成随机颜色
|
||||
private int randomColor() {
|
||||
return randomColor(1);
|
||||
}
|
||||
|
||||
private int randomColor(int rate) {
|
||||
int red = random.nextInt(256) / rate;
|
||||
int green = random.nextInt(256) / rate;
|
||||
int blue = random.nextInt(256) / rate;
|
||||
return Color.rgb(red, green, blue);
|
||||
}
|
||||
|
||||
//随机生成文字样式,颜色,粗细,倾斜度
|
||||
private void randomTextStyle(Paint paint) {
|
||||
int color = randomColor();
|
||||
paint.setColor(color);
|
||||
paint.setFakeBoldText(random.nextBoolean()); //true为粗体,false为非粗体
|
||||
float skewX = random.nextInt(11) / 10;
|
||||
skewX = random.nextBoolean() ? skewX : -skewX;
|
||||
paint.setTextSkewX(skewX); //float类型参数,负数表示右斜,整数左斜
|
||||
//paint.setUnderlineText(true); //true为下划线,false为非下划线
|
||||
//paint.setStrikeThruText(true); //true为删除线,false为非删除线
|
||||
}
|
||||
|
||||
//随机生成padding值
|
||||
private void randomPadding() {
|
||||
padding_left += base_padding_left + random.nextInt(range_padding_left);
|
||||
padding_top = base_padding_top + random.nextInt(range_padding_top);
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/icon_app_name.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_back.png
Normal file
After Width: | Height: | Size: 1011 B |
BIN
app/src/main/res/drawable-xhdpi/icon_success.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_app_name.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_back.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_success.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/icon_app_name.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/icon_back.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/icon_success.png
Normal file
After Width: | Height: | Size: 22 KiB |
@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 默认按钮样式 -->
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- 默认按钮样式 -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 禁用状态 -->
|
||||
@ -10,27 +9,11 @@
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 按压状态 -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/button_circle_size" />
|
||||
<solid android:color="@color/common_button_pressed_color" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 焦点状态 -->
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/button_circle_size" />
|
||||
<solid android:color="@color/common_button_pressed_color" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 默认状态 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/button_circle_size" />
|
||||
<solid android:color="@color/common_accent_color" />
|
||||
<solid android:color="@color/theme_color" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
123
app/src/main/res/layout/activity_register.xml
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.login.RegisterActivity">
|
||||
|
||||
<com.hjq.bar.TitleBar
|
||||
android:id="@+id/title"
|
||||
style="@style/MyTitleBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="注册" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:text="手机号"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.layout.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+86"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/et_phone"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入手机号"
|
||||
android:inputType="phone"
|
||||
android:maxLength="11"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
</com.hjq.shape.layout.ShapeLinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="验证码"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.layout.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/et_code"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="phone"
|
||||
android:maxLength="10"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.widget.view.CountdownView
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="获取验证码"
|
||||
android:textColor="@color/theme_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
</com.hjq.shape.layout.ShapeLinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="@drawable/button_circle_selector"
|
||||
android:enabled="false"
|
||||
android:text="确认"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20" />
|
||||
|
||||
</LinearLayout>
|
46
app/src/main/res/layout/activity_register_result.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.login.RegisterResultActivity">
|
||||
|
||||
<com.hjq.bar.TitleBar
|
||||
android:id="@+id/title"
|
||||
style="@style/MyTitleBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="忘记密码" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_88"
|
||||
android:src="@drawable/icon_success" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="设置密码成功"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_20" />
|
||||
|
||||
<com.hjq.shape.view.ShapeButton
|
||||
android:id="@+id/btn_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_122"
|
||||
android:gravity="center"
|
||||
android:text="去登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/theme_color" />
|
||||
|
||||
</LinearLayout>
|
86
app/src/main/res/layout/activity_set_password.xml
Normal file
@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.login.SetPasswordActivity">
|
||||
|
||||
<com.hjq.bar.TitleBar
|
||||
android:id="@+id/title"
|
||||
style="@style/MyTitleBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="忘记密码" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:text="输入密码"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.view.ShapeEditText
|
||||
android:id="@+id/et_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLength="20"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="再次输入密码"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.view.ShapeEditText
|
||||
android:id="@+id/et_confirm_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLength="20"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="@drawable/button_circle_selector"
|
||||
android:enabled="false"
|
||||
android:text="确认"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20" />
|
||||
|
||||
</LinearLayout>
|
@ -5,12 +5,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.yinhetairui.digitalagriculture.ui.home.HomeFragment">
|
||||
tools:context=".ui.home.HomeFragment">
|
||||
|
||||
<com.hjq.bar.TitleBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:leftIcon="@null"
|
||||
app:title="标题" />
|
||||
app:title="政府监管平台" />
|
||||
|
||||
</LinearLayout>
|
17
app/src/main/res/layout/fragment_workbenches.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.workbenches.WorkbenchesFragment">
|
||||
|
||||
<com.hjq.bar.TitleBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:leftIcon="@null"
|
||||
app:title="工作台" />
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -5,66 +5,122 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:layoutAnimation="@anim/layout_from_bottom"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.yinhetairui.digitalagriculture.ui.login.LoginActivity"
|
||||
tools:context=".ui.login.LoginActivity"
|
||||
tools:layoutAnimation="@null">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_login_logo"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginVertical="@dimen/dp_10"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
app:srcCompat="@drawable/logo_big_ic" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_168"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:src="@drawable/icon_app_name" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:text="账号"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.view.ShapeEditText
|
||||
android:id="@+id/et_login_account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入账号"
|
||||
android:inputType="phone"
|
||||
android:maxLength="11"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:text="密码"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<com.hjq.shape.view.ShapeEditText
|
||||
android:id="@+id/et_login_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLength="20"
|
||||
android:paddingHorizontal="@dimen/dp_24"
|
||||
android:textColor="@color/common_text_color"
|
||||
android:textColorHint="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:shape_radius="@dimen/dp_99"
|
||||
app:shape_solidColor="@color/white"
|
||||
app:shape_strokeColor="@color/common_line_color"
|
||||
app:shape_strokeSize="@dimen/dp_1" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_login_body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginHorizontal="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.hjq.widget.view.ClearEditText
|
||||
android:id="@+id/et_login_phone"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_forgot_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:hint="@string/common_phone_input_hint"
|
||||
android:inputType="textVisiblePassword"
|
||||
android:singleLine="true"
|
||||
app:regexType="mobile" />
|
||||
android:text="忘记密码?"
|
||||
android:textColor="@color/common_text_hint_color"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<View
|
||||
style="@style/HorizontalLineStyle"
|
||||
android:layout_marginHorizontal="@dimen/dp_40" />
|
||||
<Space
|
||||
android:layout_width="0px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.hjq.widget.view.PasswordEditText
|
||||
android:id="@+id/et_login_password"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:hint="@string/common_password_input_error"
|
||||
android:imeOptions="actionDone"
|
||||
android:maxLength="20"
|
||||
android:singleLine="true" />
|
||||
|
||||
<View
|
||||
style="@style/HorizontalLineStyle"
|
||||
android:layout_marginHorizontal="@dimen/dp_40" />
|
||||
|
||||
<com.hjq.widget.view.SubmitButton
|
||||
android:id="@+id/btn_login_commit"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:text="@string/login_text" />
|
||||
android:text="注册"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="@drawable/button_circle_selector"
|
||||
android:enabled="false"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20" />
|
||||
|
||||
</LinearLayout>
|
@ -5,15 +5,17 @@
|
||||
<color name="common_primary_dark_color">@color/black</color>
|
||||
<color name="common_accent_color">#5A8DDF</color>
|
||||
<color name="common_window_background_color">#F4F4F4</color>
|
||||
<color name="common_text_color">#333333</color>
|
||||
<color name="common_text_hint_color">@color/panda</color>
|
||||
<color name="common_text_color">#000000</color>
|
||||
<color name="common_text_color3">#333333</color>
|
||||
<color name="common_text_hint_color">#999999</color>
|
||||
|
||||
<color name="theme_color">#3685FE</color>
|
||||
<!-- 按钮按压时的颜色 -->
|
||||
<color name="common_button_pressed_color">#AA5A8DDF</color>
|
||||
<!-- 按钮禁用时的颜色 -->
|
||||
<color name="common_button_disable_color">#BBBBBB</color>
|
||||
<color name="common_button_disable_color">#D6E7FF</color>
|
||||
<!-- 分割线的颜色 -->
|
||||
<color name="common_line_color">#ECECEC</color>
|
||||
<color name="common_line_color">#E5E5E5</color>
|
||||
<!-- 矢量图标的颜色 -->
|
||||
<color name="common_icon_color">#7C7C7C</color>
|
||||
|
||||
|
@ -112,4 +112,13 @@
|
||||
<item name="android:textSize">@dimen/sp_12</item>
|
||||
</style>
|
||||
|
||||
<!-- 默认TitleBar样式 -->
|
||||
<style name="MyTitleBarStyle">
|
||||
<item name="lineVisible">false</item>
|
||||
<item name="lineSize">@dimen/dp_1</item>
|
||||
<item name="titleColor">@color/common_text_color</item>
|
||||
<item name="titleSize">@dimen/sp_20</item>
|
||||
<item name="leftIcon">@drawable/icon_back</item>
|
||||
</style>
|
||||
|
||||
</resources>
|