feat:完善公聊厅UI

feat:公聊厅列表增加数量限制
This commit is contained in:
max
2024-05-09 21:47:06 +08:00
parent c986a2dce6
commit af0ba80b30
40 changed files with 838 additions and 373 deletions

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<padding
android:left="15dp"
android:top="12dp"
android:right="12dp"
android:bottom="15dp" />
<corners android:bottomLeftRadius="12dp"
android:bottomRightRadius="12dp"
android:topLeftRadius="12dp"
android:topRightRadius="2dp"/>
<solid android:color="#52CAD3"/>
</shape>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<padding
android:left="12dp"
android:top="12dp"
android:right="15dp"
android:bottom="15dp" />
<corners android:topRightRadius="12dp"
android:topLeftRadius="2dp"
android:bottomRightRadius="12dp"
android:bottomLeftRadius="12dp"/>
<solid android:color="#F2F3FB"/>
</shape>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<padding
android:left="12dp"
android:top="12dp"
android:right="15dp"
android:bottom="15dp" />
<corners android:bottomLeftRadius="12dp"
android:bottomRightRadius="12dp"
android:topLeftRadius="2dp"
android:topRightRadius="12dp"/>
<solid android:color="#52CAD3"/>
</shape>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<padding
android:left="12dp"
android:top="12dp"
android:right="15dp"
android:bottom="15dp" />
<corners android:topRightRadius="2dp"
android:topLeftRadius="12dp"
android:bottomRightRadius="12dp"
android:bottomLeftRadius="12dp"/>
<solid android:color="#F2F3FB"/>
</shape>

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:paddingStart="15dp"
android:paddingEnd="15dp">
<TextView
android:id="@+id/message_item_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/bubble_time_layout_margin_bottom"
android:layout_marginTop="@dimen/bubble_time_layout_margin_top"
android:paddingStart="7dip"
android:paddingEnd="7dip"
android:textColor="#666666"
android:textSize="11sp"
android:visibility="gone" />
<com.netease.nim.uikit.common.ui.imageview.HeadImageView
android:id="@+id/message_item_portrait_left"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentStart="true"
android:layout_below="@id/message_item_time"
android:layout_marginEnd="8dp"
android:visibility="gone"
tools:visibility="visible" />
<com.netease.nim.uikit.common.ui.imageview.HeadImageView
android:id="@+id/message_item_portrait_right"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentEnd="true"
android:layout_below="@id/message_item_time"
android:layout_marginStart="8dp"
android:visibility="gone" />
<LinearLayout
android:layout_marginTop="10dp"
android:id="@+id/message_item_name_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/message_item_time"
android:layout_toStartOf="@id/message_item_portrait_right"
android:layout_toEndOf="@id/message_item_portrait_left"
android:orientation="horizontal">
<ImageView
android:id="@+id/message_item_name_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<TextView
android:layout_marginBottom="10dp"
android:id="@+id/message_item_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxWidth="200dip"
android:singleLine="true"
android:textColor="#333333"
android:textSize="14sp"
android:visibility="gone" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/message_item_name_layout"
android:layout_toStartOf="@id/message_item_portrait_right"
android:layout_toEndOf="@id/message_item_portrait_left">
<LinearLayout
android:id="@+id/message_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="bottom"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/message_item_progress"
android:layout_width="20dip"
android:layout_height="20dip"
android:layout_gravity="center"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:indeterminate="true"
android:indeterminateDrawable="@drawable/nim_progress_small_white"
android:visibility="gone" />
<ImageView
android:id="@+id/message_item_alert"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:src="@drawable/nim_ic_failed"
android:visibility="gone" />
<include layout="@layout/nim_read_recipt_layout" />
<FrameLayout
android:id="@+id/message_item_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@android:color/transparent" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>

View File

@@ -3,6 +3,7 @@ package com.netease.nim.uikit.api.model.chatroom;
import com.netease.nim.uikit.api.model.SimpleCallback;
import com.netease.nimlib.sdk.chatroom.constant.MemberQueryType;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
import java.util.List;

View File

@@ -58,7 +58,7 @@ public class TimeUtil {
}
public static String getNowDatetime() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH);
return (formatter.format(new Date()));
}
@@ -69,7 +69,7 @@ public class TimeUtil {
public static String getNowDateTime(String format) {
Date date = new Date();
SimpleDateFormat df = new SimpleDateFormat(format, Locale.getDefault());
SimpleDateFormat df = new SimpleDateFormat(format, Locale.ENGLISH);
return df.format(date);
}
@@ -85,7 +85,7 @@ public class TimeUtil {
TimeZone timezone = TimeZone.getTimeZone("Asia/Shanghai");
Date date = new Date(currentTimeMillis());
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
formatter.setTimeZone(timezone);
GregorianCalendar gregorianCalendar = new GregorianCalendar();
@@ -99,7 +99,7 @@ public class TimeUtil {
TimeZone timezone = TimeZone.getTimeZone("Asia/Shanghai");
Date date = new Date(currentTimeMillis());
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
formatter.setTimeZone(timezone);
return formatter.format(date);
@@ -107,7 +107,7 @@ public class TimeUtil {
public static String getDateTimeString(long milliseconds, String format) {
Date date = new Date(milliseconds);
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.getDefault());
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
return formatter.format(date);
}
@@ -118,10 +118,10 @@ public class TimeUtil {
Date date = new Date(milliseconds);
Date firstDateThisYear = new Date(today.getYear(), 0, 0);
if (!date.before(firstDateThisYear)) {
SimpleDateFormat dateformatter = new SimpleDateFormat("MM-dd", Locale.getDefault());
SimpleDateFormat dateformatter = new SimpleDateFormat("MM-dd", Locale.ENGLISH);
showDataString = dateformatter.format(date);
} else {
SimpleDateFormat dateformatter = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
SimpleDateFormat dateformatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
showDataString = dateformatter.format(date);
}
return showDataString;
@@ -151,11 +151,11 @@ public class TimeUtil {
} else if (isSameWeekDates(currentTime, today)) {
dataString = getWeekOfDate(currentTime);
} else {
SimpleDateFormat dateformatter = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
SimpleDateFormat dateformatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
dataString = dateformatter.format(currentTime);
}
SimpleDateFormat timeformatter24 = new SimpleDateFormat("HH:mm", Locale.getDefault());
SimpleDateFormat timeformatter24 = new SimpleDateFormat("HH:mm", Locale.ENGLISH);
timeStringBy24 = timeformatter24.format(currentTime);
if (abbreviate) {
@@ -178,8 +178,8 @@ public class TimeUtil {
public static String getTodayTimeBucket(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
SimpleDateFormat timeformatter0to11 = new SimpleDateFormat("KK:mm", Locale.getDefault());
SimpleDateFormat timeformatter1to12 = new SimpleDateFormat("hh:mm", Locale.getDefault());
SimpleDateFormat timeformatter0to11 = new SimpleDateFormat("KK:mm", Locale.ENGLISH);
SimpleDateFormat timeformatter1to12 = new SimpleDateFormat("hh:mm", Locale.ENGLISH);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
if (hour >= 0 && hour < 5) {
return ResUtil.getString(R.string.util_sys_timeutil_06) + timeformatter0to11.format(date);