فهرست منبع

修改我的可成视频课页pad适配效果

Pq 1 سال پیش
والد
کامیت
94bf2000b4
1فایلهای تغییر یافته به همراه14 افزوده شده و 11 حذف شده
  1. 14 11
      student/src/main/java/com/cooleshow/student/ui/course/VideoCourseFragment.java

+ 14 - 11
student/src/main/java/com/cooleshow/student/ui/course/VideoCourseFragment.java

@@ -22,6 +22,7 @@ import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.base.utils.helper.QMUIDeviceHelper;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
 import com.cooleshow.base.widgets.poplist.PopupListWindow;
@@ -114,13 +115,15 @@ public class VideoCourseFragment extends BaseMVPFragment<FragmentVideoCourseLayo
         //当自动加载开启,同时数据不满一屏时,是否继续执行自动加载更多(默认为true)
         mAdapter.getLoadMoreModule().setEnableLoadMoreIfNotFullPage(false);
 
-        GridLayoutManager gridLayoutManager = new GridLayoutManager(requireContext(), 2);
+
+        int count = QMUIDeviceHelper.isTablet(getContext()) ? 3 : 2;
+        GridLayoutManager gridLayoutManager = new GridLayoutManager(requireContext(), count);
         gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
             @Override
             public int getSpanSize(int position) {
                 int itemViewType = mAdapter.getItemViewType(position);
                 if (itemViewType == BaseQuickAdapter.LOAD_MORE_VIEW) {
-                    return 2;
+                    return count;
                 }
                 return 1;
             }
@@ -268,16 +271,16 @@ public class VideoCourseFragment extends BaseMVPFragment<FragmentVideoCourseLayo
             mViewBinding.tvSubject.setText(subjectBeanList.get(options1).name);
             queryCourse(true);
         }).setLayoutRes(R.layout.pickerview_address_layout, v -> {
-            //自定义布局中的控件初始化及事件处理
-            final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
-            TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
-            tvSubmit.setOnClickListener(v12 -> {
-                pvOptions.returnData();
-                pvOptions.dismiss();
-            });
-            ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
+                    //自定义布局中的控件初始化及事件处理
+                    final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
+                    TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
+                    tvSubmit.setOnClickListener(v12 -> {
+                        pvOptions.returnData();
+                        pvOptions.dismiss();
+                    });
+                    ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
 
-        }).isDialog(false)
+                }).isDialog(false)
                 .build();
         pvOptions.setPicker(subjectBeanList);
         pvOptions.show();