Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IMSDK_Demo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王文龙
IMSDK_Demo
Commits
245064d4
Commit
245064d4
authored
Jan 14, 2021
by
王文龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add]添加隐私协议功能
parent
8db54f95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
4 deletions
+64
-4
build.gradle
app/build.gradle
+1
-1
LoginActivity.java
app/src/main/java/com/offcn/imclient/ui/LoginActivity.java
+18
-3
activity_login.xml
app/src/main/res/layout/activity_login.xml
+45
-0
No files found.
app/build.gradle
View file @
245064d4
...
...
@@ -16,7 +16,7 @@ android {
minSdkVersion
19
targetSdkVersion
29
versionCode
1
versionName
"1.0"
versionName
"1.0
.0
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
...
...
app/src/main/java/com/offcn/imclient/ui/LoginActivity.java
View file @
245064d4
...
...
@@ -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
)
{
...
...
app/src/main/res/layout/activity_login.xml
View file @
245064d4
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment