Commit e9ce8a9c by 王文龙

[update]完善UI

parent 263ece91
...@@ -109,11 +109,12 @@ public class ContactListExpandableAdapter extends AnimatedExpandableListView.Ani ...@@ -109,11 +109,12 @@ public class ContactListExpandableAdapter extends AnimatedExpandableListView.Ani
} }
holder.title.setText(item.getKey()); holder.title.setText(item.getKey());
int itemCount = 0; int itemCount = 1;
if (!ValidateUtils.isEmpty(item.getList())) { if (!ValidateUtils.isEmpty(item.getList())) {
itemCount = item.getList().size(); itemCount = item.getList().size();
} }
if (itemCount == 0) { --itemCount;
if (itemCount <= 0) {
holder.count.setVisibility(View.GONE); holder.count.setVisibility(View.GONE);
} else { } else {
holder.count.setVisibility(View.VISIBLE); holder.count.setVisibility(View.VISIBLE);
......
...@@ -14,6 +14,7 @@ import com.android.volley.toolbox.JsonObjectRequest; ...@@ -14,6 +14,7 @@ import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley; import com.android.volley.toolbox.Volley;
import com.jyall.base.base.BaseActivity; import com.jyall.base.base.BaseActivity;
import com.jyall.base.util.CommonUtils; import com.jyall.base.util.CommonUtils;
import com.jyall.base.util.ValidateUtils;
import com.offcn.imclient.R; import com.offcn.imclient.R;
import com.offcn.imclient.bean.UserBean; import com.offcn.imclient.bean.UserBean;
import com.offcn.imclient.util.LoginManager; import com.offcn.imclient.util.LoginManager;
...@@ -48,7 +49,15 @@ public class LoginActivity extends BaseActivity { ...@@ -48,7 +49,15 @@ public class LoginActivity extends BaseActivity {
mTvLogin.setOnClickListener(new View.OnClickListener() { mTvLogin.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { 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 { ...@@ -60,14 +69,16 @@ public class LoginActivity extends BaseActivity {
} }
private void login() { private void login(String name, String pwd) {
String name = mEtName.getText().toString().trim(); if (ValidateUtils.isEmpty(name) || ValidateUtils.isEmpty(pwd)) {
String pwd = mEtPwd.getText().toString().trim(); CommonUtils.showToast(this, "请输入用户名或密码");
return;
}
try { try {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("username", "lqy62094"); jsonObject.put("username", name);
jsonObject.put("password", "lqy62094"); jsonObject.put("password", pwd);
RequestQueue requestQueue = Volley.newRequestQueue(this); RequestQueue requestQueue = Volley.newRequestQueue(this);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, "http://api.study.t.eoffcn.com/web/v2/im/login", jsonObject, JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, "http://api.study.t.eoffcn.com/web/v2/im/login", jsonObject,
......
...@@ -61,7 +61,7 @@ public class MainActivity extends BaseActivity { ...@@ -61,7 +61,7 @@ public class MainActivity extends BaseActivity {
@Override @Override
public void onStateConnected() { public void onStateConnected() {
ZGLLogUtils.e(TAG, "IM连接成功"); ZGLLogUtils.e(TAG, "IM连接成功");
ZGLCommonUtils.showToast(MainActivity.this, "IM连接成功"); // ZGLCommonUtils.showToast(MainActivity.this, "IM连接成功");
} }
@Override @Override
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<com.jyall.titleview.TitleView <com.jyall.titleview.TitleView
android:id="@+id/title_view" android:id="@+id/title_view"
android:background="@android:color/white"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -36,5 +36,16 @@ ...@@ -36,5 +36,16 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="16sp" /> 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> </LinearLayout>
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
style="@style/MyTablayoutstyle"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" /> android:layout_height="50dp" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:gravity="center_vertical" android:gravity="center_vertical"
...@@ -7,20 +8,26 @@ ...@@ -7,20 +8,26 @@
<TextView <TextView
android:id="@+id/tv_name" android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" 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 <TextView
android:id="@+id/tv_count" android:id="@+id/tv_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" /> android:layout_marginLeft="10dp"
tools:text="25人" />
<ImageView <ImageView
android:id="@+id/iv_chat" android:id="@+id/iv_chat"
android:src="@mipmap/ic_teacher"
android:layout_width="wrap_content" 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> </LinearLayout>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorPrimary</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
......
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