diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java index 219fdced51..db349b0673 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java @@ -2,10 +2,12 @@ package com.mogo.eagle.core.function.check.view; import android.content.Context; import android.graphics.Color; +import android.util.AttributeSet; import android.util.Log; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -25,7 +27,7 @@ import java.util.List; public class CheckInfoListDialog extends BaseFloatDialog { private static final String TAG = "CheckInfoListDialog"; - private RecyclerView mRecyclerView; + private CheckInfoRecyclerView mRecyclerView; private Context mContext; private TextView titleView; private int span; @@ -33,7 +35,6 @@ public class CheckInfoListDialog extends BaseFloatDialog { private CheckResultData mCheckResultData; private List result = new ArrayList<>(); - public CheckInfoListDialog(@NonNull Context context, String style, CheckResultData checkResultData) { super(context); mContext = context; @@ -76,6 +77,9 @@ public class CheckInfoListDialog extends BaseFloatDialog { } public List showInfoResult() { + +// List test = new ArrayList();//测试数据 + if (result.size() > 0) { result.clear(); } @@ -98,10 +102,12 @@ public class CheckInfoListDialog extends BaseFloatDialog { } catch (Exception e) { e.printStackTrace(); } - Log.d(TAG, "检测指标结果值===" + result.toString()); } catch (Exception e) { } +// test.addAll(result); +// test.addAll(result); +// test.addAll(result); return result; } @@ -113,4 +119,5 @@ public class CheckInfoListDialog extends BaseFloatDialog { public void dismiss() { super.dismiss(); } + } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoRecyclerView.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoRecyclerView.java new file mode 100644 index 0000000000..b3cfa3c41e --- /dev/null +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoRecyclerView.java @@ -0,0 +1,48 @@ +package com.mogo.eagle.core.function.check.view; + +import android.content.Context; +import android.util.AttributeSet; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + +import com.mogo.eagle.core.function.check.R; + +/** + * @author liujing + * @description 描述 + * @since: 9/29/21 + */ +public class CheckInfoRecyclerView extends RecyclerView { + private int maxHeight = (int) getContext().getResources().getDimension(R.dimen.check_height); + private int maxWeight = (int) getContext().getResources().getDimension(R.dimen.check_width); + + public CheckInfoRecyclerView(@NonNull Context context) { + super(context); + } + + public CheckInfoRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + public CheckInfoRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + protected void onMeasure(int widthSpec, int heightSpec) { + super.onMeasure(widthSpec, heightSpec); + boolean needLimit = false; + if (maxHeight >= 0) { + needLimit = true; + } + if (needLimit) { + int limitHeight = getMeasuredHeight(); + if (getMeasuredHeight() > maxHeight) { + limitHeight = maxHeight; + } + setMeasuredDimension(maxWeight, maxHeight); + } + } +} 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 01d064eb5a..f783b37b5b 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 @@ -20,7 +20,7 @@ android:id="@+id/check_info_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_69" + android:layout_marginTop="@dimen/dp_70" android:gravity="center" android:text="自检结果" android:textColor="#fff" @@ -29,17 +29,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + app:layout_constraintTop_toBottomOf="@+id/check_info_title" /> + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-check/src/main/res/values/dimens.xml b/core/function-impl/mogo-core-function-check/src/main/res/values/dimens.xml new file mode 100644 index 0000000000..be32d366f2 --- /dev/null +++ b/core/function-impl/mogo-core-function-check/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 1900px + 876px +