Sfoglia il codice sorgente

用户协议修改到登录界面

zengjiebin 7 anni fa
parent
commit
90b75f319e

+ 13 - 10
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -212,10 +212,10 @@ public class Jump2View {
      */
     private void checkOrGoHomePage(final Activity activity) {
         //是否展示协议
-        tryShowAgreement(activity, new Action1<String>() {
-            @Override
-            public void call(String msg) {
-                if(msg == null || TextUtils.equals(msg, "404")) {
+//        tryShowAgreement(activity, new Action1<String>() {
+//            @Override
+//            public void call(String msg) {
+//                if(msg == null || TextUtils.equals(msg, "404")) {
                     checkLabel(activity, new Action1<BaseMessage>() {
                         @Override
                         public void call(BaseMessage baseMessage) {
@@ -224,12 +224,12 @@ public class Jump2View {
                             activity.finish();
                         }
                     });
-                }else {
-                    G.showToast(msg);
+//                }else {
+//                    G.showToast(msg);
 //                    SheepApp.getInstance().quit();
-                }
-            }
-        });
+//                }
+//            }
+//        });
     }
 
     /**
@@ -918,7 +918,10 @@ public class Jump2View {
                             if(action1 != null)
                                 action1.call(null);
                         } else {
-                            DialogAgreement.showDialog(activity, agreementList, action1);
+//                            DialogAgreement.showDialog(activity, agreementList, action1);
+                            Agreement item = ListUtil.getIndex(agreementList, 0);
+                            if(item != null)
+                                goLoadH5(activity, item.getName(), item.getContent());
                         }
                     }
 

+ 32 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.view.activity;
 
 import android.text.TextUtils;
 import android.view.View;
+import android.widget.CheckBox;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -27,6 +28,7 @@ import javax.inject.Inject;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import rx.functions.Action1;
 
 /**
  * Created by ljy on 2018/3/8.
@@ -43,6 +45,11 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
     @BindView(R.id.iv_qq)
     ImageView ivQq;
 
+    @BindView(R.id.tel_agreement_cb)
+    CheckBox tel_agreement_cb;
+    @BindView(R.id.tel_agreement_tv)
+    TextView tel_agreement_tv;
+
 
     @Override
     protected int getLayoutId() {
@@ -188,18 +195,39 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
 
 
-    @OnClick({R.id.tel_login_tv, R.id.iv_wx, R.id.iv_qq})
+    @OnClick({R.id.tel_login_tv, R.id.iv_wx, R.id.iv_qq, R.id.tel_agreement_tv})
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.tel_login_tv:
-                goTelLogin();
+                if(checkAgreement())
+                    goTelLogin();
                 break;
             case R.id.iv_wx:
-                goWeixin();
+                if(checkAgreement())
+                    goWeixin();
                 break;
             case R.id.iv_qq:
-                loginQQ();
+                if(checkAgreement())
+                    loginQQ();
+                break;
+            case R.id.tel_agreement_tv:
+                Jump2View.getInstance().tryShowAgreement(this, new Action1<String>() {
+                            @Override
+                            public void call(String msg) {
+                                if(!TextUtils.isEmpty(msg)) {
+                                    G.showToast(msg);
+                                }
+                            }
+                        });
                 break;
         }
     }
+
+    private boolean checkAgreement() {
+        if(tel_agreement_cb.isChecked()){
+            return true;
+        }
+        G.showToast("温馨提示:您必须同意用户协议才能继续体验小绵羊APP!");
+        return false;
+    }
 }

+ 8 - 0
app/src/main/res/drawable/drawable_selector_check.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@mipmap/icon_select" android:state_checked="true"/>
+    <item android:drawable="@mipmap/icon_select" android:state_pressed="true"/>
+    <item android:drawable="@mipmap/icon_select_nor"/>
+
+</selector>

+ 27 - 2
app/src/main/res/layout/login_act_layout.xml

@@ -11,21 +11,46 @@
         style="@style/login_layout"
         android:layout_marginTop="@dimen/content_padding_80">
 
+        <LinearLayout
+            android:id="@+id/tel_agreement_ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="@dimen/content_padding_40"
+            android:gravity="center"
+            android:layout_centerHorizontal="true">
+            <android.support.v7.widget.AppCompatCheckBox
+                android:id="@+id/tel_agreement_cb"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:scaleX="1.4"
+                android:scaleY="1.4"
+                android:button="@drawable/drawable_selector_check"/>
+            <TextView
+                android:id="@+id/tel_agreement_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="5dp"
+                android:text="我已阅读并同意《小绵羊平台用户协议》"
+                android:textColor="@color/white"
+                android:textSize="12sp"/>
+        </LinearLayout>
 
         <TextView
             android:id="@+id/tel_login_tv"
             android:layout_width="wrap_content"
             android:layout_height="38dp"
             android:text="手机号登录"
-            android:layout_alignParentBottom="true"
             android:layout_centerHorizontal="true"
+            android:layout_above="@+id/tel_agreement_ll"
             style="@style/login_btn"
             android:paddingStart="@dimen/content_padding_40"
             android:paddingEnd="@dimen/content_padding_40"
             android:gravity="center"
             android:textColor="@color/txt_white"
             android:background="@drawable/x_shap_shadow_stroke_rectgangle"
-            android:layout_marginBottom="@dimen/content_padding_65"
+            android:layout_marginBottom="8dp"
             android:layout_marginTop="@dimen/content_padding_20"/>
 
 

BIN
app/src/main/res/mipmap-xxhdpi/icon_select.png


BIN
app/src/main/res/mipmap-xxhdpi/icon_select_nor.png


+ 0 - 2
app/src/main/res/values/gamegroup_styles.xml

@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <style name="login_layout">
-        <item name="android:paddingLeft">90dp</item>
-        <item name="android:paddingRight">90dp</item>
         <item name="android:amPmBackgroundColor">@color/blue</item>
     </style>
     <style name="login_btn" parent="android:Widget.Material.Light.Button.Borderless.Small">