From a68bee94a9c350d3b463680f1a883e69eccfb6f0 Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Wed, 3 Jul 2024 15:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E7=BE=8E=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/LiveNewRoleFunGamesAdapter.java | 7 ++++++- .../LiveNewRoleInteractionGamesAdapter.java | 2 ++ .../adapter/LiveNewRolerPopupAdapter.java | 5 +++-- .../adapter/NewRoleFunGamesAdapter.java | 6 +++++- ...InteractionGamesChildBottomViewHolder.java | 3 ++- .../InteractionGamesChildViewHolder.java | 6 ++---- .../views/LiveNewRoleFunGamesViewHolder.java | 9 +++++--- .../LiveNewRoleRigtsInterestsViewHolder.java | 11 +++++++--- .../views/NewRoleFunGamesChildViewHolder.java | 6 +++++- .../res/layout/view_fun_games_child_view.xml | 9 ++++---- .../main/res/layout/view_fun_games_view.xml | 1 + ...iew_live_new_role_fun_games_child_view.xml | 7 +++---- ...ew_live_new_role_fun_games_child_view2.xml | 9 ++++---- ...ew_live_new_role_fun_games_child_view3.xml | 21 ++++++++++++------- ...w_live_new_role_interaction_games_view.xml | 2 +- .../view_live_new_roler_ights_interests.xml | 7 ++++--- .../layout/view_new_roler_fun_games_view.xml | 7 +++++-- .../main/res/layout/view_rights_interests.xml | 1 + .../live/activity/SudRyGameActivity.java | 2 +- .../live/activity/SudSwGameActivity.java | 2 +- 20 files changed, 78 insertions(+), 45 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java index 54c1f1c45..077196417 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleFunGamesAdapter.java @@ -31,11 +31,16 @@ public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter { @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false); - return new NewRoleFunGamesChildViewHolder(runGamesView,showRed); + return new NewRoleFunGamesChildViewHolder(runGamesView,showRed,mContext); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int) + (mContext.getResources().getDisplayMetrics().widthPixels / 4.5), + ViewGroup.LayoutParams.WRAP_CONTENT); + holder.itemView.setLayoutParams(layoutParams); + NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder; childViewHolder.setData(child.get(position), rigts); } diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java index cfc99a595..7950a02ca 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java @@ -63,12 +63,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { }); } + @Override public int getItemCount() { return child.size(); } public void updateData(List mChild) { + child.clear(); /* if (mChild.size() > 8) { for (int i = 0; i < 8; i++) { diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java index 1af67bb6c..91f5e4ca7 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRolerPopupAdapter.java @@ -39,10 +39,11 @@ public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter { switch (viewType) { case FUN_GAMES: View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false); - return new LiveNewRoleFunGamesViewHolder(runGamesView); + return new LiveNewRoleFunGamesViewHolder(runGamesView,mContext); case RIGHTS_INTERESTS: + //特权 View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false); - return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed); + return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed,mContext); default: View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false); return new LiveNewRoleInteractionGamesViewHolder(gamesView,mContext); diff --git a/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java index d473abe0b..9f5e5aaad 100644 --- a/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/NewRoleFunGamesAdapter.java @@ -30,11 +30,15 @@ public class NewRoleFunGamesAdapter extends RecyclerView.Adapter { @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view2, parent, false); - return new NewRoleFunGamesChildViewHolder(runGamesView,false); + return new NewRoleFunGamesChildViewHolder(runGamesView,false,mContext); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams((int) + (mContext.getResources().getDisplayMetrics().widthPixels / 4.5), + ViewGroup.LayoutParams.WRAP_CONTENT); + holder.itemView.setLayoutParams(layoutParams); NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) holder; childViewHolder.setData(child.get(position), rigts); } diff --git a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java index 76918b2ce..0eac169ab 100644 --- a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildBottomViewHolder.java @@ -10,6 +10,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.R; import com.yunbao.common.bean.CustomSidebarChildModel; import com.yunbao.common.glide.ImgLoader; @@ -17,7 +18,7 @@ import com.yunbao.common.utils.SpUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; public class InteractionGamesChildBottomViewHolder extends RecyclerView.ViewHolder { - private ImageView funGamePic; + private RoundedImageView funGamePic; private TextView funGameName; private Context mContext; diff --git a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java index b4956c4d0..1582856b1 100644 --- a/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/InteractionGamesChildViewHolder.java @@ -4,22 +4,20 @@ import android.content.Context; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.R; import com.yunbao.common.bean.CustomSidebarChildModel; -import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.glide.ImgLoader; -import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; public class InteractionGamesChildViewHolder extends RecyclerView.ViewHolder { - private ImageView funGamePic; + private RoundedImageView funGamePic; private TextView funGameName; private Context mContext; diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java index 731ff761e..ff0bc7364 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleFunGamesViewHolder.java @@ -1,6 +1,8 @@ package com.yunbao.common.views; +import android.content.Context; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; @@ -25,21 +27,22 @@ public class LiveNewRoleFunGamesViewHolder extends RecyclerView.ViewHolder { private RecyclerView childList; private ImageView selectMoreIcon; boolean isShowMore = true; + private Context mContext; - public LiveNewRoleFunGamesViewHolder(@NonNull View itemView) { + public LiveNewRoleFunGamesViewHolder(@NonNull View itemView, Context context) { super(itemView); + this.mContext = context; sendGoodGift = itemView.findViewById(R.id.send_good_gift); childList = itemView.findViewById(R.id.child_list); selectMoreIcon = itemView.findViewById(R.id.select_more_icon); selectMore = itemView.findViewById(R.id.select_more); - funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(),true); + funGamesAdapter = new NewRoleFunGamesAdapter(itemView.getContext(), true); childList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false)); childList.setAdapter(funGamesAdapter); } public void setData(CustomSidebarInfoModel model) { - List sidebarChildModels = model.getChild(); itemView.findViewById(R.id.select_more_layout).setVisibility(sidebarChildModels.size() >= 8 ? View.VISIBLE : View.GONE); sendGoodGift.setText(model.getTitle()); diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java index 43d54460a..c2aa51ee5 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleRigtsInterestsViewHolder.java @@ -1,10 +1,13 @@ package com.yunbao.common.views; +import android.content.Context; import android.view.View; +import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.R; @@ -21,19 +24,21 @@ public class LiveNewRoleRigtsInterestsViewHolder extends RecyclerView.ViewHolder private TextView sendGoodGift; private RecyclerView childList; private boolean showRed = false; - public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView,boolean showRed) { + private Context mContext; + public LiveNewRoleRigtsInterestsViewHolder(@NonNull View itemView, boolean showRed,Context mContext) { super(itemView); + this.mContext = mContext; sendGoodGift = itemView.findViewById(R.id.send_good_gift); childList = itemView.findViewById(R.id.child_list); sendGoodGift = itemView.findViewById(R.id.send_good_gift); childList = itemView.findViewById(R.id.child_list); funGamesAdapter = new LiveNewRoleFunGamesAdapter(itemView.getContext(), false,showRed); - childList.setLayoutManager(new GridLayoutManager(itemView.getContext(), 4)); + LinearLayoutManager layoutManager = new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false); + childList.setLayoutManager(layoutManager); childList.setAdapter(funGamesAdapter); } public void setData(CustomSidebarInfoModel model) { - sendGoodGift.setText(model.getTitle()); funGamesAdapter.updateData(generateData()); } diff --git a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java index 8cab49049..ef144cbfa 100644 --- a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java @@ -1,8 +1,10 @@ package com.yunbao.common.views; +import android.content.Context; import android.text.TextUtils; import android.util.Log; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; @@ -27,8 +29,10 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder { private View red_point; private boolean showRed = false; private View total_image_red_point; - public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed) { + private Context mContext; + public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed, Context mContext) { super(itemView); + this.mContext = mContext; this.showRed = showRed; funGamePic = itemView.findViewById(R.id.fun_game_pic); funGameName = itemView.findViewById(R.id.fun_game_name); diff --git a/common/src/main/res/layout/view_fun_games_child_view.xml b/common/src/main/res/layout/view_fun_games_child_view.xml index 7db74bcc6..1f9dd4549 100644 --- a/common/src/main/res/layout/view_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_fun_games_child_view.xml @@ -1,16 +1,16 @@ diff --git a/common/src/main/res/layout/view_fun_games_view.xml b/common/src/main/res/layout/view_fun_games_view.xml index 78a853118..6d155ca94 100644 --- a/common/src/main/res/layout/view_fun_games_view.xml +++ b/common/src/main/res/layout/view_fun_games_view.xml @@ -40,6 +40,7 @@ diff --git a/common/src/main/res/layout/view_live_new_role_fun_games_child_view.xml b/common/src/main/res/layout/view_live_new_role_fun_games_child_view.xml index 4b46be732..972ce835f 100644 --- a/common/src/main/res/layout/view_live_new_role_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_live_new_role_fun_games_child_view.xml @@ -16,13 +16,12 @@ @@ -63,6 +62,6 @@ android:maxLines="1" android:text="@string/guard_guard" android:textColor="#9A9A9A" - android:textSize="14sp" /> + android:textSize="10sp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml b/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml index 9698ed388..b1fff2453 100644 --- a/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml +++ b/common/src/main/res/layout/view_live_new_role_fun_games_child_view2.xml @@ -1,17 +1,16 @@ + android:textSize="10sp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml b/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml index 138d036d0..f2d713165 100644 --- a/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml +++ b/common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml @@ -15,15 +15,20 @@ android:layout_height="wrap_content"> - + android:layout_centerVertical="true" + android:scaleType="centerCrop" + android:src="@mipmap/live_more_icon_guard" + android:visibility="visible" + app:riv_oval="true" /> + android:textSize="10sp" /> diff --git a/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml b/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml index 5ab821e4a..01feaca8e 100644 --- a/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml +++ b/common/src/main/res/layout/view_live_new_role_interaction_games_view.xml @@ -2,7 +2,7 @@ + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginTop="10dp" /> \ No newline at end of file diff --git a/common/src/main/res/layout/view_new_roler_fun_games_view.xml b/common/src/main/res/layout/view_new_roler_fun_games_view.xml index 457a59633..164c35ae8 100644 --- a/common/src/main/res/layout/view_new_roler_fun_games_view.xml +++ b/common/src/main/res/layout/view_new_roler_fun_games_view.xml @@ -2,12 +2,12 @@ + android:layout_marginTop="15dp" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:overScrollMode="never" /> diff --git a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java index 1a568cb1f..fdbc6b4ab 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudRyGameActivity.java @@ -448,7 +448,7 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M // 设置游戏安全操作区域 GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel(); gameViewRectModel.left = 0; - gameViewRectModel.top = DpUtil.dp2px(155); + gameViewRectModel.top = DpUtil.dp2px(320); gameViewRectModel.right = 0; gameViewRectModel.bottom = DpUtil.dp2px(155); gameViewModel.gameViewRectModel = gameViewRectModel; diff --git a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java index 4b8130988..6f5acab9f 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudSwGameActivity.java @@ -496,7 +496,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M // 设置游戏安全操作区域 GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel(); gameViewRectModel.left = 0; - gameViewRectModel.top = DpUtil.dp2px(155); + gameViewRectModel.top = DpUtil.dp2px(320); //游戏安全区域 gameViewRectModel.right = 0; gameViewRectModel.bottom = DpUtil.dp2px(155); gameViewModel.gameViewRectModel = gameViewRectModel;