Commit 245064d4 by 王文龙

[add]添加隐私协议功能

parent 8db54f95
......@@ -16,7 +16,7 @@ android {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
......@@ -9,6 +9,7 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
......@@ -16,8 +17,10 @@ import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.jyall.base.base.BaseActivity;
import com.jyall.base.base.H5Activity;
import com.jyall.base.util.CommonUtils;
import com.jyall.base.util.ValidateUtils;
import com.offcn.imclient.BuildConfig;
import com.offcn.imclient.R;
import com.offcn.imclient.bean.UserBean;
import com.offcn.imclient.util.LoginManager;
......@@ -27,6 +30,9 @@ import com.offcn.live.im.util.ZGLParseUtils;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
/**
* 登录页
*
......@@ -37,10 +43,11 @@ public class LoginActivity extends BaseActivity {
private static final String TAG = LoginActivity.class.getSimpleName();
EditText mEtName, mEtPwd;
TextView mTvLogin;
TextView mTvLogin, mTvVersion, mTvPrivacy;
ImageView mIvClear, mIvEye;
private boolean isShowPassWord = true;
private static final String URL_PRIVACY = "http://xue.eoffcn.com/web/onlineschool_agreement.html";
@Override
protected int getContentViewLayoutId() {
......@@ -52,9 +59,17 @@ public class LoginActivity extends BaseActivity {
mEtName = findViewById(R.id.et_name);
mEtPwd = findViewById(R.id.et_pwd);
mTvLogin = findViewById(R.id.tv_login);
mTvVersion = findViewById(R.id.tv_version);
mTvPrivacy = findViewById(R.id.tv_privacy);
mIvClear = findViewById(R.id.iv_delete);
mIvEye = findViewById(R.id.iv_eye);
mTvVersion.setText("V" + BuildConfig.VERSION_NAME);
mTvPrivacy.setOnClickListener(v -> {
if (!CommonUtils.isFastDoubleClick()) {
H5Activity.open(LoginActivity.this, H5Activity.class, "隐私协议", URL_PRIVACY);
}
});
mIvClear.setOnClickListener(v -> mEtName.setText(""));
mEtName.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mIvEye.setOnClickListener(v -> {
......@@ -146,8 +161,8 @@ public class LoginActivity extends BaseActivity {
dismissLoading();
CommonUtils.showToast(LoginActivity.this, error.toString());
}
}
);
});
requestQueue.add(jsonObjectRequest);
} catch (Exception e) {
......
<?xml version="1.0" encoding="utf-8"?>
<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:layout_margin="20dp"
......@@ -105,5 +106,48 @@
android:textSize="16sp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom|center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="V1.0.0"
android:textColor="@color/color_999999"
tools:text="V1.0.0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录即代表你同意《"
android:textColor="@color/color_999999"
android:textSize="10sp" />
<TextView
android:id="@+id/tv_privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="隐私协议"
android:textColor="#1890ff"
android:textSize="10sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="》"
android:textColor="@color/color_999999"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment