1.UI对稿

2.交友扩列循环逻辑修改
This commit is contained in:
huangjian
2020-12-03 17:59:54 +08:00
parent 91aefefa27
commit b766e92b81
6 changed files with 27 additions and 29 deletions

View File

@@ -1090,10 +1090,10 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
.append(targetNicks.get(0), new ForegroundColorSpan(Color.WHITE));
String enterText = " 进入了房间 ";
if (fromType == AVRoomActivity.FROM_TYPE_RECOMMEND) {
enterText = " 根据首页推荐进";
enterText = " 根据首页推荐进入了房间";
}
if (fromType == AVRoomActivity.FROM_TYPE_USER) {
enterText = " 跟随 " + fromNick + "";
enterText = " 跟随 " + fromNick + "入了房间";
}
text.append(enterText, new ForegroundColorSpan(Color.WHITE));
textView.setText(text.build());

View File

@@ -2200,11 +2200,11 @@ public class MessageView extends FrameLayout {
.append(carName, new ForegroundColorSpan(roomTipColor));
String enterText = " 进入了房间 ";
if (fromType == AVRoomActivity.FROM_TYPE_RECOMMEND) {
enterText = " 根据首页推荐进";
enterText = " 根据首页推荐进入了房间";
}
if (fromType == AVRoomActivity.FROM_TYPE_USER) {
String finalFromUid = fromUid;
text.append(" 跟随 ")
text.append(" 跟随 ", new ForegroundColorSpan(whiteColor))
.append(fromNick, new ForegroundColorSpan(roomTipColor),
new OriginalDrawStatusClickSpan() {
@Override
@@ -2214,9 +2214,9 @@ public class MessageView extends FrameLayout {
}
}
});
enterText = "";
enterText = "入了房间";
}
text.append(enterText, new ForegroundColorSpan(greyColor));
text.append(enterText, new ForegroundColorSpan(whiteColor));
//如果自己在麦上增加一个欢迎ta的按钮并且这条消息不是自己的
if (AvRoomDataManager.get().isOwnerOnMic()

View File

@@ -21,7 +21,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Size;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
@@ -873,30 +872,33 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
});
}
private final Runnable loadHomPlayRunnable = this::loadHomPlay;
private void loopHomePlay(List<HomePlayInfo> homePlayList) {
mBinding.tvAddFriends.removeCallbacks(loadHomPlayRunnable);
if (addFriendsDisposable != null) addFriendsDisposable.dispose();
mBinding.tvAddFriends.setVisibility(View.VISIBLE);
boolean isAdd = !addFriendsAdapter.getData().isEmpty();
//用addFriendsAdapter最后一个主题颜色来确定新的homePlayList第一个的主题颜色
int lastTheme = isAdd ? addFriendsAdapter.getData().get(addFriendsAdapter.getData().size() - 1).getTheme() : HomePlayTheme.THEME_3FC7FB;
for (int i = 0; i < homePlayList.size(); i++) {
HomePlayInfo playInfo = homePlayList.get(i);
if (i % 2 == 0) {
if (i % 2 == (lastTheme == HomePlayTheme.THEME_3FC7FB ? 0 : 1)) {
playInfo.setTheme(HomePlayTheme.THEME_7E69F3);
} else {
playInfo.setTheme(HomePlayTheme.THEME_3FC7FB);
}
}
if (homePlayList.size() > 2) {
addFriendsAdapter.setNewData(homePlayList.subList(0, 2));
} else {
addFriendsAdapter.setNewData(homePlayList);
return;
if (!isAdd) {
mBinding.tvAddFriends.setVisibility(View.VISIBLE);
if (homePlayList.size() > 2) {
addFriendsAdapter.setNewData(homePlayList.subList(0, 2));
} else {
addFriendsAdapter.setNewData(homePlayList);
return;
}
}
Observable<HomePlayInfo> listObservable = Observable.fromIterable(homePlayList.subList(2, homePlayList.size()));
Observable<HomePlayInfo> listObservable = Observable.fromIterable(isAdd ? homePlayList : homePlayList.subList(2, homePlayList.size()));
Observable<Long> timerObservable = Observable.interval(3000, TimeUnit.MILLISECONDS);
@@ -921,7 +923,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
@Override
public void onComplete() {
mBinding.tvAddFriends.postDelayed(loadHomPlayRunnable, 3000);
loadHomPlay();
}
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -39,7 +39,7 @@
<TextView
android:id="@+id/tv_search_room"
android:layout_width="0dp"
android:layout_height="@dimen/dp_32"
android:layout_height="@dimen/dp_30"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_20"
android:layout_weight="1"
@@ -57,13 +57,13 @@
<ImageView
android:id="@+id/iv_ranking"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_32"
android:layout_height="@dimen/dp_30"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_13"
android:adjustViewBounds="true"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_15"
android:onClick="@{click}"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_home_ranking" />
<ImageView
@@ -195,6 +195,7 @@
android:background="@color/color_F9F9F9"
android:paddingStart="16dp"
android:text="交友扩列"
android:textStyle="bold"
android:textColor="@color/color_333333"
android:textSize="16sp" />

View File

@@ -66,11 +66,6 @@
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/color_F4F4F4"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_grab_apprentices"
android:background="@color/white"