增加了VR模式的适配方案 VH 采用三木运算判断当前模式,动态加载不同layout
This commit is contained in:
@@ -56,6 +56,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
*/
|
||||
public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private static final String TAG = "V2XRoadEventVH";
|
||||
private static final boolean isVrMap = false;
|
||||
private MogoImageView ivEventImg;
|
||||
private MogoImageView ivReportHead;
|
||||
private ImageView ivEventPlay;
|
||||
@@ -138,7 +139,10 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
|
||||
public V2XRoadEventVH(ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false));
|
||||
super(isVrMap ?
|
||||
LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) :
|
||||
LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false)
|
||||
);
|
||||
init(itemView);
|
||||
// 设置视图状态监听
|
||||
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||
|
||||
Reference in New Issue
Block a user