Merge branch 'nn' into dev_MogoAP_eagle-930_210926_8.0.12
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_info_title"></include>
|
||||
|
||||
<View
|
||||
android:id="@+id/line_top"
|
||||
android:layout_width="3px"
|
||||
android:layout_height="@dimen/dp_127"
|
||||
android:layout_marginTop="@dimen/dp_66"
|
||||
android:background="@color/check_info_shape_color"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/check_list_recycler"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_info_title"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<com.mogo.eagle.core.function.check.view.CheckInfoRecyclerView
|
||||
android:id="@+id/check_list_recycler"
|
||||
android:layout_width="match_parent"
|
||||
@@ -54,5 +66,13 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_title_item" />
|
||||
|
||||
<View
|
||||
android:layout_width="3px"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/check_info_shape_color"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/check_list_recycler"
|
||||
app:layout_constraintEnd_toEndOf="@id/check_list_recycler"
|
||||
app:layout_constraintStart_toStartOf="@id/check_list_recycler"
|
||||
app:layout_constraintTop_toTopOf="@id/check_list_recycler" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user