Просмотр исходного кода

功能开发:根据要求,增加相关隐私协议的显示

Sora 1 год назад
Родитель
Сommit
46dd3e76e9

+ 2 - 2
app/build.gradle

@@ -36,7 +36,7 @@ android {
             storeFile file('../sign.jks')
             storePassword 'zhaoyi2004'
             v1SigningEnabled true
-            v2SigningEnabled false
+            v2SigningEnabled true
         }
     }
 
@@ -128,7 +128,7 @@ android {
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
             buildConfigField "String", "DUANDUAN_GRAPH", '"sheep"'
-            resValue "string", "app_name", "小绵羊"
+            resValue "string", "app_name", "小绵羊助手"
             buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
             signingConfig signingConfigs.config
 

+ 426 - 0
app/src/main/java/com/sheep/gamegroup/absBase/BaseNotRxActivity.java

@@ -0,0 +1,426 @@
+package com.sheep.gamegroup.absBase;
+
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.Color;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import com.r0adkll.slidr.Slidr;
+import com.r0adkll.slidr.model.SlidrConfig;
+import com.r0adkll.slidr.model.SlidrListener;
+import com.r0adkll.slidr.model.SlidrPosition;
+import com.sheep.gamegroup.model.api.BackHandleInterface;
+import com.sheep.gamegroup.util.ActionUtil;
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.view.dialog.DialogLoading;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.lang.reflect.Field;
+import java.util.concurrent.TimeUnit;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+import io.reactivex.Observable;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * Created by kemllor on 2017/12/15.
+ */
+
+public abstract class BaseNotRxActivity extends AppCompatActivity implements BackHandleInterface {
+
+    protected DialogLoading dialogLoading;
+    public Unbinder unbinder;
+
+    protected boolean needRegisterEventBus() {
+        return false;
+    }
+
+    protected boolean needButterKnife() {
+        return true;
+    }
+
+    private static long lastClickTime;
+    public static boolean isFastDoubleClick() {
+        long time = System.currentTimeMillis();
+        long timeD = time - lastClickTime;
+        if (0 < timeD && timeD < 500) {
+            return true;
+        }
+        lastClickTime = time;
+        return false;
+    }
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+            if (isFastDoubleClick()) {
+                return true;
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            Window win = getWindow();
+            WindowManager.LayoutParams winParams = win.getAttributes();
+            final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
+            winParams.flags |= bits;
+            win.setAttributes(winParams);
+        }
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            Window window = getWindow();
+            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+                    | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+//            window.setStatusBarColor(Color.TRANSPARENT);
+        }
+        if(showWhiteStatusBar()){
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+                getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+                getWindow().setStatusBarColor(getResources().getColor(android.R.color.white));
+            }
+        }
+
+        ActionBar actionBar = getSupportActionBar();
+        if (actionBar != null) {
+            actionBar.setCustomView(getTitleLayoutId());
+            actionBar.hide();
+            actionBar.setDisplayShowCustomEnabled(true);
+            actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+            actionBar.setElevation(0);
+            Toolbar toolbar = (Toolbar) actionBar.getCustomView().getParent();
+            toolbar.setContentInsetsRelative(0, 0);
+        }
+        if (getLayoutId() != 0) {
+            setContentView(getLayoutId());
+        }
+        if (needButterKnife())
+            unbinder = ButterKnife.bind(this);
+        if (needRegisterEventBus())
+            EventBus.getDefault().register(this);
+        initSlidr();
+    }
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        if (newConfig.fontScale != 1)//非默认值
+            getResources();
+        super.onConfigurationChanged(newConfig);
+    }
+
+    @Override
+    public Resources getResources() {
+        Resources res = super.getResources();
+        if (res.getConfiguration().fontScale != 1) {//非默认值
+            Configuration newConfig = new Configuration();
+            newConfig.setToDefaults();//设置默认
+            res.updateConfiguration(newConfig, res.getDisplayMetrics());
+        }
+        return res;
+    }
+
+    protected boolean showWhiteStatusBar(){return false;}
+    protected int getTitleLayoutId(){
+        return R.layout.title;
+    }
+    protected void initSlidr(){
+        SlidrConfig config = new SlidrConfig.Builder()
+//                .primaryColor(getResources().getColor(R.color.primary)
+//                        .secondaryColor(getResources().getColor(R.color.secondary)
+//                                .position(SlidrPosition.LEFT|RIGHT|TOP|BOTTOM|VERTICAL|HORIZONTAL)
+                                .position(SlidrPosition.HORIZONTAL)
+                                .sensitivity(0.2f)
+                                .scrimColor(Color.BLACK)
+                                .scrimStartAlpha(0.8f)
+                                .scrimEndAlpha(0f)
+                                .velocityThreshold(2400)
+                                .distanceThreshold(0.25f)
+                                .edge(true)
+                                .edgeSize(0.18f) // The % of the screen that counts as the edge, default 18%
+                                .listener(new SlidrListener(){
+
+                                    @Override
+                                    public void onSlideStateChanged(int state) {
+                                        LogUtil.println("SlidrConfig", "onSlideStateChanged", state);
+                                    }
+
+                                    @Override
+                                    public void onSlideChange(float percent) {
+                                        LogUtil.println("SlidrConfig", "onSlideChange", percent);
+                                    }
+
+                                    @Override
+                                    public void onSlideOpened() {
+                                        LogUtil.println("SlidrConfig", "onSlideOpened");
+                                    }
+
+                                    @Override
+                                    public void onSlideClosed() {
+                                        LogUtil.println("SlidrConfig", "onSlideClosed");
+                                    }
+                                })
+                                .build();
+
+        Slidr.attach(this, config);
+    }
+
+    @Override
+    public void onPostCreate(Bundle bundle) {
+        super.onPostCreate(bundle);
+        initView();
+        initListener();
+        initData();
+    }
+
+    public boolean isShowing() {
+        return dialogLoading != null && dialogLoading.getAlertDialog() != null && dialogLoading.getAlertDialog().isShowing();
+    }
+
+    public void showProgress() {
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(this);
+    }
+
+    protected void showProgress(boolean cancel) {
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(this, cancel);
+    }
+
+
+    public void hideProgress() {
+        if (isShowing()) {
+            try {
+                dialogLoading.getAlertDialog().dismiss();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        checkNextAction(this.getClass().getSimpleName());
+    }
+
+    protected boolean checkNextAction(String key) {
+        final Object action = ActionUtil.getInstance().getAction(key);
+        if (action != null) {
+            //延时一会儿,不然有可能操作会无效
+            Observable.just(1).delay(50L, TimeUnit.MILLISECONDS)
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new AbsObserver<Integer>() {
+                        @Override
+                        public void onNext(Integer i) {
+                            doNextAction(action);
+                        }
+                    });
+            return true;
+        }
+        return false;
+    }
+
+    public void doNextAction(Object action) {
+
+    }
+
+    protected abstract int getLayoutId();
+
+    public abstract void initView();
+
+    public void initListener() {
+
+    }
+
+    public void initData() {
+
+    }
+
+    @Override
+    protected void onDestroy() {
+        fixInputMethodLeak();
+        try {
+            if (needButterKnife() && this.unbinder != null) {
+                this.unbinder.unbind();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (needRegisterEventBus())
+            EventBus.getDefault().unregister(this);
+        super.onDestroy();
+    }
+
+
+    //解决华为手机内存泄漏问题
+    private static Field[] leakFields = new Field[1];
+    private static boolean[] hasLeakFields = {true};
+    private static String[] leakFieldNames = {"mLastSrvView"};
+//    private static String[] leakFieldNames = {"mLastSrvView", "mNextServedView"};
+
+    private void fixInputMethodLeak() {
+        boolean goon = false;
+        for (boolean has : hasLeakFields) {
+            goon = goon || has;
+            if (goon) break;
+        }
+        if (!goon) return;
+
+        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+        if (imm == null) {
+            return;
+        }
+
+        for (int i = 0; i < leakFieldNames.length; i++) {
+            try {
+                if (leakFields[i] == null) {
+                    leakFields[i] = imm.getClass().getDeclaredField(leakFieldNames[i]);
+                }
+                if (leakFields[i] == null) {
+                    hasLeakFields[i] = false;
+                }
+                if (leakFields[i] != null) {
+                    leakFields[i].setAccessible(true);
+//                    Object obj = leakFields[i].get(imm);
+//                    View view = (View) obj;
+//                    Log.e("Leak", leakFieldNames[i] +
+//                            " : " + view.getClass().getSimpleName() +
+//                            " = " + view.getContext().getClass().getSimpleName() +
+//                            " (" + view.getContext().hashCode() + ")" +
+//                            " - " + getClass().getSimpleName()+
+//                            " (" + this.hashCode() + ")");
+                    leakFields[i].set(imm, null);
+                }
+            } catch (Throwable t) {
+//                t.printStackTrace();
+            }
+        }
+    }
+
+    public void releaseInputMethodRefView() {
+        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+        if (imm == null) {
+            return;
+        }
+        try {
+            Field field = imm.getClass().getDeclaredField("mNextServedView");
+            if (field != null) {
+                field.setAccessible(true);
+                field.set(imm, null);
+            }
+        } catch (Throwable t) {
+            t.printStackTrace();
+        }
+    }
+
+    public void hideSystemStatusBar() {
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+                WindowManager.LayoutParams.FLAG_FULLSCREEN);
+    }
+
+    public void hideSystemNavBar() {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            getWindow().getDecorView().setSystemUiVisibility(
+                    View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav
+                            // bar
+                            | View.SYSTEM_UI_FLAG_IMMERSIVE);
+        } else {
+            getWindow().getDecorView().setSystemUiVisibility(
+                    View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav
+            );
+        }
+    }
+//    private boolean isTranslucentOrFloating(){
+//        if(TestUtil.isDev()){
+//            return false;
+//        }
+//        boolean isTranslucentOrFloating = false;
+//        try {
+//            int [] styleableRes = (int[]) Class.forName("com.android.internal.R$styleable").getField("Window").get(null);
+//            final TypedArray ta = obtainStyledAttributes(styleableRes);
+//            Method m = ActivityInfo.class.getMethod("isTranslucentOrFloating", TypedArray.class);
+//            m.setAccessible(true);
+//            isTranslucentOrFloating = (boolean)m.invoke(null, ta);
+//            m.setAccessible(false);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return isTranslucentOrFloating;
+//    }
+//    private boolean fixOrientation(){
+//        try {
+//            Field field = Activity.class.getDeclaredField("mActivityInfo");
+//            field.setAccessible(true);
+//            ActivityInfo o = (ActivityInfo)field.get(this);
+//            o.screenOrientation = -1;
+//            field.setAccessible(false);
+//            return true;
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return false;
+//    }
+//    @Override
+//    public void setRequestedOrientation(int requestedOrientation) {
+//        if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O && isTranslucentOrFloating()) {
+//            LogUtil.println("avoid calling setRequestedOrientation when Oreo.");
+//            return;
+//        }
+//        super.setRequestedOrientation(requestedOrientation);
+//    }
+
+
+    private BaseFragment backHandleFragment;
+
+    @Override
+    public void onSelectedFragment(BaseFragment backHandleFragment) {
+        this.backHandleFragment = backHandleFragment;
+    }
+
+    @Override
+    public void onBackPressed() {
+        if(checkBackPressed()){
+            super.onBackPressed();
+        }
+    }
+
+    public boolean checkBackPressed() {
+        //if判断里面就调用了来自Fragment的onBackPressed()
+        //一样!!,如果onBackPressed是返回false,就会进入条件内进行默认的操作
+        if(backHandleFragment == null || !backHandleFragment.onBackPressed()){
+            if(getSupportFragmentManager().getBackStackEntryCount() == 0){
+                return true;
+            }else{
+                getSupportFragmentManager().popBackStack();
+            }
+        }
+        return false;
+    }
+}

+ 60 - 15
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignInFgt.java

@@ -3,29 +3,45 @@ package com.sheep.gamegroup.module.login.fragments;
 
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
-import androidx.annotation.NonNull;
-import com.google.android.material.snackbar.Snackbar;
-import androidx.fragment.app.Fragment;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
+import android.text.SpannableStringBuilder;
+import android.text.Spanned;
 import android.text.TextUtils;
 import android.text.method.HideReturnsTransformationMethod;
+import android.text.method.LinkMovementMethod;
 import android.text.method.PasswordTransformationMethod;
+import android.text.style.ForegroundColorSpan;
+import android.text.style.URLSpan;
 import android.util.Base64;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.*;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.android.material.snackbar.Snackbar;
 import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.Account;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.module.login.controller.LoginController;
-import com.sheep.gamegroup.util.*;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.filter.InputFilterUtil;
 import com.sheep.gamegroup.view.customview.CountDownButton;
 import com.sheep.jiuyan.samllsheep.R;
@@ -77,7 +93,12 @@ public class SignInFgt extends AbsLoginFgt {
     ImageView verifyImageView;
     @BindView(R.id.cb_remember_pwd)
     CheckBox cbRememberPwd;
-
+    @BindView(R.id.tel_agreement_tv)
+    //同意隐私协议Text
+    TextView telAgreementTv;
+    @BindView(R.id.tel_agreement_cb)
+    //隐私协议打钩
+    CheckBox telAgreementCb;
     private String captchaId;
 
     public SignInFgt() {
@@ -117,17 +138,28 @@ public class SignInFgt extends AbsLoginFgt {
             loginTypeToggleIcon.setImageResource(R.drawable.shouji);
             loginTypeToggleText.setText("手机号");
         }
-
+        String begin = "我已阅读并同意《隐私政策》和《用户协议》";
+        //《隐私政策》和《用户协议》帮助您了解我们为您提供的服务、我们会如何处理个人信息以及您享有的权力。我们会严格按照相关法律法规要求,采取各种安全措施来保护您的个人信息。";
+        SpannableStringBuilder builder = SpannableStringBuilder.valueOf(begin);
+        builder.setSpan(new URLSpan("http://ysxy.17xmy.com/yinsizhengce.html"), 7, 13, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new ForegroundColorSpan(Color.parseColor("#ff0000")), 7, 13, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new URLSpan("http://ysxy.17xmy.com/yonghuxieyi.html"), 14, 20, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new ForegroundColorSpan(Color.parseColor("#ff0000")), 14, 20, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        telAgreementTv.setMovementMethod(LinkMovementMethod.getInstance());
+        telAgreementTv.setHighlightColor(Color.parseColor("#00000000"));
+        telAgreementTv.setText(builder);
         InputFilterUtil.filterPhone86(phoneNumberBox);
         InputFilterUtil.filterPhone86(userNameBox, false);
     }
 
     @OnClick(R.id.login_btn)
     public void doLogin(View v) {
-        if (loginTypeToggle.isSelected()) {
-            phoneLogin();
-        } else {
-            accountLogin();
+        if (!checkAgreement()) {
+            if (loginTypeToggle.isSelected()) {
+                phoneLogin();
+            } else {
+                accountLogin();
+            }
         }
     }
 
@@ -336,10 +368,10 @@ public class SignInFgt extends AbsLoginFgt {
     }
 
     public void doToggleLoginType(boolean flag) {
-        if(flag){
+        if (flag) {
             //手机号
             cbRememberPwd.setVisibility(View.GONE);
-        }else {
+        } else {
             //账号
             cbRememberPwd.setVisibility(View.VISIBLE);
         }
@@ -455,4 +487,17 @@ public class SignInFgt extends AbsLoginFgt {
         passwordBox.setSelection(passwordBox.getText().toString().length());
     }
 
+    @OnClick(R.id.tel_agreement_tv)
+    public void showAgreement(View v) {
+        telAgreementCb.setChecked(!telAgreementCb.isChecked());
+    }
+
+    //检查是否同意用户协议
+    protected boolean checkAgreement() {
+        if (telAgreementCb.isChecked()) {
+            return false;
+        }
+        G.showToast("温馨提示:您必须同意用户协议才能继续体验小绵羊APP!");
+        return true;
+    }
 }

+ 35 - 8
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignUpFgt.java

@@ -1,35 +1,50 @@
 package com.sheep.gamegroup.module.login.fragments;
 
 
-import com.google.android.material.snackbar.Snackbar;
-import androidx.fragment.app.Fragment;
+import static com.sheep.gamegroup.module.login.controller.LoginController.PLATFORM_PHONE;
+
+import android.graphics.Color;
+import android.text.SpannableStringBuilder;
+import android.text.Spanned;
 import android.text.TextUtils;
 import android.text.method.HideReturnsTransformationMethod;
+import android.text.method.LinkMovementMethod;
 import android.text.method.PasswordTransformationMethod;
+import android.text.style.ForegroundColorSpan;
+import android.text.style.URLSpan;
 import android.view.KeyEvent;
 import android.view.View;
 import android.widget.CheckBox;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.TextView;
+
+import androidx.fragment.app.Fragment;
+
 import com.alibaba.fastjson.JSONObject;
+import com.google.android.material.snackbar.Snackbar;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.module.login.controller.LoginController;
-import com.sheep.gamegroup.util.*;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.KeyEventUtil;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 
-import static com.sheep.gamegroup.module.login.controller.LoginController.PLATFORM_PHONE;
-
 /**
  * A simple {@link Fragment} subclass.
  */
@@ -67,7 +82,9 @@ public class SignUpFgt extends AbsLoginFgt {
     //用户协议
     @BindView(R.id.tel_agreement_cb)
     CheckBox tel_agreement_cb;
-
+    @BindView(R.id.tel_agreement_tv)
+    //隐私协议文本
+    TextView telAgreementTv;
     private int registerType = PLATFORM_PHONE;
 
     public SignUpFgt() {
@@ -102,6 +119,16 @@ public class SignUpFgt extends AbsLoginFgt {
             tvLoginTitle.setText("手机号注册");
             registerToggleIcon.setImageResource(R.drawable.zhanghao);
         }
+        String begin = "我已阅读并同意《隐私政策》和《用户协议》";
+        //《隐私政策》和《用户协议》帮助您了解我们为您提供的服务、我们会如何处理个人信息以及您享有的权力。我们会严格按照相关法律法规要求,采取各种安全措施来保护您的个人信息。";
+        SpannableStringBuilder builder = SpannableStringBuilder.valueOf(begin);
+        builder.setSpan(new URLSpan("http://ysxy.17xmy.com/yinsizhengce.html"), 7, 13, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new ForegroundColorSpan(Color.parseColor("#ff0000")), 7, 13, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new URLSpan("http://ysxy.17xmy.com/yonghuxieyi.html"), 14, 20, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(new ForegroundColorSpan(Color.parseColor("#ff0000")), 14, 20, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+        telAgreementTv.setMovementMethod(LinkMovementMethod.getInstance());
+        telAgreementTv.setHighlightColor(Color.parseColor("#00000000"));
+        telAgreementTv.setText(builder);
         tvBackLogin.setOnClickListener(v -> {
             KeyEventUtil.sendKeyDownUp(KeyEvent.KEYCODE_BACK);
             //mController.whenToLogin(PLATFORM_PHONE);
@@ -270,7 +297,7 @@ public class SignUpFgt extends AbsLoginFgt {
                                 SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
                                 DataUtil.getInstance().initUserEntity(loginEty.getUser());
                             }
-                            SpUtils.saveUp(getContext(),loginEty.getUser().getId(), jsonObject.getString("password"));
+                            SpUtils.saveUp(getContext(), loginEty.getUser().getId(), jsonObject.getString("password"));
                             mController.whenLoginSuccess(LoginController.PLATFORM_ACCOUNT, loginEty);
                         }
                     }
@@ -314,7 +341,7 @@ public class SignUpFgt extends AbsLoginFgt {
 
     @OnClick(R.id.tel_agreement_tv)
     public void showAgreement(View v) {
-        Jump2View.getInstance().tryShowAgreement(SheepApp.getInstance().getCurrentActivity(), G::showToast);
+        tel_agreement_cb.setChecked(!tel_agreement_cb.isChecked());
     }
 
     //检查是否同意用户协议

+ 9 - 2
app/src/main/java/com/sheep/gamegroup/util/DeviceUtil.java

@@ -4,10 +4,13 @@ import android.Manifest;
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.provider.Settings;
-import androidx.core.app.ActivityCompat;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
+
+import androidx.core.app.ActivityCompat;
+
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
 import java.util.Random;
 
 /**
@@ -30,7 +33,11 @@ public class DeviceUtil {
 //        if(TestUtil.isTest() && BuildConfig.DEBUG){//debug状态下可以任意接任务
 //            return getInstance().getRandomId();
 //        }
-        String deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
+        String deviceId = "";
+        //如果有权限,才获取androidID
+        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
+            deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
+        }
         if (TextUtils.isEmpty(deviceId)) {
             try {
                 deviceId = DeviceIDUtil.getDeviceId(context);

+ 18 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -1,6 +1,11 @@
 package com.sheep.gamegroup.view.activity;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
+
 import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
@@ -14,7 +19,6 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.Version;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.module.pay.activity.ActPayPassword;
-import com.baidu.idl.face.platform.ui.utils.FaceSDKHelper;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataKey;
 import com.sheep.gamegroup.util.DataUtil;
@@ -32,9 +36,6 @@ import butterknife.OnClick;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
-
 /**
  * Created by realicing on 2018/04/.
  * realicing@sina.com
@@ -72,9 +73,9 @@ public class ActSetting extends BaseActivity {
     public void onResume() {
         super.onResume();
         CommonUtil.getInstance().getUserInfo(false, (user) -> {
-            if(user.hasPayPwd()){
+            if (user.hasPayPwd()) {
                 ViewUtil.setText(payPwdFlag, "去关闭");
-                ViewUtil.setOnClickListener(payPwdFlag, v->{
+                ViewUtil.setOnClickListener(payPwdFlag, v -> {
                     ActPayPassword.clearPwd(activity);
                 });
             } else {
@@ -124,7 +125,7 @@ public class ActSetting extends BaseActivity {
 
     @OnClick({R.id.change_password_layout, R.id.pay_pwd_layout, R.id.abourt_us_layout, R.id.clear_layout,
             R.id.tv_submit, R.id.copy_text_layout, R.id.change_layout, R.id.feedback_layout,
-            R.id.check_upgrade_view, R.id.execute_upgrade_btn})
+            R.id.check_upgrade_view, R.id.execute_upgrade_btn, R.id.privacy_policy, R.id.person_agreement})
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.change_password_layout:
@@ -173,6 +174,16 @@ public class ActSetting extends BaseActivity {
             case R.id.check_upgrade_view:
                 SysAppUtil.showVersionInfo(this, null);
                 break;
+            case R.id.privacy_policy:
+                startActivity(new Intent()
+                        .setAction(Intent.ACTION_VIEW)
+                        .setData(Uri.parse("http://ysxy.17xmy.com/yinsizhengce.html")));
+                break;
+            case R.id.person_agreement:
+                startActivity(new Intent()
+                        .setAction(Intent.ACTION_VIEW)
+                        .setData(Uri.parse("http://ysxy.17xmy.com/yonghuxieyi.html")));
+                break;
         }
     }
 

Разница между файлами не показана из-за своего большого размера
+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java


+ 2 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -166,7 +166,6 @@ public class SheepApp extends MultiDexApplication {
         mSheepApp = this;
         connectAddress = ConnectAddress.sheep.getDefaultConnectAddress();
         ContextHolder.setContext(this);
-        initNet();
         /*Rx兜底策略*/
         RxJavaPlugins.setErrorHandler(throwable -> Log.e("RxThrowable", throwable.getMessage()));
         ChannelContent.getInstance().initChannelContent(this);
@@ -382,6 +381,7 @@ public class SheepApp extends MultiDexApplication {
             return;
         }
         otherSDKInit = true;
+        initNet();
         //        小游戏
         MiniSDK.init(this, () -> Log.e("SNOW", "initComplete"));
         // 渠道是否需要使用互联账号作为自有体系登录游戏。
@@ -665,6 +665,7 @@ public class SheepApp extends MultiDexApplication {
 
         @Override
         public void onActivityCreated(final Activity activity, Bundle savedInstanceState) {
+            Log.d("onActivityCreated", activity.getClass().getSimpleName());
             if (!(activity instanceof SplashAct)) {
                 //如果不是启动activity,如果第三方的sdk没初始化,就要初始化第三方SDK
                 if (!otherSDKInit) {

+ 47 - 16
app/src/main/res/layout/act_setting.xml

@@ -9,8 +9,8 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginBottom="@dimen/content_padding_15"
         android:layout_marginTop="@dimen/content_padding"
+        android:layout_marginBottom="@dimen/content_padding_15"
         android:background="@color/white"
         android:orientation="vertical">
 
@@ -39,16 +39,17 @@
             <TextView
                 android:id="@+id/pay_pwd_flag"
                 style="@style/style_item_label"
-                android:textSize="12sp"
-                android:textColor="@color/black_999999"
                 android:gravity="right"
-                android:text="已设置" />
+                android:text="已设置"
+                android:textColor="@color/black_999999"
+                android:textSize="12sp" />
 
             <TextView style="@style/style_item_end_next" />
 
         </LinearLayout>
 
         <View style="@style/style_item_line" />
+
         <LinearLayout
             android:id="@+id/copy_text_layout"
             style="@style/style_item_container">
@@ -59,9 +60,9 @@
 
             <ImageView
                 android:id="@+id/copy_text_iv"
-                android:src="@mipmap/toggle_open"
                 android:layout_width="50dp"
-                android:layout_height="30dp" />
+                android:layout_height="30dp"
+                android:src="@mipmap/toggle_open" />
 
         </LinearLayout>
 
@@ -83,10 +84,11 @@
 
         </LinearLayout>
 
-        <View android:layout_width="match_parent"
-              android:minHeight="1px"
-              android:background="@color/white_light"
-              android:layout_height="@dimen/content_padding" />
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/content_padding"
+            android:background="@color/white_light"
+            android:minHeight="1px" />
 
         <LinearLayout
             android:id="@+id/version_layout"
@@ -99,16 +101,16 @@
 
             <TextView
                 android:id="@+id/execute_upgrade_btn"
+                android:layout_width="wrap_content"
+                android:layout_height="26dp"
                 android:background="@drawable/round_main_r25"
-                android:text="立即更新"
-                android:textColor="@color/white"
-                android:textSize="14sp"
                 android:gravity="center"
                 android:paddingLeft="10dp"
-                android:visibility="gone"
                 android:paddingRight="10dp"
-                android:layout_width="wrap_content"
-                android:layout_height="26dp" />
+                android:text="立即更新"
+                android:textColor="@color/white"
+                android:textSize="14sp"
+                android:visibility="gone" />
 
 
         </LinearLayout>
@@ -140,6 +142,35 @@
             <TextView style="@style/style_item_end_next" />
 
         </LinearLayout>
+
+        <View style="@style/style_item_line" />
+
+        <LinearLayout
+            android:id="@+id/privacy_policy"
+            style="@style/style_item_container">
+
+            <TextView
+                style="@style/style_item_label"
+                android:text="隐私政策" />
+
+            <TextView style="@style/style_item_end_next" />
+
+        </LinearLayout>
+
+        <View style="@style/style_item_line" />
+
+        <LinearLayout
+            android:id="@+id/person_agreement"
+            style="@style/style_item_container">
+
+            <TextView
+                style="@style/style_item_label"
+                android:text="用户协议" />
+
+            <TextView style="@style/style_item_end_next" />
+
+        </LinearLayout>
+
         <View style="@style/style_item_line" />
 
         <LinearLayout

+ 27 - 3
app/src/main/res/layout/fragment_sign_in.xml

@@ -177,7 +177,6 @@
                     app:layout_constraintTop_toTopOf="parent"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintEnd_toEndOf="parent"
-                    tools:visibility="go"
                     android:visibility="visible">
 
                 <EditText
@@ -234,13 +233,12 @@
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <LinearLayout
-                    android:id="@+id/tel_agreement_ll"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:orientation="horizontal"
                     android:layout_marginStart="24dp"
                     android:layout_marginEnd="24dp"
-                    android:layout_marginBottom="24dp">
+                    android:layout_marginBottom="16dp">
 
                 <androidx.appcompat.widget.AppCompatCheckBox
                         android:id="@+id/cb_remember_pwd"
@@ -265,7 +263,33 @@
                         android:textSize="12dp"/>
 
             </LinearLayout>
+            <LinearLayout
+                android:id="@+id/tel_agreement_ll"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="start"
+                android:layout_marginStart="32dp"
+                android:layout_marginBottom="16dp"
+                android:gravity="center"
+                android:orientation="horizontal"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/register_btn">
+
+                <androidx.appcompat.widget.AppCompatCheckBox
+                    android:id="@+id/tel_agreement_cb"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    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="8dp"
+                    android:text="我已阅读并同意《隐私政策》和《用户协议》"
+                    android:textColor="@color/black_333333"
+                    android:textSize="12sp" />
+            </LinearLayout>
             <Button
                     android:id="@+id/login_btn"
                     style="@style/login_theme_round_button"

+ 225 - 219
app/src/main/res/layout/fragment_sign_up.xml

@@ -1,279 +1,285 @@
-<androidx.constraintlayout.widget.ConstraintLayout
-        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:orientation="vertical"
-        android:background="@drawable/bg_login">
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/bg_login"
+    android:orientation="vertical">
 
     <TextView
-            android:id="@+id/tv_login_title"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="@color/white"
-            android:textSize="19dp"
-            android:text="手机号注册"
-            android:layout_marginTop="42dp"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintEnd_toEndOf="@+id/imageView3"
-            app:layout_constraintStart_toStartOf="@+id/imageView3"/>
+        android:id="@+id/tv_login_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="42dp"
+        android:text="手机号注册"
+        android:textColor="@color/white"
+        android:textSize="19dp"
+        app:layout_constraintEnd_toEndOf="@+id/imageView3"
+        app:layout_constraintStart_toStartOf="@+id/imageView3"
+        app:layout_constraintTop_toTopOf="parent" />
 
     <ImageView
-            android:layout_width="76dp"
-            android:layout_height="76dp"
-            android:src="@drawable/logo"
-            android:layout_marginTop="18dp"
-            app:layout_constraintEnd_toEndOf="@+id/tv_app_name"
-            app:layout_constraintStart_toStartOf="@+id/tv_app_name"
-            android:id="@+id/imageView3"
-            app:layout_constraintTop_toBottomOf="@+id/tv_login_title"/>
+        android:id="@+id/imageView3"
+        android:layout_width="76dp"
+        android:layout_height="76dp"
+        android:layout_marginTop="18dp"
+        android:src="@drawable/logo"
+        app:layout_constraintEnd_toEndOf="@+id/tv_app_name"
+        app:layout_constraintStart_toStartOf="@+id/tv_app_name"
+        app:layout_constraintTop_toBottomOf="@+id/tv_login_title" />
 
     <TextView
-            android:id="@+id/tv_app_name"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="@color/white"
-            android:layout_marginTop="4dp"
-            android:textSize="17dp"
-            android:text="小绵羊"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/imageView3"/>
+        android:id="@+id/tv_app_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="4dp"
+        android:text="小绵羊"
+        android:textColor="@color/white"
+        android:textSize="17dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/imageView3" />
 
-    <include layout="@layout/footer_third_login"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:layout_marginBottom="24dp"
-             app:layout_constraintBottom_toBottomOf="parent"
-             app:layout_constraintStart_toStartOf="parent"
-             app:layout_constraintEnd_toEndOf="parent"/>
+    <include
+        layout="@layout/footer_third_login"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="24dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
 
     <androidx.cardview.widget.CardView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="12dp"
+        android:layout_marginEnd="16dp"
+        app:cardCornerRadius="12dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/tv_app_name">
+
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:cardCornerRadius="12dp"
-            android:layout_marginTop="12dp"
-            android:layout_marginStart="16dp"
-            android:layout_marginEnd="16dp"
-            app:layout_constraintTop_toBottomOf="@id/tv_app_name"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toEndOf="parent">
+            android:orientation="vertical">
 
-        <LinearLayout
+            <LinearLayout
+                android:id="@+id/for_account_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:orientation="vertical">
+                android:layout_marginTop="16dp"
+                android:gravity="center"
+                android:orientation="vertical"
+                android:visibility="gone">
 
-            <LinearLayout
-                    android:id="@+id/for_account_container"
+                <EditText
+                    android:id="@+id/user_name_box"
+                    style="@style/login_edit_style_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="24dp"
+                    android:layout_marginEnd="24dp"
+                    android:hint="输入用户名(如常用英文或数字唯一标识)"
+                    android:maxLength="20"
+                    android:paddingStart="28dp"
+                    android:paddingTop="21dp"
+                    android:paddingEnd="28dp"
+                    android:paddingBottom="21dp" />
+
+
+                <androidx.constraintlayout.widget.ConstraintLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="16dp"
-                    android:gravity="center"
-                    android:visibility="gone"
-                    android:orientation="vertical">
+                    android:layout_marginTop="21dp"
+                    android:orientation="horizontal">
 
-                <EditText
-                        android:id="@+id/user_name_box"
+                    <EditText
+                        android:id="@+id/password_box"
+                        style="@style/login_edit_style_name"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginStart="24dp"
                         android:layout_marginEnd="24dp"
-                        style="@style/login_edit_style_name"
+                        android:hint="输入密码(6-16位)"
+                        android:inputType="textPassword"
+                        android:lines="1"
+                        android:maxLength="16"
                         android:paddingStart="28dp"
-                        android:paddingEnd="28dp"
                         android:paddingTop="21dp"
+                        android:paddingEnd="28dp"
                         android:paddingBottom="21dp"
-                        android:maxLength="20"
-                        android:hint="输入用户名(如常用英文或数字唯一标识)"/>
-
-
-                <androidx.constraintlayout.widget.ConstraintLayout
-                        android:orientation="horizontal"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="21dp">
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent" />
 
-                    <EditText
-                            android:id="@+id/password_box"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            app:layout_constraintStart_toStartOf="parent"
-                            app:layout_constraintEnd_toEndOf="parent"
-                            app:layout_constraintBottom_toBottomOf="parent"
-                            android:layout_marginStart="24dp"
-                            android:layout_marginEnd="24dp"
-                            style="@style/login_edit_style_name"
-                            android:paddingStart="28dp"
-                            android:paddingEnd="28dp"
-                            android:paddingTop="21dp"
-                            android:paddingBottom="21dp"
-                            android:hint="输入密码(6-16位)"
-                            android:inputType="textPassword"
-                            android:lines="1"
-                            android:maxLength="16"/>
                     <ImageView
-                            android:id="@+id/show_hide_pwd_btn"
-                            android:src="@mipmap/pwd_hide"
-                            android:tint="@color/bg_line"
-                            android:layout_marginEnd="@dimen/content_padding_12"
-                            android:padding="7dp"
-                            android:layout_width="30dp"
-                            android:layout_height="30dp" app:layout_constraintEnd_toEndOf="@+id/password_box" app:layout_constraintBottom_toBottomOf="@+id/password_box"
-                            app:layout_constraintTop_toTopOf="@+id/password_box"/>
+                        android:id="@+id/show_hide_pwd_btn"
+                        android:layout_width="30dp"
+                        android:layout_height="30dp"
+                        android:layout_marginEnd="@dimen/content_padding_12"
+                        android:padding="7dp"
+                        android:src="@mipmap/pwd_hide"
+                        android:tint="@color/bg_line"
+                        app:layout_constraintBottom_toBottomOf="@+id/password_box"
+                        app:layout_constraintEnd_toEndOf="@+id/password_box"
+                        app:layout_constraintTop_toTopOf="@+id/password_box" />
                 </androidx.constraintlayout.widget.ConstraintLayout>
 
                 <androidx.constraintlayout.widget.ConstraintLayout
-                        android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="24dp"
+                    android:layout_marginTop="21dp"
+                    android:layout_marginEnd="24dp"
+                    android:orientation="horizontal">
+
+                    <EditText
+                        android:id="@+id/password_box2"
+                        style="@style/login_edit_style_name"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:layout_marginStart="24dp"
-                        android:layout_marginEnd="24dp"
-                        android:layout_marginTop="21dp">
+                        android:hint="确认密码"
+                        android:inputType="textPassword"
+                        android:lines="1"
+                        android:maxLength="16"
+                        android:paddingStart="28dp"
+                        android:paddingTop="21dp"
+                        android:paddingEnd="28dp"
+                        android:paddingBottom="21dp"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent" />
 
-                    <EditText
-                            android:id="@+id/password_box2"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            app:layout_constraintStart_toStartOf="parent"
-                            app:layout_constraintEnd_toEndOf="parent"
-                            app:layout_constraintBottom_toBottomOf="parent"
-                            style="@style/login_edit_style_name"
-                            android:paddingStart="28dp"
-                            android:paddingEnd="28dp"
-                            android:paddingTop="21dp"
-                            android:paddingBottom="21dp"
-                            android:hint="确认密码"
-                            android:inputType="textPassword"
-                            android:lines="1"
-                            android:maxLength="16"/>
                     <ImageView
-                            android:id="@+id/show_hide_pwd_btn2"
-                            android:src="@mipmap/pwd_hide"
-                            android:tint="@color/bg_line"
-                            android:layout_marginEnd="@dimen/content_padding_12"
-                            android:padding="7dp"
-                            android:layout_width="30dp"
-                            android:layout_height="30dp"
-                            app:layout_constraintEnd_toEndOf="@+id/password_box2"
-                            app:layout_constraintBottom_toBottomOf="@+id/password_box2"
-                            app:layout_constraintTop_toTopOf="@+id/password_box2"/>
+                        android:id="@+id/show_hide_pwd_btn2"
+                        android:layout_width="30dp"
+                        android:layout_height="30dp"
+                        android:layout_marginEnd="@dimen/content_padding_12"
+                        android:padding="7dp"
+                        android:src="@mipmap/pwd_hide"
+                        android:tint="@color/bg_line"
+                        app:layout_constraintBottom_toBottomOf="@+id/password_box2"
+                        app:layout_constraintEnd_toEndOf="@+id/password_box2"
+                        app:layout_constraintTop_toTopOf="@+id/password_box2" />
                 </androidx.constraintlayout.widget.ConstraintLayout>
 
             </LinearLayout>
 
             <androidx.constraintlayout.widget.ConstraintLayout
-                    android:id="@+id/for_phone_container"
-                    android:visibility="visible"
+                android:id="@+id/for_phone_container"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:gravity="center"
+                android:visibility="visible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent">
+
+                <EditText
+                    android:id="@+id/phone_number_box"
+                    style="@style/login_edit_style_mobile"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="16dp"
-                    android:gravity="center"
-                    app:layout_constraintTop_toTopOf="parent"
+                    android:layout_marginStart="24dp"
+                    android:layout_marginEnd="24dp"
+                    android:background="@drawable/selector_login_edit_text"
+                    android:hint="请输入手机号"
+                    android:inputType="phone"
+                    android:maxLength="11"
+                    android:paddingStart="28dp"
+                    android:paddingTop="21dp"
+                    android:paddingEnd="28dp"
+                    android:paddingBottom="21dp"
+                    app:layout_constraintEnd_toEndOf="parent"
                     app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintEnd_toEndOf="parent">
+                    app:layout_constraintTop_toTopOf="parent" />
 
                 <EditText
-                        android:id="@+id/phone_number_box"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        app:layout_constraintTop_toTopOf="parent"
-                        app:layout_constraintStart_toStartOf="parent"
-                        app:layout_constraintEnd_toEndOf="parent"
-                        android:background="@drawable/selector_login_edit_text"
-                        style="@style/login_edit_style_mobile"
-                        android:hint="请输入手机号"
-                        android:layout_marginStart="24dp"
-                        android:layout_marginEnd="24dp"
-                        android:paddingStart="28dp"
-                        android:paddingEnd="28dp"
-                        android:paddingTop="21dp"
-                        android:paddingBottom="21dp"
-                        android:inputType="phone"
-                        android:maxLength="11"/>
-
-                <EditText
-                        android:id="@+id/captcha_box"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        style="@style/login_edit_style"
-                        app:layout_constraintTop_toBottomOf="@id/phone_number_box"
-                        android:background="@drawable/selector_login_edit_text"
-                        android:layout_marginStart="24dp"
-                        android:layout_marginEnd="24dp"
-                        android:paddingStart="28dp"
-                        android:paddingEnd="28dp"
-                        android:paddingTop="21dp"
-                        android:paddingBottom="21dp"
-                        android:hint="输入验证码"
-                        android:inputType="phone"
-                        android:maxLength="6"/>
+                    android:id="@+id/captcha_box"
+                    style="@style/login_edit_style"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="24dp"
+                    android:layout_marginEnd="24dp"
+                    android:background="@drawable/selector_login_edit_text"
+                    android:hint="输入验证码"
+                    android:inputType="phone"
+                    android:maxLength="6"
+                    android:paddingStart="28dp"
+                    android:paddingTop="21dp"
+                    android:paddingEnd="28dp"
+                    android:paddingBottom="21dp"
+                    app:layout_constraintTop_toBottomOf="@id/phone_number_box" />
 
                 <com.sheep.gamegroup.view.customview.CountDownButton
-                        android:id="@+id/send_captcha_btn"
-                        android:layout_width="wrap_content"
-                        android:layout_height="25dp"
-                        android:layout_marginEnd="12dp"
-                        android:background="@null"
-                        android:text="获取验证码"
-                        android:textColor="#4266B2"
-                        android:textSize="12sp"
-                        app:layout_constraintEnd_toEndOf="@+id/captcha_box"
-                        app:layout_constraintBottom_toBottomOf="@+id/captcha_box"
-                        app:layout_constraintTop_toTopOf="@+id/captcha_box"/>
+                    android:id="@+id/send_captcha_btn"
+                    android:layout_width="wrap_content"
+                    android:layout_height="25dp"
+                    android:layout_marginEnd="12dp"
+                    android:background="@null"
+                    android:text="获取验证码"
+                    android:textColor="#4266B2"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="@+id/captcha_box"
+                    app:layout_constraintEnd_toEndOf="@+id/captcha_box"
+                    app:layout_constraintTop_toTopOf="@+id/captcha_box" />
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <LinearLayout
-                    android:id="@+id/tel_agreement_ll"
+                android:id="@+id/tel_agreement_ll"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="start"
+                android:layout_marginStart="32dp"
+                android:layout_marginTop="21dp"
+                android:layout_marginBottom="24dp"
+                android:gravity="center"
+                android:orientation="horizontal"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/register_btn">
+
+                <androidx.appcompat.widget.AppCompatCheckBox
+                    android:id="@+id/tel_agreement_cb"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="start"
-                    android:layout_marginStart="54dp"
-                    app:layout_constraintTop_toBottomOf="@id/register_btn"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    android:orientation="horizontal"
-                    android:layout_marginTop="21dp"
-                    android:layout_marginBottom="24dp"
-                    android:gravity="center">
-                <androidx.appcompat.widget.AppCompatCheckBox
-                        android:id="@+id/tel_agreement_cb"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:button="@drawable/drawable_selector_check"/>
+                    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="8dp"
-                        android:text="我已阅读并同意《小绵羊用户协议》"
-                        android:textColor="@color/black_333333"
-                        android:textSize="12sp"/>
+                    android:id="@+id/tel_agreement_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="8dp"
+                    android:text="我已阅读并同意《隐私政策》和《用户协议》"
+                    android:textColor="@color/black_333333"
+                    android:textSize="12sp" />
             </LinearLayout>
 
             <Button
-                    android:id="@+id/register_btn"
-                    style="@style/login_theme_round_button"
-                    android:layout_marginStart="24dp"
-                    android:layout_marginEnd="24dp"
-                    android:layout_marginTop="16dp"
-                    android:textSize="13dp"
-                    android:text="注册"/>
+                android:id="@+id/register_btn"
+                style="@style/login_theme_round_button"
+                android:layout_marginStart="24dp"
+                android:layout_marginTop="16dp"
+                android:layout_marginEnd="24dp"
+                android:text="注册"
+                android:textSize="13dp" />
 
             <TextView
-                    android:id="@+id/back_login_btn"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="返回登录"
-                    android:padding="8dp"
-                    android:layout_marginTop="12dp"
-                    android:layout_gravity="center"
-                    android:textColor="@color/blue_34a6e7"
-                    android:textSize="12dp"
-                    android:layout_marginBottom="@dimen/content_padding_24"
-                    app:layout_constraintStart_toStartOf="@+id/login_btn"
-                    app:layout_constraintTop_toBottomOf="@+id/login_btn"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintEnd_toEndOf="@+id/login_btn"/>
+                android:id="@+id/back_login_btn"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:layout_marginTop="12dp"
+                android:layout_marginBottom="@dimen/content_padding_24"
+                android:padding="8dp"
+                android:text="返回登录"
+                android:textColor="@color/blue_34a6e7"
+                android:textSize="12dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="@+id/login_btn"
+                app:layout_constraintStart_toStartOf="@+id/login_btn"
+                app:layout_constraintTop_toBottomOf="@+id/login_btn" />
 
 
         </LinearLayout>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -2,7 +2,7 @@
     <string name="close_pay_password"><u>关闭支付密码</u></string>
     <string name="get_captcha">获取验证码</string>
     <string name="input_your_phone">请输入你的手机号</string>
-    <string name="input_your_captcha">请输验证码</string>
+    <string name="input_your_captcha">请输验证码</string>
     <string name="toast_warning_phone_captcha_image_code_size">短信验证码为6位</string>
     <string name="toast_warning_phone_number_size">手机号码为11位</string>
     <string name="bind_weixin_notice_text">请用需要绑定的微信号关注微信公众号\"小绵羊领头羊\",在公众号中点击验证码或输入\"验证码\"三个字获取验证码并填入下方</string>

+ 1 - 1
gradle.properties

@@ -21,7 +21,7 @@ VERSION_NAME=3.9.2
 VERSION_CODE=3009002
 ANDROID_COMPILE_SDK_VERSION=30
 ANDROID_MIN_SDK_VERSION=21
-ANDORID_TARGET_SDK_VERSION=28
+ANDORID_TARGET_SDK_VERSION=30
 
 POM_DESCRIPTION=Android Library for cropping images
 POM_URL=https://github.com/Yalantis/uCrop