UI细节优化:房间推荐列表,组队开黑列表,房间返回按钮,喜欢关注的人UI修改

This commit is contained in:
huangjian
2022-05-09 16:58:42 +08:00
parent d280e55182
commit fcf1959377
29 changed files with 111 additions and 36 deletions

View File

@@ -1,12 +1,11 @@
package com.yizhuan.erban.avroom.adapter
import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yizhuan.erban.R
import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.erban.ui.widget.LivingIconView
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
class ExitRoomAdapter :
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_exit_room) {
@@ -16,9 +15,6 @@ class ExitRoomAdapter :
ImageLoadUtils.loadImage(mContext, item.avatar, helper.getView(R.id.iv_avatar))
ImageLoadUtils.loadImage(mContext, item.tagPict, helper.getView(R.id.iv_tag))
helper.setText(R.id.tv_online_num, item.onlineNum.toString())
.setText(R.id.tv_title, item.title)
val livingIconView = helper.getView<LivingIconView>(R.id.liv_living_icon)
livingIconView.setColor(Color.WHITE)
livingIconView.start()
.setText(R.id.tv_title, item.title.subAndReplaceDot(8))
}
}

View File

@@ -215,6 +215,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
ivFollowRoom.setOnClickListener(this);
ivRoomShare.setOnClickListener(this);
gameMainBinding.llRoomInfo.setOnClickListener(this);
gameMainBinding.ivBack.setOnClickListener(this);
}
@SuppressLint("CheckResult")
@@ -507,6 +508,11 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
case R.id.iv_follow_room:
followRoom();
break;
case R.id.iv_back:
if (getActivity() instanceof AVRoomActivity) {
((AVRoomActivity) getActivity()).onBackPressed();
}
break;
default:
}
}

View File

@@ -1,7 +1,10 @@
package com.yizhuan.erban.home.adapter
import android.graphics.Color
import android.graphics.LinearGradient
import android.graphics.Shader
import android.widget.ImageView
import android.widget.TextView
import androidx.core.view.isGone
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseQuickAdapter
@@ -14,6 +17,7 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
import com.yizhuan.erban.ui.utils.load
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
import com.yizhuan.xchat_android_core.utils.TextUtils
import com.yizhuan.xchat_android_core.utils.ifNullOrEmpty
/**
* create by lvzebiao @2019/11/13
@@ -34,6 +38,13 @@ class HomePlayAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>(
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
helper.setText(R.id.tv_online_number, "${item.onlineNum}")
val tvMgName = helper.getView<TextView>(R.id.tv_mg_name)
tvMgName.text = item.mgName.ifNullOrEmpty { "扩列交友" }
if (item.mgName.isNullOrEmpty()) {
setGradient(tvMgName, "#FF8C5FFF", "#FFFF969B")
} else {
setGradient(tvMgName, "#FF61C4FE", "#FFA979FF")
}
val avatars: Array<ImageView> = arrayOf(
helper.getView(R.id.iv_avatar_0),
helper.getView(R.id.iv_avatar_1),
@@ -64,4 +75,16 @@ class HomePlayAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>(
}
}
private fun setGradient(textView: TextView, startColor: String, endColor: String) {
val endX = textView.paint.textSize * textView.text.length
val linearGradient = LinearGradient(
0f, 0f, endX, 0f,
Color.parseColor(startColor),
Color.parseColor(endColor),
Shader.TileMode.CLAMP
)
textView.paint.shader = linearGradient
textView.invalidate()
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -10,6 +10,4 @@
<item android:drawable="@drawable/concerns_00007" android:duration="80" />
<item android:drawable="@drawable/concerns_00008" android:duration="80" />
<item android:drawable="@drawable/concerns_00009" android:duration="80" />
<item android:drawable="@drawable/concerns_00010" android:duration="80" />
<item android:drawable="@drawable/concerns_00011" android:duration="80" />
</animation-list>

View File

@@ -63,13 +63,21 @@
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="152dp"
android:text="为你推荐"
android:textColor="@color/white"
android:textSize="14sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_marginTop="152dp"
android:layout_marginTop="177dp"
android:clipToPadding="false"
android:paddingBottom="20dp" />
@@ -86,7 +94,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="努力寻找中..."
android:text="努力寻找合适房间中..."
android:textColor="@color/white"
android:textSize="12sp" />
@@ -98,9 +106,9 @@
android:background="@drawable/bg_common_confirm"
android:gravity="center"
android:text="查看更多"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="15sp" />
android:textSize="15sp"
android:visibility="gone" />
</LinearLayout>

View File

@@ -32,11 +32,19 @@
android:layout_marginTop="40dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="32dp"
android:layout_height="32dp"
android:scaleType="center"
android:layout_marginStart="5dp"
android:src="@drawable/arrow_left_white" />
<LinearLayout
android:id="@+id/ll_room_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginStart="5dp"
android:orientation="vertical">
<LinearLayout
@@ -133,6 +141,7 @@
android:id="@+id/ll_change_game"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginEnd="6dp"
android:background="@drawable/bg_room_select_game"
android:orientation="vertical"
@@ -140,7 +149,6 @@
android:paddingTop="2dp"
android:paddingEnd="8dp"
android:paddingBottom="2dp"
android:layout_marginTop="5dp"
android:visibility="gone"
tools:visibility="visible">
@@ -183,25 +191,25 @@
android:id="@+id/iv_follow_room"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="center"
android:layout_marginTop="2dp"
android:scaleType="center"
android:src="@drawable/icon_room_like" />
<ImageView
android:id="@+id/iv_room_share"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="center"
android:layout_marginTop="2dp"
android:scaleType="center"
android:src="@drawable/ic_share_white" />
<ImageView
android:id="@+id/room_more"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="11dp"
android:scaleType="center"
android:layout_marginTop="2dp"
android:src="@drawable/icon_room_more" />
</LinearLayout>

View File

@@ -6,6 +6,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_marginEnd="6dp"
tools:background="@color/blue">
@@ -51,19 +52,14 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/tag_101" />
<com.yizhuan.erban.ui.widget.LivingIconView
android:id="@+id/liv_living_icon"
android:layout_width="6dp"
android:layout_height="8dp"
android:layout_marginStart="12dp"
android:background="@color/transparent" />
<TextView
android:id="@+id/tv_online_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginStart="12dp"
android:drawableStart="@drawable/ic_home_hot_hot"
android:textColor="@color/white"
android:drawablePadding="3dp"
android:textSize="12sp"
tools:text="77" />

View File

@@ -7,7 +7,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
tools:background="@color/red">
tools:background="@color/blue">
<FrameLayout
android:id="@+id/fl_room_history_avatar_container"
@@ -30,22 +30,35 @@
android:layout_height="56dp"
android:background="@drawable/bg_avatar_concerns" />
<View
android:id="@+id/view_living"
android:layout_width="24dp"
android:layout_height="10dp"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="3dp"
android:background="@drawable/anim_concerns_living_icon" />
android:gravity="center">
<View
android:id="@+id/view_living"
android:layout_width="8dp"
android:layout_height="7dp"
android:background="@drawable/anim_concerns_living_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:text="直播"
android:textColor="@color/white"
android:textSize="8sp" />
</LinearLayout>
</FrameLayout>
<TextView
android:id="@+id/tv_room_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="@color/color_333333"
android:textSize="12dp"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -56,6 +56,17 @@
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
tools:src="@drawable/tag_101" />
<TextView
android:id="@+id/tv_mg_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:layout_marginEnd="40dp"
android:textColor="@color/white"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="狼人杀" />
<TextView
android:id="@+id/tv_online_number"
@@ -68,8 +79,9 @@
android:includeFontPadding="false"
android:textColor="@color/color_333333"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@id/fl_avatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_room_title"
app:layout_constraintTop_toTopOf="@id/fl_avatar"
tools:text="266" />
<FrameLayout

View File

@@ -70,6 +70,17 @@
app:layout_constraintTop_toBottomOf="@id/tv_broad_msg"
tools:src="@drawable/tag_101" />
<TextView
android:id="@+id/tv_mg_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:layout_marginEnd="40dp"
android:textColor="#ffffffff"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="狼人杀" />
<TextView
android:id="@+id/tv_online_number"
@@ -83,7 +94,8 @@
android:textColor="@color/color_333333"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_room_title"
app:layout_constraintTop_toTopOf="@id/fl_avatar"
app:layout_constraintBottom_toBottomOf="@id/fl_avatar"
tools:text="266" />

View File

@@ -252,8 +252,11 @@ public class LocalMusicListFragment extends BaseMvpFragment<ILocalMusicListView,
private void getAudioDuration() {
stopGetAudioDuration(false);
mDisposable = Observable.interval(0, 1, TimeUnit.SECONDS).subscribeOn(Schedulers.single())
.observeOn(AndroidSchedulers.mainThread()).subscribe(aLong -> {
mDisposable = Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.single())
.observeOn(AndroidSchedulers.mainThread())
.compose(bindToLifecycle())
.subscribe(aLong -> {
int duration = AudioEngineManager.get().getAudioMixingDuration();
int position = AudioEngineManager.get().getAudioMixingCurrentPosition();
setAudioCurrentPosition(position, duration);