仿iOS日历、飞书日历、Google日历的日模式

仿iOS日历、飞书日历、Google日历的日模式,24H内事件可自由上下拖动、自由拉伸。

以下是效果图:

具体实现比较简单,代码如下:

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ScrollView;import androidx.annotation.Nullable;import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;//4、Java to c#
public class MultiRectView extends View {private Paint paintRect;private Paint borderPaint ;private Paint paintLine;private Paint paintDragText;private List<RectF> rectangles;private List<Map> rectanglesMapList;private RectF currentRect; // 当前操作的矩形private RectF preRect; // 操作的前一个矩形private int currentRectIndex = 0;// 当前被选中的矩形private float rectWidth = 200f; // 矩形宽度private float rectHeight = 100f; // 矩形高度private int currentHandle; // 记录当前操作的控制点private float lastX, lastY; // 手指最后位置private float preX, preY; // 手指起始位置private TextPaint textPaint;private Paint shadowPaint; // 用于阴影效果// 控制点private static final int NONE = -1;private static final int LEFT_TOP = 0;private static final int RIGHT_TOP = 1;private static final int LEFT_BOTTOM = 2;private static final int RIGHT_BOTTOM = 3;private static final int MOVE_RECT = 4;// 刻度设置private final int SCALE_INTERVAL = 30; // 30分钟private final int TOTAL_SCALES = 24 * 4; // 24小时,每小时4个15分钟刻度// 设置最小高度private final int MIN_RECT_HEIGHT = 100;long lineWidth = 6;long lineLen = 30;private String[] hours;private GestureDetector gestureDetector;private Context mContext;private onclickListener onclickListener;private onLongclicklistener onLongclickListener;private long longPressStartTime = 0;//长按时间private boolean isDragging = false;private ScrollView scrollView;private int mScaleWidth = 30;//上下间距private int mScaleLineX = 140;//横线距离左侧的起始距离点private int mScaleLineText = 30;//刻度的起始点private int mScaleRectToLeft = 150;//矩形距离左侧间距private List<String> texts; // 存储每个矩形内的文本private Canvas mCanvas;private String topText = "";private String bottomText = "";int topScale = 0;int bottomScale = 0;private RectF rectMove;private boolean isCancleClickStatus = true;private boolean isLongPressStatus = false;//长按状态//计时器,计时点击时长Timer timer;TimerTask timerTask;private final int LONGPRESSTIME = 500;//长按超过0.5秒,触发长按事件private float cornerRadius = 15f; // 圆角半径private List<ActiviesDataModel> activiesDataModelListl;private float offsetAmount = 20; // 偏移量,具体根据需求调整public MultiRectView(Context context) {super(context);mContext = context;init();}public MultiRectView(Context context, @Nullable AttributeSet attrs) {super(context, attrs);mContext = context;init();}public MultiRectView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);mContext = context;init();}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {super.onMeasure(widthMeasureSpec, heightMeasureSpec);int heightSize = MeasureSpec.getSize(heightMeasureSpec);int reHeight = resolveSize(heightSize, heightMeasureSpec);setMeasuredDimension(widthMeasureSpec, reHeight);}public void setScrollView(ScrollView scrollView1) {this.scrollView = scrollView1;}private void init() {texts = new ArrayList<>();rectangles = new ArrayList<>();rectanglesMapList = new ArrayList<>();// 初始化填充画笔paintRect = new Paint();paintRect.setAntiAlias(true);paintRect.setStyle(Paint.Style.FILL);paintRect.setColor(getResources().getColor(R.color.purple_200));paintRect.setStrokeCap(Paint.Cap.ROUND);paintRect.setStrokeWidth(3);//控制矩形宽高// 初始化边框画笔borderPaint = new Paint();borderPaint.setAntiAlias(true);borderPaint.setStyle(Paint.Style.STROKE);borderPaint.setColor(getResources().getColor(R.color.purple_300)); // 设置边框颜色为黄色borderPaint.setStrokeWidth(3); // 设置边框宽度//划线属性paintLine = new Paint();paintLine.setColor(Color.RED);//动态显示时间标签的画笔属性paintDragText = new Paint();paintDragText.setColor(Color.GREEN);paintDragText.setTextSize(30);//左侧时间的画笔属性textPaint = new TextPaint();textPaint.setColor(Color.BLACK);textPaint.setTextSize(32); // 设置文本大小//阴影shadowPaint = new Paint();shadowPaint.setAntiAlias(true);shadowPaint.setStyle(Paint.Style.FILL); // 设为填充样式shadowPaint.setColor(getResources().getColor(R.color.purple_300)); // 阴影主体的颜色shadowPaint.setShadowLayer(10f, 0f, 0f, getResources().getColor(R.color.black2)); // 设置阴影外圈渐变效果}@Overrideprotected void onDraw(Canvas canvas) {super.onDraw(canvas);drawScale(canvas); // 绘制刻度线、时间刻度for (int i = 0; i < rectangles.size(); i++) {if(i != currentRectIndex){// 绘制未选中的矩形RectF rect = rectangles.get(i);// 检查重叠并调整位置
//                if (isOverlapping(rect, i)) {
//                    rect.left -= offsetAmount; // 向左偏移
//                }drawRectAndText(canvas, rect, i);//画矩形框、内部写字drawCurrentScale(canvas, rect, i);//绘制显示实时刻度}}// 绘制当前选中的矩形,确保其在最上层if (currentRectIndex != -1) {RectF selectedRect = rectangles.get(currentRectIndex);drawRectAndText(canvas, selectedRect, currentRectIndex,true); // 画选中的矩形框、内部写字drawCurrentScale(canvas, selectedRect,currentRectIndex); // 绘制选中的矩形显示实时刻度}this.mCanvas = canvas;}private boolean isOverlapping(RectF currentRect, int currentIndex) {for (int i = 0; i < rectangles.size(); i++) {if (i != currentIndex) {RectF otherRect = rectangles.get(i);if (RectF.intersects(currentRect, otherRect)) {return true; // 矩形重叠}}}return false; // 矩形不重叠}private void drawScale(Canvas canvas) {// 绘制15分钟刻度线for (int n = 0; n <= TOTAL_SCALES; n++) {float y = n * mScaleWidth; // 计算刻度Y坐标// 计算并绘制时间标签(15分钟为单位)if (n % 4 == 0) { // 但每小时显示并绘制一次int hour = n / 4;if ((n / 4 + "").contains("24")) {hour = 0;}if (y == 0) {//第一根线防止画不全y = 15;}String timeText = String.format("%02d:00", hour);canvas.drawText(timeText, mScaleLineX - 100, y + 10, textPaint); // 绘制时间文本canvas.drawLine(mScaleLineX, y, getWidth() - 30, y + 20, paintLine); // 绘制刻度线}}}private String finalStartTime = "";private String finalEndTime = "";private void drawCurrentScale(Canvas canvas, RectF rect, int index) {//绘制显示实时的刻度// 计算矩形边界的时间刻度值topScale = (int) Math.round(rect.top / (mScaleWidth)); // 计算矩形上边界的刻度bottomScale = Math.round(rect.bottom / (mScaleWidth)); // 计算矩形下边界的刻度if (currentRect != rect) {//只有当前点击的矩形参与显示return;}boolean isLongPressStatus = (activiesDataModelListl.get(index)).isLongPressStatus();if (isLongPressStatus) {finalStartTime = "";finalEndTime = "";// 确保边界值在可用范围内if (topScale >= 0 && topScale < TOTAL_SCALES) {rectMove = rect;topText = String.format("%02d:%02d", topScale / 4, (topScale % 4) * 15);finalStartTime = topText;//  canvas.drawText(topText, mScaleLineX + 10, rect.top + 20, textPaint); // 绘制上边界刻度canvas.drawText(topText, mScaleLineX - 100, rect.top + 20, paintDragText); // 绘制上边界刻度}if (bottomScale >= 0 && bottomScale < TOTAL_SCALES) {bottomText = String.format(" %02d:%02d", bottomScale / 4, (bottomScale % 4) * 15);finalEndTime = bottomText;canvas.drawText(bottomText, mScaleLineX - 100, rect.bottom - 10, paintDragText); // 绘制下边界刻度//canvas.drawText(bottomText, mScaleLineX + 10, rect.bottom - 10, textPaint); // 绘制下边界刻度}if (!TextUtils.isEmpty(finalStartTime) && !TextUtils.isEmpty(finalEndTime)) {//更新调整后的时间activiesDataModelListl.get(index).setStart_time(finalStartTime);activiesDataModelListl.get(index).setEnd_time(finalEndTime);}} else {}}private void drawRectAndText(Canvas canvas, RectF rect, int index) {canvas.drawRoundRect(rect, cornerRadius, cornerRadius, paintRect); // 绘制圆角矩形-填充canvas.drawRoundRect(rect, cornerRadius, cornerRadius, borderPaint); // 绘制圆角矩形-边框boolean isLongPressStatus = (activiesDataModelListl.get(index)).isLongPressStatus();//绘制矩形的四个边角if (isLongPressStatus) {if (currentRect != null && currentRect == rect) {// lt h 左上角//  canvas.drawLine(rect.left, rect.top, rect.left + lineLen, rect.top, paintRect);// lt v//    canvas.drawLine(rect.left, rect.top, rect.left, rect.top + lineLen, paintRect);// rt h 右上角//  canvas.drawLine(rect.right - lineLen, rect.top, rect.right, rect.top, paintRect);// rt v//   canvas.drawLine(rect.right, rect.top, rect.right, rect.top + lineLen, paintRect);// lb h左下角//   canvas.drawLine(rect.left, rect.bottom, rect.left + lineLen, rect.bottom, paintRect);// lb v//       canvas.drawLine(rect.left, rect.bottom - lineLen, rect.left, rect.bottom, paintRect);// rb h 右下角//   canvas.drawLine(rect.right - lineLen, rect.bottom, rect.right, rect.bottom, paintRect);// rb v//  canvas.drawLine(rect.right, rect.bottom - lineLen, rect.right, rect.bottom, paintRect);drawShadowEffect(canvas, rect); // 绘制阴影效果}}ActiviesDataModel activiesDataModel = activiesDataModelListl.get(index);String name = activiesDataModel.getPop_name();String address = activiesDataModel.getPop_address();int popdb_id = activiesDataModel.getPopdb_id();String startTime = activiesDataModel.getStart_time();String endTime = activiesDataModel.getEnd_time();String value = name + " \n " + address + " \n " + startTime + " -- " + endTime;// 绘制矩形内的文本StaticLayout staticLayout = new StaticLayout(value, textPaint,(int) rect.width(), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);canvas.save();canvas.translate(rect.left, rect.top); // 移动画布到矩形的左上角staticLayout.draw(canvas);canvas.restore();}private void drawRectAndText(Canvas canvas, RectF rect, int index,boolean isInUp) {canvas.drawRoundRect(rect, cornerRadius, cornerRadius, paintRect); // 绘制圆角矩形-填充canvas.drawRoundRect(rect, cornerRadius, cornerRadius, borderPaint); // 绘制圆角矩形-边框boolean isLongPressStatus = (activiesDataModelListl.get(index)).isLongPressStatus();//绘制矩形的四个边角if (isLongPressStatus) {if (currentRect != null && currentRect == rect) {// lt h 左上角//  canvas.drawLine(rect.left, rect.top, rect.left + lineLen, rect.top, paintRect);// lt v//    canvas.drawLine(rect.left, rect.top, rect.left, rect.top + lineLen, paintRect);// rt h 右上角//  canvas.drawLine(rect.right - lineLen, rect.top, rect.right, rect.top, paintRect);// rt v//   canvas.drawLine(rect.right, rect.top, rect.right, rect.top + lineLen, paintRect);// lb h左下角//   canvas.drawLine(rect.left, rect.bottom, rect.left + lineLen, rect.bottom, paintRect);// lb v//       canvas.drawLine(rect.left, rect.bottom - lineLen, rect.left, rect.bottom, paintRect);// rb h 右下角//   canvas.drawLine(rect.right - lineLen, rect.bottom, rect.right, rect.bottom, paintRect);// rb v//  canvas.drawLine(rect.right, rect.bottom - lineLen, rect.right, rect.bottom, paintRect);drawShadowEffect(canvas, rect); // 绘制阴影效果}}ActiviesDataModel activiesDataModel = activiesDataModelListl.get(index);String name = activiesDataModel.getPop_name();String address = activiesDataModel.getPop_address();int popdb_id = activiesDataModel.getPopdb_id();String startTime = activiesDataModel.getStart_time();String endTime = activiesDataModel.getEnd_time();String value = name + " \n " + address + " \n " + startTime + " -- " + endTime;// 绘制矩形内的文本StaticLayout staticLayout = new StaticLayout(value, textPaint,(int) rect.width(), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);canvas.save();canvas.translate(rect.left, rect.top); // 移动画布到矩形的左上角staticLayout.draw(canvas);canvas.restore();}private void drawShadowEffect(Canvas canvas, RectF rect) {// 绘制阴影canvas.drawRoundRect(rect, cornerRadius, cornerRadius, shadowPaint); // 绘制圆角矩形}@Overridepublic boolean onTouchEvent(MotionEvent event) {float currentX = event.getX();float currentY = event.getY();switch (event.getAction()) {case MotionEvent.ACTION_DOWN:// 检查是否按下了控制点longPressStartTime = 0;for (int i = 0; i < rectangles.size(); i++) {RectF rect = rectangles.get(i);if (isInHandle(currentX, currentY, rect, LEFT_TOP)) {currentRect = rect;currentHandle = LEFT_TOP;} else if (isInHandle(currentX, currentY, rect, RIGHT_TOP)) {currentRect = rect;currentHandle = RIGHT_TOP;} else if (isInHandle(currentX, currentY, rect, LEFT_BOTTOM)) {currentRect = rect;currentHandle = LEFT_BOTTOM;} else if (isInHandle(currentX, currentY, rect, RIGHT_BOTTOM)) {currentRect = rect;currentHandle = RIGHT_BOTTOM;} else if (rect.contains(currentX, currentY)) {// 检测是否按下矩形currentRectIndex = i;longPressStartTime = System.currentTimeMillis(); // 记录长按开始时间currentRect = rect;currentHandle = MOVE_RECT;if (preRect != currentRect) {//前后两个矩形不是同一个//  isLongPressStatus = false;}timer = new Timer();timerTask = new TimerTask() {@Overridepublic void run() {//长按逻辑触发if(currentRectIndex!=-1){activiesDataModelListl.get(currentRectIndex).setLongPressStatus(true);// 长按触摸区域,禁止父容器 (ScrollView) 拦截触摸事件if (scrollView != null) {scrollView.requestDisallowInterceptTouchEvent(true);}}invalidate(); // 刷新视图}};timer.schedule(timerTask, LONGPRESSTIME, 1000 * 60 * 60 * 24);} else {// activiesDataModelListl.get(i).setLongPressStatus(false);}}lastX = currentX;lastY = currentY;preX = currentX;preY = currentY;isCancleClickStatus = true;try {boolean longPressStatus = activiesDataModelListl.get(currentRectIndex).isLongPressStatus();if (currentRect != null && longPressStatus) {// 触摸区域在矩形内,禁止父容器 (ScrollView) 拦截触摸事件if (scrollView != null) {scrollView.requestDisallowInterceptTouchEvent(true);}}} catch (Exception e) {e.getMessage();}break;case MotionEvent.ACTION_MOVE:if (currentRect != null) {float dx = currentX - lastX;float dy = currentY - lastY;boolean isLongPressStatus = false;if(currentRectIndex!=-1){isLongPressStatus = (activiesDataModelListl.get(currentRectIndex)).isLongPressStatus();}switch (currentHandle) {case LEFT_TOP://  currentRect.left += dx;//只允许上下拉伸 禁止左右拉伸if (isLongPressStatus) {currentRect.top += dy;}break;case RIGHT_TOP://   currentRect.right += dx;if (isLongPressStatus) {currentRect.top += dy;}break;case LEFT_BOTTOM://  currentRect.left += dx;if (isLongPressStatus) {currentRect.bottom += dy;}break;case RIGHT_BOTTOM://    currentRect.right += dx;if (isLongPressStatus) {currentRect.bottom += dy;}break;case MOVE_RECT:if (currentRectIndex != -1) {long pressDuration = System.currentTimeMillis() - longPressStartTime;if (isLongPressStatus) {//长按的时间长度//     isDragging = true; // 开始拖动// 计算拖动距离RectF rect = rectangles.get(currentRectIndex);rect.offset(0, (int) dy);//dx=0 只允许Y轴滑动 不允许x轴左右滑动}}break;}for (int n = 0; n < rectangles.size(); n++) {RectF rect = rectangles.get(n);boolean isLongPressStatusTemp = (activiesDataModelListl.get(n)).isLongPressStatus();if (rect != currentRect) {activiesDataModelListl.get(n).setLongPressStatus(false);}}//取消计时timerTask.cancel();timer.cancel();// 更新最后位置lastX = currentX;lastY = currentY;invalidate(); // 刷新视图}break;case MotionEvent.ACTION_UP:if (currentRect != null) {float dx = currentX - preX;float dy = currentY - preY;boolean isLongPressStatus = false;if(currentRectIndex!=-1){isLongPressStatus = (activiesDataModelListl.get(currentRectIndex)).isLongPressStatus();}if (dx == 0 && dy == 00) {//此处应该用绝对值来判断一个较小的数值if (!isLongPressStatus) {//不是长按状态的矩形boolean isHasTrue = false;for (int n = 0; n < rectangles.size(); n++) {RectF rect = rectangles.get(n);boolean isLongPressStatusTemp = (activiesDataModelListl.get(n)).isLongPressStatus();if (isLongPressStatusTemp) {isHasTrue = true;//检查是否存在点击状态的矩形}if (rect != currentRect) {activiesDataModelListl.get(n).setLongPressStatus(false);}}invalidate(); // 刷新视图if (isHasTrue) {} else {//如果没有选中状态矩形 则允许回调点击事件if (onclickListener != null) {onclickListener.onclick(currentRectIndex + "--" + activiesDataModelListl.get(currentRectIndex).getPop_name());}}} else {//点击的是长按状态的矩形}}preRect = currentRect;} else {//点击在非矩形区域isCancleClickStatus = false;//   isLongPressStatus = false;try {(activiesDataModelListl.get(currentRectIndex)).setLongPressStatus(false);} catch (Exception e) {e.getMessage();}invalidate(); // 刷新视图}// currentRectIndex = -1; // 取消触摸currentRect = null;currentHandle = NONE;//取消计时timerTask.cancel();timer.cancel();try {boolean longPressStatusUp = activiesDataModelListl.get(currentRectIndex).isLongPressStatus();// 恢复父容器 (ScrollView) 拦截触摸事件if (scrollView != null && !longPressStatusUp) {scrollView.requestDisallowInterceptTouchEvent(false);}} catch (Exception e) {e.getMessage();}break;case MotionEvent.ACTION_CANCEL:currentHandle = NONE;currentRectIndex = -1; // 取消触摸isLongPressStatus = false;//  (activiesDataModelListl.get(currentRectIndex)).setLongPressStatus(false);// 恢复父容器 (ScrollView) 拦截触摸事件if (scrollView != null) {scrollView.requestDisallowInterceptTouchEvent(false);}break;}return true;}private boolean isInHandle(float x, float y, RectF rect, int handle) {float handleSize = 60f; // 控制点的尺寸switch (handle) {case LEFT_TOP:return x >= rect.left - handleSize / 2 && x <= rect.left + handleSize / 2 &&y >= rect.top - handleSize / 2 && y <= rect.top + handleSize / 2;case RIGHT_TOP:return x >= rect.right - handleSize / 2 && x <= rect.right + handleSize / 2 &&y >= rect.top - handleSize / 2 && y <= rect.top + handleSize / 2;case LEFT_BOTTOM:return x >= rect.left - handleSize / 2 && x <= rect.left + handleSize / 2 &&y >= rect.bottom - handleSize / 2 && y <= rect.bottom + handleSize / 2;case RIGHT_BOTTOM:return x >= rect.right - handleSize / 2 && x <= rect.right + handleSize / 2 &&y >= rect.bottom - handleSize / 2 && y <= rect.bottom + handleSize / 2;default:return false;}}public void addRectangle(float left, float top, int tags, String textC) {//rectWidth = getWidth()-400;RectF rect = new RectF(left, top, 1010, top + rectHeight);Map<Integer, RectF> map = new HashMap<Integer, RectF>();map.put(tags, rect);texts.add(textC);rectanglesMapList.add(map);rectangles.add(rect);invalidate(); // 刷新视图}public void addRectangle(ArrayList<ActiviesDataModel> list) {this.activiesDataModelListl = list;for (int i = 0; i < activiesDataModelListl.size(); i++) {ActiviesDataModel activiesDataModel = activiesDataModelListl.get(i);String name = activiesDataModel.getPop_name();String address = activiesDataModel.getPop_address();int popdb_id = activiesDataModel.getPopdb_id();String startTime = activiesDataModel.getStart_time();String endTime = activiesDataModel.getEnd_time();// 需要根据具体的业务逻辑计算 left 和 topfloat top_start = formatTimeToYValues(startTime);float bootom_end = formatTimeToYValues(endTime);float rect_height = bootom_end - top_start;float rect_width = this.getWidth() - mScaleRectToLeft;RectF rect = new RectF(mScaleRectToLeft, top_start, 1010, top_start + rect_height);Map<Integer, RectF> map = new HashMap<>();map.put(i, rect);texts.add(name + " \n " + address + " \n " + startTime + " \n " + endTime);rectanglesMapList.add(map);rectangles.add(rect);}invalidate(); // 刷新视图}// 转换刻度值为时间字符串private float formatTimeToYValues(String time_value) {float y_value = 0;String closesTime = findClosestTimeRange(time_value);// 绘制15分钟刻度线for (int n = 0; n <= TOTAL_SCALES; n++) {float y = n * mScaleWidth; // 计算刻度Y坐标int hour = n / 4;int minute = (n % 4) * 15; // 每个刻度15分钟if ((n / 4 + "").contains("24")) {hour = 0;}String timeHMText = String.format("%02d:%02d", hour, minute);if (closesTime.equals(timeHMText)) {y_value = y;break;}}return y_value;}public String findClosestTimeRange(String time) {String[] parts = time.split(":");int hour = Integer.parseInt(parts[0]);int minute = Integer.parseInt(parts[1]);int totalMinutes = hour * 60 + minute;// 找到最接近的15分钟的倍数int closestMultiple = Math.round((float) totalMinutes / 15) * 15;// 将最接近的总分钟数转换回HH:MM格式int closestHour = closestMultiple / 60;int closestMinute = closestMultiple % 60;return String.format("%02d:%02d", closestHour, closestMinute);}public void setonclicklistener(onclickListener listener) {this.onclickListener = listener;}public void setonLongclicklistener(onLongclicklistener listener) {this.onLongclickListener = listener;}public interface onclickListener {void onclick(String value);}public interface onLongclicklistener {void onLongclick(String value);}}

外面传入数据调用即可:

MultiRectView multiRectView = findViewById(R.id.multiRectView);multiRectView.setonclicklistener(this);multiRectView.setonLongclicklistener(this);multiRectView.setScrollView(scrollView);ActiviesDataModel activiesDataModel1 = new ActiviesDataModel();activiesDataModel1.setPop_name(" POP Name1 万客隆精选超市");activiesDataModel1.setPop_address("南京东路1024弄");activiesDataModel1.setPopdb_id(215639);activiesDataModel1.setStart_time("06:40");activiesDataModel1.setEnd_time("08:30");ActiviesDataModel activiesDataModel2 = new ActiviesDataModel();activiesDataModel2.setPop_name(" POP Name2 京东自营超市");activiesDataModel2.setPop_address("南京东路1024弄");activiesDataModel2.setPopdb_id(215638);activiesDataModel2.setStart_time("09:10");activiesDataModel2.setEnd_time("11:50");ActiviesDataModel activiesDataModel3 = new ActiviesDataModel();activiesDataModel3.setPop_name(" POP Name3 拼多多百亿补贴超市");activiesDataModel3.setPop_address("南京东路1024弄");activiesDataModel3.setPopdb_id(215637);activiesDataModel3.setStart_time("12:40");activiesDataModel3.setEnd_time("14:30");ActiviesDataModel activiesDataModel4 = new ActiviesDataModel();activiesDataModel4.setPop_name(" POP Name4 淘宝天猫超市");activiesDataModel4.setPop_address("南京东路1024弄");activiesDataModel4.setPopdb_id(215636);activiesDataModel4.setStart_time("15:40");activiesDataModel4.setEnd_time("17:30");

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/488975.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

特征交叉-CAN学习笔记代码解读

一 核心模块coaction 对于每个特征对(feature_pairs)weight, bias 来自于P_inductionP_fead是MLP的input 举个例子&#xff1a;如果是用户ID和产品ID的co-action&#xff0c;且产品ID是做induction&#xff0c;用户ID是做feed。 step1 用户ID/产品ID都先形成一个向量&#xf…

Java从入门到工作3 - 框架/工具

3.1、SpringBoot框架结构 在 Spring Boot 或微服务架构中&#xff0c;每个服务的文件目录结构通常遵循一定的约定。以下是一个常见的 Spring Boot 服务目录结构示例&#xff0c;以及各个文件和目录的简要说明&#xff1a; my-service │ ├── src │ ├── main │ │…

基于SpringBoot的青少年心理健康教育网站

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码、微信小程序源码 精品专栏&#xff1a;…

基于事件驱动的websocket简单实现

websocket的实现 什么是websocket&#xff1f; WebSocket 是一种网络通信协议&#xff0c;旨在为客户端和服务器之间提供全双工、实时的通信通道。它是在 HTML5 规范中引入的&#xff0c;可以让浏览器与服务器进行持久化连接&#xff0c;以便实现低延迟的数据交换。 WebSock…

JavaEE 【知识改变命运】04 多线程(3)

文章目录 多线程带来的风险-线程安全线程不安全的举例分析产出线程安全的原因&#xff1a;1.线程是抢占式的2. 多线程修改同一个变量&#xff08;程序的要求&#xff09;3. 原子性4. 内存可见性5. 指令重排序 总结线程安全问题产生的原因解决线程安全问题1. synchronized关键字…

ElasticSearch如何做性能优化?

大家好&#xff0c;我是锋哥。今天分享关于【ElasticSearch如何做性能优化&#xff1f;】面试题。希望对大家有帮助&#xff1b; ElasticSearch如何做性能优化&#xff1f; 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 在 Elasticsearch 中&#xff0c;性能优化是…

Chrome浏览器调用ActiveX控件--allWebOffice控件

背景 allWebOffice控件能够实现在浏览器窗口中在线操作文档的应用&#xff08;阅读、编辑、保存等&#xff09;&#xff0c;支持编辑文档时保留修改痕迹&#xff0c;支持书签位置内容动态填充&#xff0c;支持公文套红&#xff0c;支持文档保护控制等诸多办公功能&#xff0c;…

贪心算法(一)

目录 一、贪心算法 二、柠檬水找零 三、将数组和减半的最少操作次数 四、最大数 五、摆动序列 一、贪心算法 贪心算法的本质是选择每一阶段的局部最优&#xff0c;从而达到全局最优。 贪心策略&#xff1a;1、把解决问题的过程分为若干步。2、解决每一步的时候&#xff…

Scratch节日作品 | 圣诞节礼物——体验节日的温馨与编程的乐趣! ❄️

今天为大家推荐一款充满节日氛围的Scratch作品——《圣诞礼物》&#xff01;这款程序不仅带来了雪花飘落、圣诞老人和麋鹿的经典场景&#xff0c;还通过编程的形式让小朋友们体验到收到礼物的喜悦。通过这款游戏&#xff0c;小朋友们能学习编程知识、了解圣诞文化&#xff0c;同…

基于Qwen2-VL模型针对 ImageToText 任务进行微调训练 - 数据处理

基于Qwen2-VL模型针对 ImageToText 任务进行微调训练 - 数据处理 flyfish 给定的图像生成一段自然语言描述。它的目标是生成一个或多个句子&#xff0c;能够准确地描述图像中的主要内容、物体、动作、场景等信息。例如&#xff0c;对于一张包含一只狗在草地上奔跑的图像&…

Spring Boot整合 RabbitMQ

文章目录 一. 引入依赖二. 添加配置三. Work Queue(工作队列模式)声明队列生产者消费者 四. Publish/Subscribe(发布订阅模式)声明队列和交换机生产者消费者 五. Routing(路由模式)声明队列和交换机生产者消费者 六. Topics(通配符模式)声明队列和交换机生产者消费者 一. 引入依…

谷粒商城—分布式基础

1. 整体介绍 1)安装vagrant 2)安装Centos7 $ vagrant init centos/7 A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on…

【考前预习】1.计算机网络概述

往期推荐 子网掩码、网络地址、广播地址、子网划分及计算-CSDN博客 一文搞懂大数据流式计算引擎Flink【万字详解&#xff0c;史上最全】-CSDN博客 浅学React和JSX-CSDN博客 浅谈云原生--微服务、CICD、Serverless、服务网格_云原生 serverless-CSDN博客 浅谈维度建模、数据分析…

计算机视觉与医学的结合:推动医学领域研究的新机遇

目录 引言医学领域面临的发文难题计算机视觉与医学的结合&#xff1a;发展趋势计算机视觉结合医学的研究方向高区位参考文章结语 引言 计算机视觉&#xff08;Computer Vision, CV&#xff09;技术作为人工智能的重要分支&#xff0c;已经在多个领域取得了显著的应用成果&…

AI智算-k8s部署大语言模型管理工具Ollama

文章目录 简介k8s部署OllamaOpen WebUI访问Open-WebUI 简介 Github&#xff1a;https://github.com/ollama/ollama 官网&#xff1a;https://ollama.com/ API&#xff1a;https://github.com/ollama/ollama/blob/main/docs/api.md Ollama 是一个基于 Go 语言开发的可以本地运…

PyQt事件机制练习

一、思维导图 二、代码 import sysfrom PyQt6.QtTextToSpeech import QTextToSpeech from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QLineEdit from PyQt6 import uic from PyQt6.QtCore import Qt, QTimerEvent, QTimeclass MyWidget(QWidget):d…

硬件设计 | Altium Designer软件PCB规则设置

基于Altium Designer&#xff08;24.9.1&#xff09;版本 嘉立创PCB工艺加工能力范围说明-嘉立创PCB打样专业工厂-线路板打样 规则参考-嘉立创 注意事项 1.每次设置完规则参数都要点击应用保存 2.每次创建PCB&#xff0c;都要设置好参数 3.可以设置默认规则&#xff0c;将…

【计算机学习笔记】GB2312、GBK、Unicode等字符编码的理解

之前编写win32程序时没怎么关注过宽字符到底是个啥东西&#xff0c;最近在编写网络框架又遇到字符相关的问题&#xff0c;所以写一篇文章记录一下&#xff08;有些部分属于个人理解&#xff0c;如果有错误欢迎指出&#xff09; 目录 几个常见的编码方式Unicode和UTF-8、UTF-16、…

深入理解 CSS 文本换行: overflow-wrap 和 word-break

前言 正常情况下&#xff0c;在固定宽度的盒子中的中文会自动换行。但是&#xff0c;当遇到非常长的英文单词或者很长的 URL 时&#xff0c;文本可能就不会自动换行&#xff0c;而会溢出所在容器。幸运的是&#xff0c;CSS 为我们提供了一些和文本换行相关的属性&#xff1b;今…

centos9升级OpenSSH

需求 Centos9系统升级OpenSSH和OpenSSL OpenSSH升级为openssh-9.8p1 OpenSSL默认为OpenSSL-3.2.2&#xff08;根据需求进行升级&#xff09; 将源码包编译为rpm包 查看OpenSSH和OpenSSL版本 ssh -V下载源码包并上传到服务器 openssh最新版本下载地址 wget https://cdn.openb…