1.牌照房不可以开启游戏模式 2.跨房PK UI修改

This commit is contained in:
huangjian
2021-12-15 15:12:37 +08:00
parent ca07eb1814
commit 99da150b4e
13 changed files with 52 additions and 27 deletions

View File

@@ -224,18 +224,20 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
}
if (AvRoomDataManager.get().isRoomOwner()) {
if (AvRoomDataManager.get().isRoomOwner() && roomInfo.getIsPermitRoom() != 1) {
gameMainBinding.llChangeGame.setVisibility(View.VISIBLE);
gameMainBinding.rvGame.setLayoutManager(new LinearLayoutManager(mContext));
gameMainBinding.rvGame.setAdapter(gameAdapter = new SelectGameAdapter());
gameMainBinding.tvCurrGame.setOnClickListener(v -> {
if (gameMainBinding.rvGame.getVisibility() == View.VISIBLE) {
gameMainBinding.rvGame.setVisibility(View.GONE);
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
} else {
if (AvRoomDataManager.get().isGamePlaying()) {
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
} else {
gameMainBinding.rvGame.setVisibility(View.VISIBLE);
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
}
}
});
@@ -537,7 +539,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
ButtonItem buttonItem1 = new ButtonItem("退出房间", new ButtonItem.OnClickListener() {
@Override
public void onClick() {
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())){
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
getDialogManager().showOkCancelDialog("游戏中退出房间默认逃跑,确定进行此操作?", false,
() -> ((AVRoomActivity) getActivity()).toBack());
return;
@@ -576,7 +578,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
ButtonItem buttonItem2 = new ButtonItem("最小化房间", new ButtonItem.OnClickListener() {
@Override
public void onClick() {
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())){
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
getDialogManager().showOkCancelDialog("游戏中最小化房间默认逃跑,确定进行此操作?", false,
() -> ((AVRoomActivity) getActivity()).toBack());
return;

View File

@@ -24,6 +24,7 @@ import com.yizhuan.xchat_android_core.utils.net.RxHelper;
import com.yizhuan.xchat_android_library.utils.ListUtils;
import com.yizhuan.xchat_android_library.utils.log.MLog;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@@ -181,6 +182,17 @@ public class HomeTabHomeFragment extends BaseFragment {
getData();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
}
@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRefreshHomeDataEvent(RefreshHomeDataEvent event) {

View File

@@ -108,7 +108,7 @@ public class OpenRoomHelper {
public void acceptThrowable(RoomInfo roomInfo, Throwable throwable) {
super.acceptThrowable(roomInfo, throwable);
if (roomInfo != null) {
if (roomInfo.isReselect() && type == RoomInfo.ROOMTYPE_DEFAULT) {
if (roomInfo.isReselect() && type == RoomInfo.ROOMTYPE_DEFAULT && roomInfo.getIsPermitRoom() != 1) {
activity.getDialogManager().dismissDialog();
new CreateRoomDialog().show(activity);
} else {

View File

@@ -3,6 +3,6 @@
<item android:color="@color/text_title_white" android:state_enabled="true" />
<item android:color="#FF7A7CA0" />
<item android:color="@color/color_666666" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

View File

@@ -2,8 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="45"
android:endColor="#002A2A39"
android:startColor="#FF2A2A39"
android:endColor="@color/translucent"
android:startColor="@color/bg_secondary_2a2a39"
android:type="linear"
android:useLevel="true" />

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF4C4C6A" />
<solid android:color="#FFFFBC52" />
<corners android:radius="100dp" />
</shape>

View File

@@ -5,8 +5,8 @@
<item android:state_checked="true">
<shape android:shape="rectangle">
<gradient android:angle="180"
android:endColor="#FFFF9813"
android:startColor="#FFFFB22B"
android:endColor="#FFFFBC52"
android:startColor="#FFFFBC52"
android:type="linear"
android:useLevel="true" />
<corners android:radius="100dp" />
@@ -15,7 +15,7 @@
<item android:state_checked="false">
<shape android:shape="rectangle">
<solid android:color="#FF4C4C6A" />
<solid android:color="#4dFFCB47" />
<corners android:radius="100dp" />
</shape>
</item>

View File

@@ -190,7 +190,7 @@
android:paddingStart="20dp"
android:paddingEnd="50dp"
android:textColor="@color/text_title_white"
android:textColorHint="@color/white_transparent_50"
android:textColorHint="@color/color_666666"
android:textSize="15dp"
app:layout_constraintStart_toStartOf="@id/rg"
app:layout_constraintTop_toBottomOf="@id/rg" />
@@ -212,7 +212,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="PK玩法"
android:textColor="#ffffffff"
android:textColor="@color/text_title_white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@id/tv_pk_time"
app:layout_constraintTop_toBottomOf="@id/edit_time" />
@@ -228,7 +228,7 @@
android:paddingStart="20dp"
android:paddingEnd="50dp"
android:textColor="@color/text_title_white"
android:textColorHint="@color/white_transparent_50"
android:textColorHint="@color/color_666666"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@id/tv_pk_desc"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -19,7 +19,7 @@
android:layout_height="40dp"
android:layout_marginTop="16dp"
android:scaleType="center"
android:src="@drawable/arrow_left_white"
android:src="@drawable/arrow_left"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -30,14 +30,14 @@
android:layout_marginStart="3dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_room_pk_search_edit"
android:background="@drawable/bg_room_pk_common_btn"
android:hint="请输入大鹅号"
android:inputType="number"
android:maxLength="15"
android:paddingStart="20dp"
android:paddingEnd="50dp"
android:textColor="@color/text_title_white"
android:textColorHint="@color/white_transparent_40"
android:textColorHint="@color/color_666666"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_back"
@@ -54,7 +54,6 @@
app:layout_constraintEnd_toEndOf="@id/edit_search"
app:layout_constraintTop_toTopOf="@id/edit_search" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
@@ -86,6 +85,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@@ -155,15 +155,28 @@
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_curr_game"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/ic_room_arrow_type"
android:gravity="center"
android:includeFontPadding="true"
android:textColor="@color/white"
android:textSize="12sp" />
android:orientation="horizontal">
<TextView
android:id="@+id/tv_curr_game"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="true"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:id="@+id/iv_change_game_arrow"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="center"
android:src="@drawable/ic_room_arrow_type_below" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_game"

View File

@@ -16,7 +16,6 @@ android.enableD8=true
android.injected.testOnly=false
android.useAndroidX=true
android.enableJetifier=true
android.useDeprecatedNdk=true
version_name=3.6.4
version_code=364