Commit e9ce8a9c by 王文龙

[update]完善UI

parent 263ece91
......@@ -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);
......
......@@ -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,
......
......@@ -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
......
......@@ -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"/>
......
......@@ -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
......@@ -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" />
......
<?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
......@@ -4,7 +4,7 @@
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="windowNoTitle">true</item>
</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