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
e9ce8a9c
Commit
e9ce8a9c
authored
Dec 16, 2020
by
王文龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update]完善UI
parent
263ece91
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
15 deletions
+49
-15
ContactListExpandableAdapter.java
.../offcn/imclient/adapter/ContactListExpandableAdapter.java
+3
-2
LoginActivity.java
app/src/main/java/com/offcn/imclient/ui/LoginActivity.java
+17
-6
MainActivity.java
app/src/main/java/com/offcn/imclient/ui/MainActivity.java
+1
-1
activity_chat.xml
app/src/main/res/layout/activity_chat.xml
+1
-0
activity_login.xml
app/src/main/res/layout/activity_login.xml
+12
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
item_contact_group.xml
app/src/main/res/layout/item_contact_group.xml
+13
-5
styles.xml
app/src/main/res/values/styles.xml
+1
-1
No files found.
app/src/main/java/com/offcn/imclient/adapter/ContactListExpandableAdapter.java
View file @
e9ce8a9c
...
...
@@ -109,11 +109,12 @@ public class ContactListExpandableAdapter extends AnimatedExpandableListView.Ani
}
holder
.
title
.
setText
(
item
.
getKey
());
int
itemCount
=
0
;
int
itemCount
=
1
;
if
(!
ValidateUtils
.
isEmpty
(
item
.
getList
()))
{
itemCount
=
item
.
getList
().
size
();
}
if
(
itemCount
==
0
)
{
--
itemCount
;
if
(
itemCount
<=
0
)
{
holder
.
count
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
count
.
setVisibility
(
View
.
VISIBLE
);
...
...
app/src/main/java/com/offcn/imclient/ui/LoginActivity.java
View file @
e9ce8a9c
...
...
@@ -14,6 +14,7 @@ import com.android.volley.toolbox.JsonObjectRequest;
import
com.android.volley.toolbox.Volley
;
import
com.jyall.base.base.BaseActivity
;
import
com.jyall.base.util.CommonUtils
;
import
com.jyall.base.util.ValidateUtils
;
import
com.offcn.imclient.R
;
import
com.offcn.imclient.bean.UserBean
;
import
com.offcn.imclient.util.LoginManager
;
...
...
@@ -48,7 +49,15 @@ public class LoginActivity extends BaseActivity {
mTvLogin
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
login
();
String
name
=
mEtName
.
getText
().
toString
().
trim
();
String
pwd
=
mEtPwd
.
getText
().
toString
().
trim
();
login
(
name
,
pwd
);
}
});
findViewById
(
R
.
id
.
tv_login_test
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
login
(
"lqy62094"
,
"lqy62094"
);
}
});
}
...
...
@@ -60,14 +69,16 @@ public class LoginActivity extends BaseActivity {
}
private
void
login
()
{
String
name
=
mEtName
.
getText
().
toString
().
trim
();
String
pwd
=
mEtPwd
.
getText
().
toString
().
trim
();
private
void
login
(
String
name
,
String
pwd
)
{
if
(
ValidateUtils
.
isEmpty
(
name
)
||
ValidateUtils
.
isEmpty
(
pwd
))
{
CommonUtils
.
showToast
(
this
,
"请输入用户名或密码"
);
return
;
}
try
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"username"
,
"lqy62094"
);
jsonObject
.
put
(
"password"
,
"lqy62094"
);
jsonObject
.
put
(
"username"
,
name
);
jsonObject
.
put
(
"password"
,
pwd
);
RequestQueue
requestQueue
=
Volley
.
newRequestQueue
(
this
);
JsonObjectRequest
jsonObjectRequest
=
new
JsonObjectRequest
(
Request
.
Method
.
POST
,
"http://api.study.t.eoffcn.com/web/v2/im/login"
,
jsonObject
,
...
...
app/src/main/java/com/offcn/imclient/ui/MainActivity.java
View file @
e9ce8a9c
...
...
@@ -61,7 +61,7 @@ public class MainActivity extends BaseActivity {
@Override
public
void
onStateConnected
()
{
ZGLLogUtils
.
e
(
TAG
,
"IM连接成功"
);
ZGLCommonUtils
.
showToast
(
MainActivity
.
this
,
"IM连接成功"
);
//
ZGLCommonUtils.showToast(MainActivity.this, "IM连接成功");
}
@Override
...
...
app/src/main/res/layout/activity_chat.xml
View file @
e9ce8a9c
...
...
@@ -9,6 +9,7 @@
<com.jyall.titleview.TitleView
android:id=
"@+id/title_view"
android:background=
"@android:color/white"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
...
...
app/src/main/res/layout/activity_login.xml
View file @
e9ce8a9c
...
...
@@ -36,5 +36,16 @@
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_login_test"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginTop=
"50dp"
android:background=
"@color/colorPrimary"
android:gravity=
"center"
android:text=
"测试一键登录(lqy62094)"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
e9ce8a9c
...
...
@@ -7,6 +7,7 @@
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/tab_layout"
style=
"@style/MyTablayoutstyle"
android:layout_alignParentBottom=
"true"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
...
...
app/src/main/res/layout/item_contact_group.xml
View file @
e9ce8a9c
<?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=
"50dp"
android:gravity=
"center_vertical"
...
...
@@ -7,20 +8,26 @@
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
/>
android:layout_marginLeft=
"5dp"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:singleLine=
"true"
tools:text=
"我是课程标题我是课程标题我是课程标题我是课程标题我是课程标题我是课程标题我是课程标题"
/>
<TextView
android:id=
"@+id/tv_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
/>
android:layout_marginLeft=
"10dp"
tools:text=
"25人"
/>
<ImageView
android:id=
"@+id/iv_chat"
android:src=
"@mipmap/ic_teacher"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:src=
"@mipmap/ic_teacher"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
e9ce8a9c
...
...
@@ -4,7 +4,7 @@
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/color
Accent
</item>
<item
name=
"colorAccent"
>
@color/color
Primary
</item>
<item
name=
"windowNoTitle"
>
true
</item>
</style>
...
...
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