From 4809d2904a3887247104f6c087e1debca499f745 Mon Sep 17 00:00:00 2001 From: liujing Date: Mon, 18 Oct 2021 20:33:35 +0800 Subject: [PATCH] UI --- .../core/function/check/net/CheckNetWork.kt | 2 +- .../check/view/CheckInfoGridItemDivider.java | 66 +------------------ .../src/main/res/layout/check_info_list.xml | 20 ++++++ 3 files changed, 22 insertions(+), 66 deletions(-) diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckNetWork.kt b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckNetWork.kt index 5d2703522e..3da2c6d33f 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckNetWork.kt +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckNetWork.kt @@ -22,7 +22,7 @@ object CheckNetWork { //网络请求,获取自车检测结果(工控机上报云端) fun checkNetWork(context: Context, callbackFlow: ICheckResultCallBack) { val params = ParamsBuilder.of(false) - .append("sn", MoGoAiCloudClientConfig.getInstance().sn) + .append("sn", "X20202108044A6797CFE6F8E899") .build() CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params) .subscribeOn(Schedulers.io()) diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoGridItemDivider.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoGridItemDivider.java index 8f6f13edcd..8b678c7963 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoGridItemDivider.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoGridItemDivider.java @@ -6,6 +6,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; +import android.util.Log; import android.view.View; import androidx.recyclerview.widget.GridLayoutManager; @@ -105,18 +106,6 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration { divider.draw(c); } - //待修改为右侧 - private void drawVerticalForLastColum(Canvas c, View child) { - final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child - .getLayoutParams(); - int left = child.getRight() - params.leftMargin - divider.getIntrinsicWidth(); - int top = child.getTop() - params.topMargin; - int right = child.getRight() - params.leftMargin + divider.getIntrinsicWidth(); - int bottom = top + child.getHeight() + divider.getIntrinsicHeight(); - divider.setBounds(left, top, right, bottom); - divider.draw(c); - } - public void drawVertical(Canvas c, RecyclerView parent) { final int childCount = parent.getChildCount(); for (int i = 0; i < childCount; i++) { @@ -133,62 +122,9 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration { if (isFirstColum(parent, i, getSpanCount(parent))) { //画第一列左边分割线 drawVerticalForFirstColum(c, child); } - if (isLastColum(parent, i, getSpanCount(parent), childCount)) {//画最后一列右侧分割线 - drawVerticalForLastColum(c, child); - } } } - private boolean isLastColum(RecyclerView parent, int pos, int spanCount, - int childCount) { - RecyclerView.LayoutManager layoutManager = parent.getLayoutManager(); - if (layoutManager instanceof GridLayoutManager) { - if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边 - { - return true; - } - } else if (layoutManager instanceof StaggeredGridLayoutManager) { - int orientation = ((StaggeredGridLayoutManager) layoutManager) - .getOrientation(); - if (orientation == StaggeredGridLayoutManager.VERTICAL) { - if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边 - { - return true; - } - } else { - childCount = childCount - childCount % spanCount; - if (pos >= childCount)// 如果是最后一列,则不需要绘制右边 - return true; - } - } - return false; - } - - private boolean isLastRaw(RecyclerView parent, int pos, int spanCount, - int childCount) { - RecyclerView.LayoutManager layoutManager = parent.getLayoutManager(); - if (layoutManager instanceof GridLayoutManager) { - childCount = childCount - childCount % spanCount; - if (pos >= childCount)// 如果是最后一行,则不需要绘制底部 - return true; - } else if (layoutManager instanceof StaggeredGridLayoutManager) { - int orientation = ((StaggeredGridLayoutManager) layoutManager) - .getOrientation(); - if (orientation == StaggeredGridLayoutManager.VERTICAL) { - childCount = childCount - childCount % spanCount; - // 如果是最后一行,则不需要绘制底部 - if (pos >= childCount) - return true; - } else { - // 如果是最后一行,则不需要绘制底部 - if ((pos + 1) % spanCount == 0) { - return true; - } - } - } - return false; - } - //是否为第一列 private boolean isFirstColum(RecyclerView parent, int pos, int spanCount) { RecyclerView.LayoutManager layoutManager = parent.getLayoutManager(); diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_list.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_list.xml index 39be304ef4..9d53419d7c 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_list.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_list.xml @@ -42,6 +42,18 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/check_info_title"> + + + \ No newline at end of file