瀏覽代碼

处理商城webView的ui

Pq 2 年之前
父節點
當前提交
d137747ef5

+ 4 - 2
student/src/main/java/com/cooleshow/student/ui/main/MallFragment.java

@@ -49,6 +49,7 @@ import com.cooleshow.base.utils.AppUtils;
 import com.cooleshow.base.utils.MyFileUtils;
 import com.cooleshow.base.utils.PermissionUtils;
 import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.Utils;
 import com.cooleshow.base.widgets.DialogUtil;
 import com.cooleshow.student.R;
 import com.cooleshow.student.api.APIService;
@@ -183,7 +184,7 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
     @Override
     protected void initView(View rootView) {
         initViewLayout();
-
+        Utils.setHeadView(viewStatusbar, getContext(), 0);
         url = WebConstants.TEACHER_SHOPMALL;
         headerBbarView.setVisibility(View.GONE);
         viewStatusbar.setVisibility(View.VISIBLE);
@@ -414,7 +415,8 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
     @Override
     public void getNavHeight(JSONObject message) {
         try {
-            message.getJSONObject("content").put("navHeight", getResources().getDimension(com.cooleshow.base.R.dimen.statusbar_view_height));
+            int statusBarHeight = Utils.getCurrentStatusBarHeight(getContext());
+            message.getJSONObject("content").put("navHeight", statusBarHeight != 0 ? statusBarHeight : getResources().getDimension(com.cooleshow.base.R.dimen.statusbar_view_height));
             message.getJSONObject("content").put("titleHeight", getResources().getDimension(com.cooleshow.base.R.dimen.dp_44));
             message.getJSONObject("content").put("dpi", getResources().getDisplayMetrics().density);
         } catch (JSONException e) {

+ 1 - 2
student/src/main/res/layout/fragment_mall.xml

@@ -27,8 +27,7 @@
         <View
             android:id="@+id/view_statusbar"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/statusbar_view_height"
-            android:background="#BCF1EB"
+            android:layout_height="1px"
             android:visibility="gone" />
 
         <ProgressBar

+ 4 - 2
teacher/src/main/java/com/cooleshow/teacher/ui/main/MallFragment.java

@@ -48,6 +48,7 @@ import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.AppUtils;
 import com.cooleshow.base.utils.PermissionUtils;
 import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.Utils;
 import com.cooleshow.base.widgets.DialogUtil;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.api.APIService;
@@ -185,7 +186,7 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
     @Override
     protected void initView(View rootView) {
         initViewLayout();
-
+        Utils.setHeadView(viewStatusbar, getContext(), 0);
         url = WebConstants.TEACHER_SHOPMALL;
 
 //        setStatusBarTextColor(false);
@@ -418,7 +419,8 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
     @Override
     public void getNavHeight(JSONObject message) {
         try {
-            message.getJSONObject("content").put("navHeight", getResources().getDimension(com.cooleshow.base.R.dimen.statusbar_view_height));
+            int statusBarHeight = Utils.getCurrentStatusBarHeight(getContext());
+            message.getJSONObject("content").put("navHeight", statusBarHeight != 0 ? statusBarHeight : getResources().getDimension(com.cooleshow.base.R.dimen.statusbar_view_height));
             message.getJSONObject("content").put("titleHeight", getResources().getDimension(com.cooleshow.base.R.dimen.dp_44));
             message.getJSONObject("content").put("dpi", getResources().getDisplayMetrics().density);
         } catch (JSONException e) {

+ 1 - 2
teacher/src/main/res/layout/fragment_mall.xml

@@ -29,8 +29,7 @@
         <View
             android:id="@+id/view_statusbar"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/statusbar_view_height"
-            android:background="#BCF1EB"
+            android:layout_height="1px"
             android:visibility="gone" />
 
         <ProgressBar