diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java index eb1dc3f7..e8a42a9a 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java @@ -326,7 +326,7 @@ public class MakeGoodFragment extends BaseFragment { mTopBar.setTitle("智慧菠萝点餐系统"+ConfigName.getInstance().Version); - mTopBar.addLeftImageButton(R.mipmap.silos1,1).setOnClickListener(new View.OnClickListener() { + mTopBar.addLeftImageButton(R.mipmap.silos11,1).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { add_manguan.SetData(); diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java index c62f99d1..ae0904f5 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java @@ -101,7 +101,7 @@ public class Silos_item_fragment extends BaseFragment { if (index != -1) { StaggeredGridLayoutManager layout11 = new StaggeredGridLayoutManager - (4, StaggeredGridLayoutManager.VERTICAL); + (3, StaggeredGridLayoutManager.VERTICAL); recycler_view_lll.setLayoutManager(layout11); liaochang_adapter adapter = new liaochang_adapter(context, DataBus.getInstance().SilosData.get(index).content); diff --git a/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java b/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java index c68492dc..57bfd394 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java +++ b/app/src/main/java/com/bonait/bnframework/modules/mine/fragment/MyFragment.java @@ -21,6 +21,7 @@ import android.widget.TextView; import com.allen.library.SuperTextView; import com.bonait.bnframework.R; import com.bonait.bnframework.business.ConfigData; +import com.bonait.bnframework.business.ExecuteTheRecipe; import com.bonait.bnframework.common.base.BaseFragment; import com.bonait.bnframework.common.constant.ConfigName; import com.bonait.bnframework.common.constant.Constants; @@ -49,8 +50,28 @@ public class MyFragment extends BaseFragment { @BindView(R.id.h_user_name) TextView hUserName; - @BindView(R.id.h_user_qianming) - TextView h_user_qianming; + @BindView(R.id.stv_user_name) + SuperTextView stv_user_name; + @BindView(R.id.stv_user_sign) + SuperTextView stv_user_sign; + + @BindView(R.id.stv_update) + SuperTextView stvUpdate; + + @BindView(R.id.stv_logout) + SuperTextView stvLogout; + + @BindView(R.id.stv_announcement) + SuperTextView stvAnnouncement; + + @BindView(R.id.stv_user) + SuperTextView stv_user; + + @BindView(R.id.stv_huifu) + SuperTextView stv_huifu; + + @BindView(R.id.stv_change_pwd) + SuperTextView stvChangePwd; /* private static final String BUNDLE_TITLE = "key_title"; @@ -81,11 +102,79 @@ public class MyFragment extends BaseFragment { initView(); } - @OnClick({R.id.stv_user_name, R.id.stv_user_sign, R.id.stv_change_pwd, R.id.stv_user_qx - , R.id.stv_update, R.id.stv_announcement, R.id.stv_huifu, R.id.stv_logout}) - public void onViewClicked(View view) { - switch (view.getId()) { - case R.id.stv_user_name:// + private void initData(BPA_USER user) { + if (user != null) { + ConfigName.getInstance().user = user; + hUserName.setText(user.account); + stv_user_name.setRightString(user.name);//名称 + stv_user_sign.setRightString(user.exp);//签名 + } + } + + private void initView() { + initData(ConfigName.getInstance().user); + stvUpdate.setRightString(ConfigName.getInstance().Version); + /* + * 版本更新,点击事件 + * */ + stvUpdate.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + //检查权限,并启动版本更新 + checkPermission(); + } + }); + + /** + * 退出按钮 + */ + stvLogout.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + String title = "温馨提示!"; + String message = "客官确定要退出程序吗,小菠萝会想你的哦?"; + AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { + @Override + public void onClick(QMUIDialog dialog, int index) { + skipToLoginActivity(); + dialog.dismiss(); + } + }); + } + }); + + /** + * 通知按钮 + */ + stvAnnouncement.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + skipToNoticeActivity(); + } + }); + + /** + * 用户管理 + */ + stv_user.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + if(ConfigName.getInstance().user.name.equals("admin") + || ConfigName.getInstance().user.account.equals("admin")) + { + skipToUserActivity(); + }else + { + ToastUtils.warning("对不起,你暂无权限!"); + } + } + }); +/** + * 用户名点击 + */ + stv_user_name.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); builder.setTitle("用户名修改") .setPlaceholder("在此输入用户名") @@ -100,9 +189,16 @@ public class MyFragment extends BaseFragment { .addAction("确定", new QMUIDialogAction.ActionListener() { @Override public void onClick(QMUIDialog dialog, int index) { + String name = ConfigName.getInstance().user.name; + String ac = ConfigName.getInstance().user.account; + if (name.equals("admin") || ac.equals("admin")) { + ToastUtils.warning("对不起,admin账户禁止操作!"); + return; + } + CharSequence text = builder.getEditText().getText(); if (text != null && text.length() > 0) { - BPA_USER user = QueryDB.UpdateUserName(ConfigName.getInstance().user.id, text.toString()); + BPA_USER user= QueryDB.UpdateUserName(ConfigName.getInstance().user.id,text.toString()); initData(user); dialog.dismiss(); } else { @@ -112,10 +208,16 @@ public class MyFragment extends BaseFragment { } }) .show(); - break; - case R.id.stv_user_sign:// - final QMUIDialog.EditTextDialogBuilder builder1 = new QMUIDialog.EditTextDialogBuilder(context); - builder1.setTitle("个人签名修改") + } + }); + /** + * 签名按钮点击 + */ + stv_user_sign.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); + builder.setTitle("个人签名修改") .setPlaceholder("在此输入签名") .setDefaultText(ConfigName.getInstance().user.exp) .setInputType(InputType.TYPE_CLASS_TEXT) @@ -128,9 +230,16 @@ public class MyFragment extends BaseFragment { .addAction("确定", new QMUIDialogAction.ActionListener() { @Override public void onClick(QMUIDialog dialog, int index) { - CharSequence text = builder1.getEditText().getText(); + String name = ConfigName.getInstance().user.name; + String ac = ConfigName.getInstance().user.account; + if (name.equals("admin") || ac.equals("admin")) { + ToastUtils.warning("对不起,admin账户禁止操作!"); + return; + } + + CharSequence text = builder.getEditText().getText(); if (text != null && text.length() > 0) { - BPA_USER user = QueryDB.UpdateUserSign(ConfigName.getInstance().user.id, text.toString()); + BPA_USER user= QueryDB.UpdateUserSign(ConfigName.getInstance().user.id,text.toString()); initData(user); dialog.dismiss(); } else { @@ -140,10 +249,16 @@ public class MyFragment extends BaseFragment { } }) .show(); - break; - case R.id.stv_change_pwd:// - final QMUIDialog.EditTextDialogBuilder builder2 = new QMUIDialog.EditTextDialogBuilder(context); - builder2.setTitle("个人密码修改") + } + }); + /** + * 密码修改 + */ + stvChangePwd.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { + final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); + builder.setTitle("个人密码修改") .setPlaceholder("在此输入密码") .setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD) .addAction("取消", new QMUIDialogAction.ActionListener() { @@ -155,9 +270,16 @@ public class MyFragment extends BaseFragment { .addAction("确定", new QMUIDialogAction.ActionListener() { @Override public void onClick(QMUIDialog dialog, int index) { - CharSequence text = builder2.getEditText().getText(); + String name = ConfigName.getInstance().user.name; + String ac = ConfigName.getInstance().user.account; + if (name.equals("admin") || ac.equals("admin")) { + ToastUtils.warning("对不起,admin账户禁止操作!"); + return; + } + + CharSequence text = builder.getEditText().getText(); if (text != null && text.length() > 0) { - BPA_USER user = QueryDB.UpdateUserPass(ConfigName.getInstance().user.id, text.toString()); + BPA_USER user= QueryDB.UpdateUserPass(ConfigName.getInstance().user.id,text.toString()); initData(user); dialog.dismiss(); } else { @@ -167,25 +289,15 @@ public class MyFragment extends BaseFragment { } }) .show(); - break; - case R.id.stv_user_qx:// - if(ConfigName.getInstance().user.name.equals("admin") - || ConfigName.getInstance().user.account.equals("admin")) - { - skipToUserActivity(); - }else - { - ToastUtils.warning("对不起,你暂无权限!"); - } - break; - case R.id.stv_update:// - //检查权限,并启动版本更新 - checkPermission(); - break; - case R.id.stv_announcement:// - skipToNoticeActivity(); - break; - case R.id.stv_huifu:// + } + }); + + /** + * 恢复出厂设置 + */ + stv_huifu.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { + @Override + public void onClickListener(SuperTextView superTextView) { String title = "温馨提示!"; String message = "客官确定要恢复出厂设置吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?"; AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { @@ -196,35 +308,24 @@ public class MyFragment extends BaseFragment { dialog.dismiss(); } }); - break; - case R.id.stv_logout:// - String title1 = "温馨提示!"; - String message1 = "客官确定要退出程序吗,小菠萝会想你的哦?"; - AlertDialogUtils.showDialog(context, title1, message1, new QMUIDialogAction.ActionListener() { - @Override - public void onClick(QMUIDialog dialog, int index) { - skipToLoginActivity(); - dialog.dismiss(); - } - }); - break; - } - } + } + }); + + + + + + + + + + - private void initData(BPA_USER user) { - if (user != null) { - ConfigName.getInstance().user = user; - hUserName.setText(user.name); - h_user_qianming.setText(user.exp);//签名 - } - } - private void initView() { - initData(ConfigName.getInstance().user); } /** - * 跳转登录界面 + * 跳转信息通知界面 */ private void skipToNoticeActivity() { // 跳转到登录页面 @@ -234,7 +335,7 @@ public class MyFragment extends BaseFragment { } /** - * 跳转登录界面 + * 跳转用户界面 */ private void skipToUserActivity() { // 跳转到登录页面 diff --git a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java index 639678d8..1a6132b7 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java @@ -62,9 +62,6 @@ import butterknife.OnClick; public class LoginActivity extends BaseActivity implements Validator.ValidationListener { - @BindView(R.id.logo) - ImageView mLogo; - @Order(1) @NotEmpty(message = "用户名不能为空") @BindView(R.id.et_account) @@ -124,17 +121,17 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL mEtAccount.requestFocus(); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); - if(ConfigName.getInstance().IsPortraitScreen)//竖屏 - { - RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(mScrollView.getLayoutParams()); - lp.setMargins(15, 80, 15, 0); - mScrollView.setLayoutParams(lp); - }else - { - RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(mScrollView.getLayoutParams()); - lp.setMargins(15, 40, 15, 0); - mScrollView.setLayoutParams(lp); - } +// if(ConfigName.getInstance().IsPortraitScreen)//竖屏 +// { +// RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(mScrollView.getLayoutParams()); +// lp.setMargins(15, 80, 15, 0); +// mScrollView.setLayoutParams(lp); +// }else +// { +// RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(mScrollView.getLayoutParams()); +// lp.setMargins(15, 40, 15, 0); +// mScrollView.setLayoutParams(lp); +// } } @OnClick({R.id.iv_clean_account, R.id.clean_password, R.id.iv_show_pwd,R.id.forget_password, R.id.btn_login}) @@ -304,7 +301,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL mAnimatorTranslateY.setDuration(300); mAnimatorTranslateY.setInterpolator(new LinearInterpolator()); mAnimatorTranslateY.start(); - AnimationToolUtils.zoomIn(mLogo, scale, dist); + //AnimationToolUtils.zoomIn(mLogo, scale, dist); } } else if (oldBottom != 0 && bottom != 0 && (bottom - oldBottom > keyHeight)) { @@ -314,7 +311,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL mAnimatorTranslateY.setInterpolator(new LinearInterpolator()); mAnimatorTranslateY.start(); //键盘收回后,logo恢复原来大小,位置同样回到初始位置 - AnimationToolUtils.zoomOut(mLogo, scale); + //AnimationToolUtils.zoomOut(mLogo, scale); } } } diff --git a/app/src/main/res/drawable-hdpi/device_sz.png b/app/src/main/res/drawable-hdpi/device_sz.png new file mode 100644 index 00000000..3b09d1d6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/device_sz.png differ diff --git a/app/src/main/res/drawable-hdpi/icon_personal_sex.png b/app/src/main/res/drawable-hdpi/icon_personal_sex.png new file mode 100644 index 00000000..498571c6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/icon_personal_sex.png differ diff --git a/app/src/main/res/drawable-hdpi/icon_test.png b/app/src/main/res/drawable-hdpi/icon_test.png new file mode 100644 index 00000000..2d94af7d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/icon_test.png differ diff --git a/app/src/main/res/drawable-hdpi/user_gl.png b/app/src/main/res/drawable-hdpi/user_gl.png new file mode 100644 index 00000000..0d77cd81 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/user_gl.png differ diff --git a/app/src/main/res/drawable-xxhdpi/abig_typebar_details.png b/app/src/main/res/drawable-xxhdpi/abig_typebar_details.png new file mode 100644 index 00000000..88a69ccb Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/abig_typebar_details.png differ diff --git a/app/src/main/res/drawable-xxhdpi/asmall_typebar_details.png b/app/src/main/res/drawable-xxhdpi/asmall_typebar_details.png new file mode 100644 index 00000000..439ce12c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/asmall_typebar_details.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ibig_typebar_details.png b/app/src/main/res/drawable-xxhdpi/ibig_typebar_details.png new file mode 100644 index 00000000..a588378f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ibig_typebar_details.png differ diff --git a/app/src/main/res/drawable-xxhdpi/icon_personal_download_files.png b/app/src/main/res/drawable-xxhdpi/icon_personal_download_files.png new file mode 100644 index 00000000..2afadcd8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/icon_personal_download_files.png differ diff --git a/app/src/main/res/drawable-xxhdpi/icon_personal_sex.png b/app/src/main/res/drawable-xxhdpi/icon_personal_sex.png new file mode 100644 index 00000000..d16c3781 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/icon_personal_sex.png differ diff --git a/app/src/main/res/drawable-xxhdpi/icon_right.png b/app/src/main/res/drawable-xxhdpi/icon_right.png new file mode 100644 index 00000000..d071f436 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/icon_right.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ismall_typebar_details.png b/app/src/main/res/drawable-xxhdpi/ismall_typebar_details.png new file mode 100644 index 00000000..7d79c7ba Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ismall_typebar_details.png differ diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index aef5f2b2..89461bd2 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -9,14 +9,15 @@ android:fitsSystemWindows="true" android:orientation="vertical" tools:context=".modules.welcome.activity.LoginActivity"> + - - - - + @@ -32,49 +32,44 @@ + android:orientation="vertical"> + + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:background="@mipmap/login_bj"> + + + - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:layout_marginBottom="60dp" + android:src="@mipmap/login_name" /> + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="2"> + --------------- - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginLeft="100dp" + android:layout_marginTop="100dp" + android:layout_marginRight="100dp" + android:orientation="vertical"> + + android:src="@mipmap/login_u" /> + android:textSize="16sp" /> + android:visibility="gone" /> + android:layout_marginBottom="30dp" + android:background="@color/color3" /> + android:src="@mipmap/login_p" /> + android:textSize="16sp" /> + android:visibility="gone" /> + android:src="@drawable/icon_pass_gone" /> + android:layout_marginBottom="50dp" + android:background="@color/color3" /> + android:layout_marginTop="10dp" + android:layout_marginBottom="30dp" + android:visibility="gone"> + android:textSize="@dimen/sp_14" />