Prechádzať zdrojové kódy

[修改]加上登录遇到问题时的标题

zeki 5 rokov pred
rodič
commit
d4dca665c2

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/home/fragment/FgtMainHeader.java

@@ -133,7 +133,7 @@ public class FgtMainHeader extends BaseFragment {
             }
         }
         String s = user.getNickname();
-        if (s == null)
+        if (s == null || s.isEmpty())
             ViewUtil.setText(tv_nickname, "昵称");
         else
             ViewUtil.setText(tv_nickname, s);

+ 9 - 1
app/src/main/java/com/sheep/gamegroup/module/login/fragments/FindAccountFgt.java

@@ -5,11 +5,13 @@ import android.support.v4.app.Fragment;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
+import android.view.KeyEvent;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.ImageView;
 
 import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.util.KeyEventUtil;
 import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.filter.InputFilterUtil;
@@ -31,7 +33,8 @@ public class FindAccountFgt extends BaseFragment {
     EditText phoneNumberBox;
     @BindView(R.id.text_delete_btn)
     ImageView textDeleteBtn;
-
+    @BindView(R.id.iv_back)
+    ImageView ibBack;
     public FindAccountFgt() {
         // Required empty public constructor
     }
@@ -68,6 +71,11 @@ public class FindAccountFgt extends BaseFragment {
         });
     }
 
+    @OnClick(R.id.iv_back)
+    public void doBack(View v){
+        KeyEventUtil.sendKeyDownUp(KeyEvent.KEYCODE_BACK);
+    }
+
     @OnClick(R.id.send_captcha_btn)
     public void doSendCaptcha(View v) {
         String phoneNum = phoneNumberBox.getText().toString().trim();

+ 151 - 101
app/src/main/res/layout/fragment_find_account.xml

@@ -1,112 +1,162 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:paddingTop="50dp"
-    android:paddingLeft="@dimen/content_padding_24"
-    android:paddingBottom="@dimen/content_padding_24"
-    android:paddingRight="@dimen/content_padding_24">
+              xmlns:tools="http://schemas.android.com/tools"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
+              android:orientation="vertical"
+              android:paddingTop="24dp"
 
-    <LinearLayout
-        android:gravity="center_vertical"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <View
-            android:layout_marginRight="4dp"
-            android:layout_width="4dp"
-            android:layout_height="14dp"
-            android:background="@color/btn_color_main_stroke"/>
-        <TextView
-            android:text="方法一:"
-            android:textSize="14sp"
-            android:textColor="@color/black_6_3"
-            android:textStyle="bold"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-    </LinearLayout>
+>
 
-    <TextView
-        android:layout_marginTop="12dp"
-        android:textSize="12sp"
-        android:layout_marginLeft="8dp"
-        android:text="已绑定小绵羊账户的用户,可以通过手机号+验证码来修改密码"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
-
-    <RelativeLayout
-        android:layout_marginTop="8dp"
-        android:layout_marginLeft="8dp"
-        android:layout_marginRight="8dp"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <EditText
-            android:layout_marginTop="8dp"
-            android:id="@+id/phone_number_box"
-            android:hint="请输入手机号"
-            android:inputType="phone"
-            style="@style/login_edit_style" />
+    <android.support.constraint.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="56dp"
+            android:gravity="center"
+            android:orientation="horizontal">
 
         <ImageView
-            android:id="@+id/text_delete_btn"
-            android:src="@mipmap/text_delete"
-            android:visibility="gone"
-            android:layout_toLeftOf="@+id/send_captcha_btn"
-            android:layout_marginTop="24dp"
-            android:layout_marginRight="12dp"
-            android:layout_width="16dp"
-            android:layout_height="16dp" />
-
-        <View
-            style="@style/login_separetor_line_style"
-            android:layout_below="@+id/phone_number_box" />
-        <Button
-            android:id="@+id/send_captcha_btn"
-            android:text="获取验证码"
-            android:textSize="12sp"
-            android:textColor="@color/white"
-            android:textStyle="normal"
-            android:layout_marginTop="22dp"
-            android:layout_alignParentRight="true"
-            android:background="@drawable/round_main_r28"
-            android:layout_width="wrap_content"
-            android:layout_height="20dp"/>
-
-    </RelativeLayout>
+                android:id="@+id/iv_back"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="24dp"
+                android:scaleType="center"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                android:src="@drawable/narrow_back_black"/>
 
-    <LinearLayout
-        android:layout_marginTop="16dp"
-        android:gravity="center_vertical"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <View
-            android:layout_marginRight="4dp"
-            android:layout_width="4dp"
-            android:layout_height="14dp"
-            android:background="@color/btn_color_main_stroke"/>
         <TextView
-            android:text="方法二:"
-            android:textSize="14sp"
-            android:textColor="@color/black_6_3"
-            android:textStyle="bold"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:textColor="@color/black_333333"
+                android:textSize="16dp"
+                android:text="登录遇到问题"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintTop_toTopOf="parent"/>
+
+        <View android:background="@color/white_bg_line"
+              android:paddingStart="0dp"
+              android:paddingEnd="0dp"
+              android:layout_width="match_parent"
+              android:layout_height="1dp"
+              app:layout_constraintBottom_toBottomOf="parent"
+              app:layout_constraintStart_toStartOf="parent"
+              app:layout_constraintEnd_toEndOf="parent"/>
+
+    </android.support.constraint.ConstraintLayout>
+
+    <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
+            android:layout_height="wrap_content"
+            android:layout_marginTop="36dp"
+            android:paddingLeft="@dimen/content_padding_24"
+            android:paddingBottom="@dimen/content_padding_24"
+            android:paddingRight="@dimen/content_padding_24"
+            android:orientation="vertical">
+        <LinearLayout
+                android:gravity="center_vertical"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+            <View
+                    android:layout_marginRight="4dp"
+                    android:layout_width="4dp"
+                    android:layout_height="14dp"
+                    android:background="@color/btn_color_main_stroke"/>
+            <TextView
+                    android:text="方法一:"
+                    android:textSize="14sp"
+                    android:textColor="@color/black_6_3"
+                    android:textStyle="bold"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"/>
+        </LinearLayout>
+
+        <TextView
+                android:layout_marginTop="12dp"
+                android:textSize="12sp"
+                android:layout_marginLeft="8dp"
+                android:text="已绑定小绵羊账户的用户,可以通过手机号+验证码来修改密码"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+
+        <RelativeLayout
+                android:layout_marginTop="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+            <EditText
+                    android:layout_marginTop="8dp"
+                    android:id="@+id/phone_number_box"
+                    android:hint="请输入手机号"
+                    android:inputType="phone"
+                    style="@style/login_edit_style"/>
+
+            <ImageView
+                    android:id="@+id/text_delete_btn"
+                    android:src="@mipmap/text_delete"
+                    android:visibility="gone"
+                    android:layout_toLeftOf="@+id/send_captcha_btn"
+                    android:layout_marginTop="24dp"
+                    android:layout_marginRight="12dp"
+                    android:layout_width="16dp"
+                    android:layout_height="16dp"/>
+
+            <View
+                    style="@style/login_separetor_line_style"
+                    android:layout_below="@+id/phone_number_box"/>
+            <Button
+                    android:id="@+id/send_captcha_btn"
+                    android:text="获取验证码"
+                    android:textSize="12sp"
+                    android:textColor="@color/white"
+                    android:textStyle="normal"
+                    android:layout_marginTop="22dp"
+                    android:layout_alignParentRight="true"
+                    android:background="@drawable/round_main_r28"
+                    android:layout_width="wrap_content"
+                    android:layout_height="20dp"/>
+
+        </RelativeLayout>
+
+        <LinearLayout
+                android:layout_marginTop="16dp"
+                android:gravity="center_vertical"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+            <View
+                    android:layout_marginRight="4dp"
+                    android:layout_width="4dp"
+                    android:layout_height="14dp"
+                    android:background="@color/btn_color_main_stroke"/>
+            <TextView
+                    android:text="方法二:"
+                    android:textSize="14sp"
+                    android:textColor="@color/black_6_3"
+                    android:textStyle="bold"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"/>
+        </LinearLayout>
+        <TextView
+                android:text="通过联系客服申述,召回无绑定手机号的小绵羊账号及密码"
+                android:layout_marginTop="12dp"
+                android:textSize="12sp"
+                android:layout_marginLeft="8dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+
+        <TextView
+                android:textColor="@color/btn_color_main_stroke"
+                android:layout_marginTop="24dp"
+                android:textSize="12sp"
+                android:layout_marginLeft="8dp"
+                android:text="客服QQ: 2441310002"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+
     </LinearLayout>
-    <TextView
-        android:text="通过联系客服申述,召回无绑定手机号的小绵羊账号及密码"
-        android:layout_marginTop="12dp"
-        android:textSize="12sp"
-        android:layout_marginLeft="8dp"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
-
-    <TextView
-        android:textColor="@color/btn_color_main_stroke"
-        android:layout_marginTop="24dp"
-        android:textSize="12sp"
-        android:layout_marginLeft="8dp"
-        android:text="客服QQ: 2441310002"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
 
 </LinearLayout>
+