詹子聪 преди 6 години
родител
ревизия
7a1642ea64

+ 4 - 0
app/src/main/java/com/miekir/eden/constant/ConstantString.java

@@ -18,4 +18,8 @@ public interface ConstantString {
      * 支付宝收款9.9元
      */
     String UPGRADE_ZFB = "";
+    /**
+     * 默认密码111111对应的加密密码
+     */
+    String PASSWORD_DEFAULT = "icsmabc123";
 }

+ 8 - 0
app/src/main/java/com/miekir/eden/ui/home/about/AboutFragment.java

@@ -42,11 +42,14 @@ public class AboutFragment extends BaseMVPFragment implements View.OnClickListen
         tv_desc = rootView.findViewById(R.id.tv_desc);
         tv_active = rootView.findViewById(R.id.tv_active);
         ll_about = rootView.findViewById(R.id.ll_about);
+        TextView tv_email = rootView.findViewById(R.id.tv_email);
+        tv_email.setText(UserInfoManager.getInstance().getBeiUser().email);
 
         rootView.findViewById(R.id.tv_feedback).setOnClickListener(this);
         rootView.findViewById(R.id.tv_update).setOnClickListener(this);
         rootView.findViewById(R.id.tv_more).setOnClickListener(this);
         rootView.findViewById(R.id.tv_active).setOnClickListener(this);
+        rootView.findViewById(R.id.ll_email).setOnClickListener(this);
     }
 
 
@@ -87,6 +90,11 @@ public class AboutFragment extends BaseMVPFragment implements View.OnClickListen
                 SystemTool.sendEmail(getActivity());
                 break;
 
+            case R.id.ll_email:
+                SystemTool.copyText(getActivity(), UserInfoManager.getInstance().getBeiUser().email);
+                ToastTool.showLong("已拷贝当前账号");
+                break;
+
             case R.id.tv_update:
                 showLoading();
                 upgradePresenter.getUpgradeInfo();

+ 26 - 12
app/src/main/java/com/miekir/eden/ui/mine/login/LoginActivity.java

@@ -28,6 +28,7 @@ import com.miekir.mvp.presenter.InjectPresenter;
  */
 public class LoginActivity extends BaseBeiActivity implements View.OnClickListener, ILoginView, ISystemView, View.OnLongClickListener {
     private View til_email;
+    private View til_password;
     private TextInputEditText et_email;
     private TextInputEditText et_password;
 
@@ -46,6 +47,7 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
     public void initViews(Bundle savedInstanceState) {
         setTitle("伊甸园登录", false);
         til_email = findViewById(R.id.til_email);
+        til_password = findViewById(R.id.til_password);
         et_email = findViewById(R.id.et_email);
         et_password = findViewById(R.id.et_password);
         ViewTool.setOnClickListener(this, this, new int[]{R.id.btn_login, R.id.tv_forget});
@@ -65,32 +67,43 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
                 break;
 
             case R.id.btn_login:
-                String email = et_email.getEditableText().toString();
+                String email;
+                String password;
+
                 if (til_email.getVisibility() == View.VISIBLE) {
+                    email = et_email.getEditableText().toString();
+                    if (TextUtils.isEmpty(email)) {
+                        ToastTool.showShort("账号不能为空");
+                        return;
+                    }
                     if (!TextUtils.equals(email, ConstantString.NAME_ADMIN)) {
                         ToastTool.showShort("暂不开放手动输入账号登录");
                         return;
                     }
+
+                    password = et_password.getEditableText().toString();
+                    if (TextUtils.isEmpty(password)) {
+                        ToastTool.showShort("密码不能为空");
+                        return;
+                    }
+                    password = StringTool.getEncodeString(password);
                 } else {
                     email = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
                     email = StringTool.getEncodeString(email);
-                }
-                String password = et_password.getEditableText().toString();
-                if (TextUtils.isEmpty(password)) {
-                    ToastTool.showShort("密码不能为空");
-                    return;
-                }
-                if (TextUtils.isEmpty(email)) {
-                    ToastTool.showShort("暂不支持本手机");
-                    return;
-                }
 
+                    if (TextUtils.isEmpty(email)) {
+                        ToastTool.showShort("暂不支持本手机");
+                        return;
+                    }
+
+                    password = StringTool.getEncodeString(ConstantString.PASSWORD_DEFAULT);
+                }
 
-                password = StringTool.getEncodeString(password);
                 if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password)) {
                     ToastTool.showShort("该手机不支持加密算法");
                     return;
                 }
+
                 showLoading();
                 presenter.submitLogin(email, password);
                 break;
@@ -114,6 +127,7 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
     public boolean onLongClick(View v) {
         if (v.getId() == R.id.toolbar) {
             til_email.setVisibility(View.VISIBLE);
+            til_password.setVisibility(View.VISIBLE);
         }
         return false;
     }

+ 3 - 1
app/src/main/res/layout/activity_login.xml

@@ -41,6 +41,7 @@
 
 
     <com.google.android.material.textfield.TextInputLayout
+        android:id="@+id/til_password"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginStart="@dimen/margin_default"
@@ -54,7 +55,8 @@
         app:boxCornerRadiusTopStart="4dp"
         app:boxStrokeWidth="@dimen/width_stroke"
         app:boxStrokeWidthFocused="@dimen/width_stroke"
-        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
+        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+        android:visibility="gone">
 
         <com.google.android.material.textfield.TextInputEditText
             android:id="@+id/et_password"

+ 139 - 135
app/src/main/res/layout/activity_mine.xml

@@ -1,175 +1,179 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:fillViewport="true"
     android:fitsSystemWindows="true"
-    android:orientation="vertical"
     android:background="@color/white">
 
-    <include layout="@layout/view_toolbar"/>
-
-
-    <!--管理员才能看到此界面-->
     <LinearLayout
-        android:id="@+id/ll_admin"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical">
+        <include layout="@layout/view_toolbar"/>
+
 
-        <com.google.android.material.textfield.TextInputLayout
+        <!--管理员才能看到此界面-->
+        <LinearLayout
+            android:id="@+id/ll_admin"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/margin_default"
-            android:layout_marginEnd="@dimen/margin_default"
-            android:layout_marginTop="@dimen/margin_default"
-            android:hint="请输入要升级的账号"
-            app:boxBackgroundMode="outline"
-            app:boxCornerRadiusBottomEnd="4dp"
-            app:boxCornerRadiusBottomStart="4dp"
-            app:boxCornerRadiusTopEnd="4dp"
-            app:boxCornerRadiusTopStart="4dp"
-            app:boxStrokeWidth="@dimen/width_stroke"
-            app:boxStrokeWidthFocused="@dimen/width_stroke"
-            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
-
-            <com.google.android.material.textfield.TextInputEditText
-                android:id="@+id/et_email"
+            android:orientation="vertical">
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:hint="请输入要升级的账号"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke"
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_email"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s"
+                    android:inputType="textEmailAddress"
+                    android:maxLength="50"/>
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <android.widget.Button
+                android:id="@+id/btn_set_vip"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:textSize="@dimen/text_normal_s"
-                android:inputType="textEmailAddress"
-                android:maxLength="50"/>
-        </com.google.android.material.textfield.TextInputLayout>
+                android:minHeight="0dp"
+                android:layout_margin="@dimen/margin_default"
+                android:paddingTop="@dimen/padding_full_width"
+                android:paddingBottom="@dimen/padding_full_width"
+                android:text="升级为VIP用户"
+                android:textColor="@color/white"
+                android:textStyle="bold"
+                android:background="@drawable/selector_btn"
+                style="?android:attr/borderlessButtonStyle"/>
+
+            <include layout="@layout/view_divider_common"/>
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:id="@+id/til_zfb"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:hint="请输入新的支付链接"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke"
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_zfb"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s"
+                    android:inputType="textEmailAddress"
+                    android:maxLength="50"/>
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <android.widget.Button
+                android:id="@+id/btn_set_zfb"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:minHeight="0dp"
+                android:layout_margin="@dimen/margin_default"
+                android:paddingTop="@dimen/padding_full_width"
+                android:paddingBottom="@dimen/padding_full_width"
+                android:text="设置新的支付链接"
+                android:textColor="@color/white"
+                android:textStyle="bold"
+                android:background="@drawable/selector_btn"
+                style="?android:attr/borderlessButtonStyle"/>
+
+            <include layout="@layout/view_divider_common"/>
+
+            <TextView
+                android:id="@+id/tv_add_photo"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/height_tool_bar"
+                android:background="?attr/selectableItemBackground"
+                android:gravity="center_vertical"
+                android:paddingStart="@dimen/activity_horizontal_margin"
+                android:paddingEnd="@dimen/activity_horizontal_margin"
+                android:text="增加图片"
+                android:textColor="@color/black_text"
+                android:visibility="gone"/>
 
-        <android.widget.Button
-            android:id="@+id/btn_set_vip"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:minHeight="0dp"
-            android:layout_margin="@dimen/margin_default"
-            android:paddingTop="@dimen/padding_full_width"
-            android:paddingBottom="@dimen/padding_full_width"
-            android:text="升级为VIP用户"
-            android:textColor="@color/white"
-            android:textStyle="bold"
-            android:background="@drawable/selector_btn"
-            style="?android:attr/borderlessButtonStyle"/>
+            <!--<include layout="@layout/view_divider_common"/>-->
 
-        <include layout="@layout/view_divider_common"/>
 
-        <com.google.android.material.textfield.TextInputLayout
-            android:id="@+id/til_zfb"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/margin_default"
-            android:layout_marginEnd="@dimen/margin_default"
-            android:layout_marginTop="@dimen/margin_default"
-            android:hint="请输入新的支付链接"
-            app:boxBackgroundMode="outline"
-            app:boxCornerRadiusBottomEnd="4dp"
-            app:boxCornerRadiusBottomStart="4dp"
-            app:boxCornerRadiusTopEnd="4dp"
-            app:boxCornerRadiusTopStart="4dp"
-            app:boxStrokeWidth="@dimen/width_stroke"
-            app:boxStrokeWidthFocused="@dimen/width_stroke"
-            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
-
-            <com.google.android.material.textfield.TextInputEditText
-                android:id="@+id/et_zfb"
+            <Switch
+                android:id="@+id/switch_api"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:textSize="@dimen/text_normal_s"
-                android:inputType="textEmailAddress"
-                android:maxLength="50"/>
-        </com.google.android.material.textfield.TextInputLayout>
+                android:layout_height="@dimen/height_tool_bar"
+                android:gravity="center_vertical"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:text="是否限制访问伊甸园"/>
 
-        <android.widget.Button
-            android:id="@+id/btn_set_zfb"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:minHeight="0dp"
-            android:layout_margin="@dimen/margin_default"
-            android:paddingTop="@dimen/padding_full_width"
-            android:paddingBottom="@dimen/padding_full_width"
-            android:text="设置新的支付链接"
-            android:textColor="@color/white"
-            android:textStyle="bold"
-            android:background="@drawable/selector_btn"
-            style="?android:attr/borderlessButtonStyle"/>
+            <include layout="@layout/view_divider_common" />
+
+            <Switch
+                android:id="@+id/switch_walk"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/height_tool_bar"
+                android:gravity="center_vertical"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:text="是否在下次启动爬虫"/>
 
-        <include layout="@layout/view_divider_common"/>
+            <include layout="@layout/view_divider_common" />
+        </LinearLayout>
 
         <TextView
-            android:id="@+id/tv_add_photo"
+            android:id="@+id/tv_my_fav"
             android:layout_width="match_parent"
             android:layout_height="@dimen/height_tool_bar"
             android:background="?attr/selectableItemBackground"
             android:gravity="center_vertical"
             android:paddingStart="@dimen/activity_horizontal_margin"
             android:paddingEnd="@dimen/activity_horizontal_margin"
-            android:text="增加图片"
-            android:textColor="@color/black_text"
-            android:visibility="gone"/>
-
-        <!--<include layout="@layout/view_divider_common"/>-->
+            android:text="我的收藏"
+            android:textColor="@color/black_text" />
 
+        <include layout="@layout/view_divider_common" />
 
-        <Switch
-            android:id="@+id/switch_api"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/height_tool_bar"
-            android:gravity="center_vertical"
-            android:layout_marginStart="@dimen/margin_default"
-            android:layout_marginEnd="@dimen/margin_default"
-            android:text="是否限制访问伊甸园"/>
 
-        <include layout="@layout/view_divider_common" />
 
-        <Switch
-            android:id="@+id/switch_walk"
+        <android.widget.Button
+            android:id="@+id/btn_exit_login"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/height_tool_bar"
-            android:gravity="center_vertical"
+            android:layout_height="wrap_content"
+            android:minHeight="0dp"
+            android:layout_marginTop="@dimen/margin_default"
+            android:layout_marginBottom="@dimen/margin_default"
             android:layout_marginStart="@dimen/margin_default"
             android:layout_marginEnd="@dimen/margin_default"
-            android:text="是否在下次启动爬虫"/>
-
-        <include layout="@layout/view_divider_common" />
+            android:paddingTop="@dimen/padding_full_width"
+            android:paddingBottom="@dimen/padding_full_width"
+            android:text="退出当前账号"
+            android:textColor="@color/white"
+            android:textStyle="bold"
+            android:background="@drawable/selector_btn_exit"
+            style="?android:attr/borderlessButtonStyle"/>
     </LinearLayout>
 
-    <TextView
-        android:id="@+id/tv_my_fav"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/height_tool_bar"
-        android:background="?attr/selectableItemBackground"
-        android:gravity="center_vertical"
-        android:paddingStart="@dimen/activity_horizontal_margin"
-        android:paddingEnd="@dimen/activity_horizontal_margin"
-        android:text="我的收藏"
-        android:textColor="@color/black_text" />
-
-    <include layout="@layout/view_divider_common" />
-
-    <View
-        android:layout_width="wrap_content"
-        android:layout_height="0dp"
-        android:layout_weight="1"/>
-
-    <android.widget.Button
-        android:id="@+id/btn_exit_login"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:minHeight="0dp"
-        android:layout_marginBottom="@dimen/margin_default"
-        android:layout_marginStart="@dimen/margin_default"
-        android:layout_marginEnd="@dimen/margin_default"
-        android:paddingTop="@dimen/padding_full_width"
-        android:paddingBottom="@dimen/padding_full_width"
-        android:text="退出当前账号"
-        android:textColor="@color/white"
-        android:textStyle="bold"
-        android:background="@drawable/selector_btn_exit"
-        style="?android:attr/borderlessButtonStyle"/>
-</LinearLayout>
+
+</ScrollView>

+ 27 - 0
app/src/main/res/layout/fragment_about.xml

@@ -43,6 +43,7 @@
             android:textStyle="bold" />
     </LinearLayout>
 
+
     <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -64,6 +65,32 @@
         android:textSize="@dimen/text_normal"
         android:layout_marginTop="@dimen/margin_s"/>
 
+
+    <LinearLayout
+        android:id="@+id/ll_email"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:paddingStart="@dimen/margin_default"
+        android:paddingEnd="@dimen/margin_default"
+        android:layout_marginTop="@dimen/margin_s"
+        android:gravity="center_vertical"
+        android:visibility="gone">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="本机账号:"
+            android:textColor="@color/black_droid_text"
+            android:textSize="@dimen/text_normal" />
+        <TextView
+            android:id="@+id/tv_email"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/black_droid_text"
+            android:textSize="@dimen/text_normal" />
+    </LinearLayout>
+
+
     <TextView
         android:id="@+id/tv_feedback"
         android:layout_width="wrap_content"