游戏详情接入游戏推荐(大家都在玩),优化代码

This commit is contained in:
khy
2017-04-26 15:34:58 +08:00
parent 5798ba9e89
commit a0cae1b7b8
39 changed files with 601 additions and 1099 deletions

View File

@ -112,7 +112,8 @@ public class MessageShareUtils {
}
RelativeLayout contentView = new RelativeLayout(context);
contentView.setBackgroundColor(0x8c000000);
contentView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
contentView.setBackgroundColor(Color.YELLOW);
contentView.setFocusable(true);
contentView.setFocusableInTouchMode(true);
@ -135,6 +136,7 @@ public class MessageShareUtils {
LinearLayout llBottom = (LinearLayout) view;
ViewGroup.LayoutParams layoutParams = llBottom.getLayoutParams();
layoutParams.height = DisplayUtils.dip2px(context, contentSize);
shareRecyclerView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
llBottom.addView(shareRecyclerView);
return;
}
@ -175,7 +177,7 @@ public class MessageShareUtils {
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, DisplayUtils.dip2px(context, itemSize)));
linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, DisplayUtils.dip2px(context, itemSize)));
linearLayout.setOrientation(LinearLayout.VERTICAL);
linearLayout.setGravity(Gravity.CENTER_HORIZONTAL);
linearLayout.setBackgroundResource(R.drawable.cardview_item_style);