浏览代码

图片定位重命名,历史记录

chenzubin 2 月之前
父节点
当前提交
35b7d66745

+ 1 - 0
app/build.gradle

@@ -70,4 +70,5 @@ dependencies {
70 70
     implementation 'com.github.sahooz:ImageMapView:1.0.1'
71 71
     implementation 'com.github.getActivity:XXPermissions:20.0'
72 72
     implementation 'androidx.databinding:databinding-runtime:4.0.0'
73
+    implementation 'com.github.zrunker:ZImageView:v1.0'
73 74
 }

+ 9 - 4
app/src/main/AndroidManifest.xml

@@ -26,7 +26,11 @@
26 26
         <activity
27 27
             android:name=".HistoryActivity"
28 28
             android:exported="true" >
29
+            <intent-filter>
30
+                <action android:name="android.intent.action.MAIN" />
29 31
 
32
+                <category android:name="android.intent.category.LAUNCHER" />
33
+            </intent-filter>
30 34
         </activity>
31 35
 
32 36
         <meta-data
@@ -58,11 +62,12 @@
58 62
         <activity
59 63
             android:name=".MainActivity"
60 64
             android:exported="true">
61
-            <intent-filter>
62
-                <action android:name="android.intent.action.MAIN" />
63 65
 
64
-                <category android:name="android.intent.category.LAUNCHER" />
65
-            </intent-filter>
66
+        </activity>
67
+        <activity
68
+            android:name=".ShowImageActivity"
69
+            android:exported="true">
70
+
66 71
         </activity>
67 72
     </application>
68 73
 

+ 47 - 1
app/src/main/java/com/cfmlg/mlg/CustomImageView.java

@@ -4,7 +4,11 @@ import android.content.Context;
4 4
 import android.graphics.Bitmap;
5 5
 import android.graphics.BitmapFactory;
6 6
 import android.graphics.Canvas;
7
+import android.graphics.Point;
7 8
 import android.util.AttributeSet;
9
+import android.util.DisplayMetrics;
10
+import android.util.Log;
11
+import android.view.MotionEvent;
8 12
 import android.view.View;
9 13
 
10 14
 public class CustomImageView extends View {
@@ -36,7 +40,8 @@ public class CustomImageView extends View {
36 40
     protected void onDraw(Canvas canvas) {
37 41
         super.onDraw(canvas);
38 42
         if (bitmap != null) {
39
-            canvas.drawBitmap(bitmap, 0, 0, null);
43
+            Point p = getCenter();
44
+            canvas.drawBitmap(bitmap, p.x / 2 - bitmap.getWidth() / 2, p.y / 2 - bitmap.getHeight() / 2, null);
40 45
         }
41 46
     }
42 47
 
@@ -45,4 +50,45 @@ public class CustomImageView extends View {
45 50
         this.bitmap = bitmap;
46 51
         invalidate(); // 重新绘制视图
47 52
     }
53
+
54
+    int startX, startY, startLeft, startTop, statusHeight;
55
+    @Override
56
+    public boolean onTouchEvent(MotionEvent event) {
57
+
58
+
59
+        switch (event.getAction())
60
+        {
61
+            case MotionEvent.ACTION_DOWN:
62
+                startX=(int)event.getRawX();
63
+                startY=(int)event.getRawY();
64
+                startLeft=(int)(startX-event.getX());
65
+                startTop= (int)(startY-event.getY())-statusHeight;
66
+
67
+                Point p = getCenter();
68
+                if(startX < p.x / 2 && startY < p.y / 2) {
69
+                    Video.position = 1;
70
+                } else if(startX > p.x / 2 && startY < p.y / 2) {
71
+                    Video.position = 2;
72
+                } else if(startX < p.x / 2 && startY > p.y / 2) {
73
+                    Video.position = 4;
74
+                } else if(startX > p.x / 2 && startY > p.y / 2) {
75
+                    Video.position = 3;
76
+                }
77
+                break;
78
+            case MotionEvent.ACTION_MOVE:
79
+                break;
80
+            case MotionEvent.ACTION_UP:
81
+                break;
82
+        }
83
+        return false;
84
+    }
85
+
86
+    private Point getCenter() {
87
+        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
88
+        Point point = new Point();
89
+        point.x = displayMetrics.widthPixels;
90
+        point.y = displayMetrics.heightPixels;
91
+        Log.e("czb", point.x + " " + point.y);
92
+        return point;
93
+    }
48 94
 }

+ 293 - 0
app/src/main/java/com/cfmlg/mlg/DateUtils.java

@@ -0,0 +1,293 @@
1
+package com.cfmlg.mlg;
2
+
3
+
4
+import android.text.TextUtils;
5
+
6
+import java.text.ParseException;
7
+import java.text.SimpleDateFormat;
8
+import java.util.Calendar;
9
+import java.util.Date;
10
+import java.util.Locale;
11
+
12
+public class DateUtils {
13
+    private static final String UNIT_MONTH = "月前";
14
+    private static final String UNIT_DAY = "天前";
15
+    private static final String UNIT_HOUR = "小时前";
16
+    private static final String UNIT_MINUTE = "分钟前";
17
+
18
+    public static final String TYPE_CHAR_FORMAT_DAY = "yyyy年MM月dd日HH时mm分ss秒";
19
+    public static final String TYPE_FULL_COMMON_FORMAT = "yyyy-MM-dd HH:mm:ss";
20
+    public static final String TYPE_COMMON_FORMAT_DAY = "yyyy-MM-dd";
21
+    public static final String TYPE_TIME_COMMON_FORMAT = "HH:mm:ss";
22
+
23
+    public static final String TYPE_FORMAT_MONTH = "yyyy-MM";
24
+    public static final String TYPE_MONTHY_DAY = "MM-dd";
25
+
26
+
27
+    public static String formatDate(String oldDateType, String newDateType, String value) {
28
+        final SimpleDateFormat format = new SimpleDateFormat(oldDateType);
29
+        Date date = null;
30
+        try {
31
+            date = format.parse(value);
32
+        } catch (ParseException e) {
33
+            return value;
34
+        }
35
+        final SimpleDateFormat newFormat = new SimpleDateFormat(newDateType);
36
+        return newFormat.format(date);
37
+    }
38
+
39
+    public static String getCharFormatDay() {
40
+        final SimpleDateFormat format = new SimpleDateFormat(TYPE_CHAR_FORMAT_DAY);
41
+        Date date = new Date();
42
+        return format.format(date);
43
+    }
44
+
45
+    public static String getCommonFormatDay() {
46
+        final SimpleDateFormat format = new SimpleDateFormat(TYPE_COMMON_FORMAT_DAY);
47
+        Date date = new Date();
48
+        return format.format(date);
49
+    }
50
+
51
+    public static String getCommonTime() {
52
+        final SimpleDateFormat format = new SimpleDateFormat(TYPE_TIME_COMMON_FORMAT);
53
+        Date date = new Date();
54
+        return format.format(date);
55
+    }
56
+
57
+    /**
58
+     * 传入时间及格式
59
+     *
60
+     * @param format 格式
61
+     * @param value  时间
62
+     * @return 特定格式时间
63
+     */
64
+    public static String getShowTime(String format, String value) {
65
+        SimpleDateFormat sf = new SimpleDateFormat(format);
66
+        try {
67
+            Date date = sf.parse(value);
68
+            long targetTime = date.getTime();
69
+            return getShowTime(targetTime);
70
+        } catch (ParseException e) {
71
+            return 1 + UNIT_MINUTE;
72
+        }
73
+    }
74
+
75
+
76
+    /**
77
+     * 传入时间及格式
78
+     *
79
+     * @param time long类型时间
80
+     * @return 特定格式时间
81
+     */
82
+    public static String getShowTime(long time) {
83
+        Date nowDate = new Date();
84
+        long nowTime = nowDate.getTime();
85
+        long differTime = nowTime - time;
86
+        long minute = 1000 * 60;
87
+        if (differTime <= 0 || differTime < minute) {
88
+            return 1 + UNIT_MINUTE;
89
+        }
90
+
91
+        long hour = 1000 * 60 * 60;
92
+        if (differTime < hour) {
93
+            long showMinute = (differTime / minute) % 60;
94
+            return (showMinute == 0 ? 1 : showMinute) + UNIT_MINUTE;
95
+        }
96
+        long day = 24 * hour;
97
+        if (differTime < day) {
98
+            long showHour = (differTime / hour) % 24;
99
+            return (showHour == 0 ? 1 : showHour) + UNIT_HOUR;
100
+        }
101
+        long month = 30 * day;
102
+        if (differTime < month) {
103
+            long showDay = (differTime / day) % 30;
104
+            return (showDay == 0 ? 1 : showDay) + UNIT_DAY;
105
+        }
106
+        long year = 12 * month;
107
+        if (differTime < year) {
108
+            long showMonth = (differTime / month) % 12;
109
+            return (showMonth == 0 ? 1 : showMonth) + UNIT_MONTH;
110
+        }
111
+        return 12 + UNIT_MONTH;
112
+    }
113
+
114
+    public static long getDateToLong(String format, String date) {
115
+        SimpleDateFormat sf = new SimpleDateFormat(format);
116
+        try {
117
+            Date parse = sf.parse(date);
118
+            return parse.getTime();
119
+        } catch (ParseException e) {
120
+            return new Date().getTime();
121
+        }
122
+    }
123
+
124
+    public static String getDataByFormat(String format, long data) {
125
+        SimpleDateFormat sf = new SimpleDateFormat(format);
126
+        return sf.format(new Date(data));
127
+    }
128
+
129
+    public static int getMonthByDate() {
130
+        // 获取日期实例
131
+        Calendar calendar = Calendar.getInstance();
132
+        // 这里要注意,月份是从0开始。
133
+        int month = calendar.get(Calendar.MONTH);
134
+        return month + 1;
135
+    }
136
+
137
+    public static int getYearByDate() {
138
+        // 获取日期实例
139
+        Calendar calendar = Calendar.getInstance();
140
+        // 这里要注意,月份是从0开始。
141
+        int year = calendar.get(Calendar.YEAR);
142
+        return year;
143
+    }
144
+
145
+    public static int getMonthByDate(long date) {
146
+        // 获取日期实例
147
+        Calendar calendar = Calendar.getInstance();
148
+        // 将日历设置为指定的时间
149
+        calendar.setTimeInMillis(date);
150
+        // 这里要注意,月份是从0开始。
151
+        int month = calendar.get(Calendar.MONTH);
152
+        return month + 1;
153
+    }
154
+
155
+    public static int getDayByDate() {
156
+        // 获取日期实例
157
+        Calendar calendar = Calendar.getInstance();
158
+        // 这里要注意,月份是从0开始。
159
+        int day = calendar.get(Calendar.DAY_OF_MONTH);
160
+        return day;
161
+    }
162
+
163
+    public static String getPreOrNextMonth(long time, boolean isPre) {
164
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
165
+        ca.setTimeInMillis(time);
166
+        Date now = ca.getTime();
167
+        if (isPre) {
168
+            ca.add(Calendar.MONTH, -1); //月份减1
169
+        } else {
170
+            ca.add(Calendar.MONTH, +1); //月份减1
171
+        }
172
+        Date lastMonth = ca.getTime(); //结果
173
+        SimpleDateFormat sf = new SimpleDateFormat(TYPE_COMMON_FORMAT_DAY);
174
+        return sf.format(lastMonth);
175
+    }
176
+
177
+    public static String getPreOrNextMonth(long time, boolean isPre, String formatType) {
178
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
179
+        ca.setTimeInMillis(time);
180
+        Date now = ca.getTime();
181
+        if (isPre) {
182
+            ca.add(Calendar.MONTH, -1); //月份减1
183
+        } else {
184
+            ca.add(Calendar.MONTH, +1); //月份减1
185
+        }
186
+        Date lastMonth = ca.getTime(); //结果
187
+        SimpleDateFormat sf = new SimpleDateFormat(formatType);
188
+        return sf.format(lastMonth);
189
+    }
190
+
191
+    public static String getPreOrNextDay(long time, boolean isPre) {
192
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
193
+        ca.setTimeInMillis(time);
194
+        Date now = ca.getTime();
195
+        if (isPre) {
196
+            ca.add(Calendar.DATE, -1);
197
+        } else {
198
+            ca.add(Calendar.DATE, +1);
199
+        }
200
+        Date lastMonth = ca.getTime(); //结果
201
+        SimpleDateFormat sf = new SimpleDateFormat(TYPE_COMMON_FORMAT_DAY);
202
+        return sf.format(lastMonth);
203
+    }
204
+
205
+    public static Date getPreOrNextDayToDate(long time, boolean isPre) {
206
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
207
+        ca.setTimeInMillis(time);
208
+        Date now = ca.getTime();
209
+        if (isPre) {
210
+            ca.add(Calendar.DATE, -1);
211
+        } else {
212
+            ca.add(Calendar.DATE, +1);
213
+        }
214
+        Date lastMonth = ca.getTime(); //结果
215
+        return lastMonth;
216
+    }
217
+
218
+    public static String[] WEEK_DAYS = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
219
+
220
+    /**
221
+     * 获取日期是周几
222
+     *
223
+     * @param dt 日期
224
+     * @return 周几的角标
225
+     */
226
+    public static int getWeekOfDate(Date dt) {
227
+        Calendar cal = Calendar.getInstance();
228
+        cal.setTime(dt);
229
+        int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
230
+        if (w < 0)
231
+            w = 0;
232
+        return w;
233
+    }
234
+
235
+    /**
236
+     * 获取每月多少天
237
+     *
238
+     * @param formatType 日期的格式化
239
+     * @param date       日期
240
+     * @return 当月总天数
241
+     */
242
+    public static int getDaysByMonth(String formatType, String date) {
243
+        Calendar c = Calendar.getInstance();
244
+        if (date == null) {
245
+            return c.getActualMaximum(Calendar.DAY_OF_MONTH);
246
+        } else {
247
+            SimpleDateFormat sf = new SimpleDateFormat(formatType);
248
+            try {
249
+                Date d = sf.parse(date);
250
+                c.setTime(d);
251
+                return c.getActualMaximum(Calendar.DAY_OF_MONTH);
252
+            } catch (ParseException e) {
253
+                return 30;
254
+            }
255
+        }
256
+    }
257
+
258
+    public static String convertStringToDateForCST(String currentTimeType, String time) {
259
+        if (TextUtils.isEmpty(time)) {
260
+            return null;
261
+        }
262
+        try {
263
+            SimpleDateFormat formatter = new SimpleDateFormat("EEE d MMM yyyy", Locale.ENGLISH);
264
+            SimpleDateFormat sdt = new SimpleDateFormat(currentTimeType);
265
+            Date date = sdt.parse(time);
266
+            return formatter.format(date);
267
+
268
+        } catch (Exception e) {
269
+            e.printStackTrace();
270
+            return null;
271
+        }
272
+    }
273
+
274
+    public static String getNowHour() {
275
+        String hour = "";
276
+
277
+        Date today = new Date();
278
+        SimpleDateFormat sf = new SimpleDateFormat("HH");
279
+        hour = sf.format(today);
280
+
281
+        return hour;
282
+    }
283
+
284
+    public static String getNowMinute() {
285
+        String minute = "";
286
+
287
+        Date today = new Date();
288
+        SimpleDateFormat sf = new SimpleDateFormat("mm");
289
+        minute = sf.format(today);
290
+
291
+        return minute;
292
+    }
293
+}

+ 262 - 0
app/src/main/java/com/cfmlg/mlg/DrawingView.java

@@ -0,0 +1,262 @@
1
+package com.cfmlg.mlg;
2
+
3
+import android.content.Context;
4
+import android.graphics.Bitmap;
5
+import android.graphics.Canvas;
6
+import android.graphics.Color;
7
+import android.graphics.Matrix;
8
+import android.graphics.Paint;
9
+import android.graphics.Path;
10
+import android.graphics.PorterDuff;
11
+import android.graphics.PorterDuffXfermode;
12
+import android.util.AttributeSet;
13
+import android.util.Log;
14
+import android.view.MotionEvent;
15
+import android.view.View;
16
+
17
+import androidx.annotation.ColorInt;
18
+
19
+import java.util.LinkedList;
20
+
21
+public class DrawingView extends View {
22
+    private static final String TAG = "czb";
23
+    private static final float TOUCH_TOLERANCE = 4;
24
+    private Bitmap mBitmap;
25
+    private Bitmap mOriginBitmap;
26
+    private Canvas mCanvas;
27
+    private Path mPath;
28
+    private Paint mBitmapPaint;
29
+    private Paint mPaint;
30
+    private boolean mDrawMode;
31
+    private float mX, mY;
32
+    private float mProportion = 0;
33
+    private LinkedList<DrawPath> savePath;
34
+    private DrawPath mLastDrawPath;
35
+    private Matrix matrix;
36
+    private float mPaintBarPenSize;
37
+    private int mPaintBarPenColor;
38
+
39
+    public DrawingView(Context c) {
40
+        this(c, null);
41
+    }
42
+
43
+    public DrawingView(Context c, AttributeSet attrs) {
44
+        this(c, attrs, 0);
45
+    }
46
+
47
+    public DrawingView(Context c, AttributeSet attrs, int defStyle) {
48
+        super(c, attrs, defStyle);
49
+        init();
50
+    }
51
+
52
+    private void init() {
53
+        Log.d(TAG, "init: ");
54
+        mBitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
55
+        mDrawMode = false;
56
+        savePath = new LinkedList<>();
57
+        matrix = new Matrix();
58
+    }
59
+
60
+    @Override
61
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
62
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
63
+
64
+        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
65
+        int heightSize = MeasureSpec.getSize(heightMeasureSpec);
66
+
67
+        if (mBitmap != null) {
68
+            if ((mBitmap.getHeight() > heightSize) && (mBitmap.getHeight() > mBitmap.getWidth())) {
69
+                widthSize = heightSize * mBitmap.getWidth() / mBitmap.getHeight();
70
+            } else if ((mBitmap.getWidth() > widthSize) && (mBitmap.getWidth() > mBitmap.getHeight())) {
71
+                heightSize = widthSize * mBitmap.getHeight() / mBitmap.getWidth();
72
+            } else {
73
+                heightSize = mBitmap.getHeight();
74
+                widthSize = mBitmap.getWidth();
75
+            }
76
+        }
77
+        Log.d(TAG, "onMeasure: heightSize: " + heightSize + " widthSize: " + widthSize);
78
+        setMeasuredDimension(widthSize, heightSize);
79
+    }
80
+
81
+    @Override
82
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
83
+        super.onSizeChanged(w, h, oldw, oldh);
84
+        if (mBitmap == null) {
85
+            mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
86
+        }
87
+        mCanvas = new Canvas(mBitmap);
88
+        mCanvas.drawColor(Color.TRANSPARENT);
89
+    }
90
+
91
+    @Override
92
+    protected void onDraw(Canvas canvas) {
93
+        super.onDraw(canvas);
94
+        // 根据图片尺寸缩放图片,同样只考虑了高大于宽的情况
95
+        float proportion = (float) canvas.getHeight() / mBitmap.getHeight();
96
+        if (proportion < 1) {
97
+            mProportion = proportion;
98
+            matrix.reset();
99
+            matrix.postScale(proportion, proportion);
100
+            matrix.postTranslate((canvas.getWidth() - mBitmap.getWidth() * proportion) / 2, 0);
101
+            canvas.drawBitmap(mBitmap, matrix, mBitmapPaint);
102
+        } else {
103
+            mProportion = 0;
104
+            canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
105
+        }
106
+    }
107
+
108
+    @Override
109
+    public boolean onTouchEvent(MotionEvent event) {
110
+        // 如果你的界面有多个模式,你需要有个变量来判断当前是否可draw
111
+        if (!mDrawMode) {
112
+            return false;
113
+        }
114
+        float x;
115
+        float y;
116
+        if (mProportion != 0) {
117
+            x = (event.getX()) / mProportion;
118
+            y = event.getY() / mProportion;
119
+        } else {
120
+            x = event.getX();
121
+            y = event.getY();
122
+        }
123
+        switch (event.getAction()) {
124
+            case MotionEvent.ACTION_DOWN:
125
+                // This happens when we undo a path
126
+                if (mLastDrawPath != null) {
127
+                    mPaint.setColor(mPaintBarPenColor);
128
+                    mPaint.setStrokeWidth(mPaintBarPenSize);
129
+                }
130
+                mPath = new Path();
131
+                mPath.reset();
132
+                mPath.moveTo(x, y);
133
+                mX = x;
134
+                mY = y;
135
+                mCanvas.drawPath(mPath, mPaint);
136
+                break;
137
+            case MotionEvent.ACTION_MOVE:
138
+                float dx = Math.abs(x - mX);
139
+                float dy = Math.abs(y - mY);
140
+                if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
141
+                    mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
142
+                    mX = x;
143
+                    mY = y;
144
+                }
145
+                mCanvas.drawPath(mPath, mPaint);
146
+                break;
147
+            case MotionEvent.ACTION_UP:
148
+                mPath.lineTo(mX, mY);
149
+                mCanvas.drawPath(mPath, mPaint);
150
+                mLastDrawPath = new DrawPath(mPath, mPaint.getColor(), mPaint.getStrokeWidth());
151
+                savePath.add(mLastDrawPath);
152
+                mPath = null;
153
+                break;
154
+            default:
155
+                break;
156
+        }
157
+        invalidate();
158
+        return true;
159
+    }
160
+
161
+    public void initializePen() {
162
+        mDrawMode = true;
163
+        mPaint = null;
164
+        mPaint = new Paint();
165
+        mPaint.setAntiAlias(true);
166
+        mPaint.setDither(true);
167
+        mPaint.setFilterBitmap(true);
168
+        mPaint.setStyle(Paint.Style.STROKE);
169
+        mPaint.setStrokeJoin(Paint.Join.ROUND);
170
+        mPaint.setStrokeCap(Paint.Cap.ROUND);
171
+        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER));
172
+    }
173
+
174
+    @Override
175
+    public void setBackgroundColor(int color) {
176
+        mCanvas.drawColor(color);
177
+        super.setBackgroundColor(color);
178
+    }
179
+
180
+    /**
181
+     * This method should ONLY be called by clicking paint toolbar(outer class)
182
+     */
183
+    public void setPenSize(float size) {
184
+        mPaintBarPenSize = size;
185
+        mPaint.setStrokeWidth(size);
186
+    }
187
+
188
+    public float getPenSize() {
189
+        return mPaint.getStrokeWidth();
190
+    }
191
+
192
+    /**
193
+     * This method should ONLY be called by clicking paint toolbar(outer class)
194
+     */
195
+    public void setPenColor(@ColorInt int color) {
196
+        mPaintBarPenColor = color;
197
+        mPaint.setColor(color);
198
+    }
199
+
200
+    public
201
+    @ColorInt
202
+    int getPenColor() {
203
+        return mPaint.getColor();
204
+    }
205
+
206
+    /**
207
+     * @return 当前画布上的内容
208
+     */
209
+    public Bitmap getImageBitmap() {
210
+        return mBitmap;
211
+    }
212
+
213
+    public void loadImage(Bitmap bitmap) {
214
+        Log.d(TAG, "loadImage: ");
215
+        mOriginBitmap = bitmap;
216
+        mBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
217
+        mCanvas = new Canvas(mBitmap);
218
+        invalidate();
219
+    }
220
+
221
+    public void undo() {
222
+        Log.d(TAG, "undo: recall last path");
223
+        if (savePath != null && savePath.size() > 0) {
224
+            // 清空画布
225
+            mCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
226
+            loadImage(mOriginBitmap);
227
+
228
+            savePath.removeLast();
229
+
230
+            // 将路径保存列表中的路径重绘在画布上 遍历绘制
231
+            for (DrawPath dp : savePath) {
232
+                mPaint.setColor(dp.getPaintColor());
233
+                mPaint.setStrokeWidth(dp.getPaintWidth());
234
+                mCanvas.drawPath(dp.path, mPaint);
235
+            }
236
+            invalidate();
237
+        }
238
+    }
239
+
240
+    /**
241
+     * 路径对象
242
+     */
243
+    private class DrawPath {
244
+        Path path;
245
+        int paintColor;
246
+        float paintWidth;
247
+
248
+        DrawPath(Path path, int paintColor, float paintWidth) {
249
+            this.path = path;
250
+            this.paintColor = paintColor;
251
+            this.paintWidth = paintWidth;
252
+        }
253
+
254
+        int getPaintColor() {
255
+            return paintColor;
256
+        }
257
+
258
+        float getPaintWidth() {
259
+            return paintWidth;
260
+        }
261
+    }
262
+}

文件差异内容过多而无法显示
+ 1164 - 1
app/src/main/java/com/cfmlg/mlg/HistoryActivity.java


+ 81 - 0
app/src/main/java/com/cfmlg/mlg/ShowImageActivity.java

@@ -0,0 +1,81 @@
1
+package com.cfmlg.mlg;
2
+
3
+import android.graphics.Bitmap;
4
+import android.graphics.BitmapFactory;
5
+import android.graphics.Canvas;
6
+import android.graphics.Color;
7
+import android.graphics.Paint;
8
+import android.os.Bundle;
9
+import android.os.Handler;
10
+import android.util.Log;
11
+import android.view.View;
12
+import android.widget.Button;
13
+import android.widget.ImageView;
14
+
15
+import androidx.appcompat.app.AppCompatActivity;
16
+
17
+import java.io.File;
18
+import java.io.FileOutputStream;
19
+import java.io.IOException;
20
+
21
+public class ShowImageActivity extends AppCompatActivity implements View.OnClickListener {
22
+
23
+    //private ImageView imageView;
24
+    private Button save;
25
+    private Button reset;
26
+    private Bitmap panel;
27
+    private Canvas canvas;
28
+    private Paint paint;
29
+    private float downX;
30
+    private float downY;
31
+    private ImageView mDrawingView;
32
+
33
+    @Override
34
+    protected void onCreate(Bundle savedInstanceState) {
35
+        super.onCreate(savedInstanceState);
36
+        setContentView(R.layout.activity_show_image);
37
+        initView();
38
+    }
39
+
40
+    private void initView() {
41
+        mDrawingView = (ImageView) findViewById(R.id.hw);
42
+        mDrawingView.setImageBitmap(BitmapFactory.decodeFile(getIntent().getStringExtra("imgPath")));
43
+    }
44
+
45
+    private Handler mHandler = new Handler();
46
+    @Override
47
+    public void onClick(View v) {
48
+        int id = v.getId();
49
+
50
+    }
51
+
52
+    private void saveMyBitmap(){
53
+        File f = new File(getIntent().getStringExtra("imgPath"));
54
+        try {
55
+            if(!f.exists())
56
+                f.createNewFile();
57
+        } catch (IOException e) {
58
+            Log.e("czb", "e1 ", e);
59
+            e.printStackTrace();
60
+        }
61
+        FileOutputStream fOut = null;
62
+        try {
63
+            fOut = new FileOutputStream(f);
64
+        } catch (Exception e) {
65
+            Log.e("czb", "e2 ", e);
66
+            e.printStackTrace();
67
+        }
68
+        try {
69
+            fOut.flush();
70
+        } catch (IOException e) {
71
+            Log.e("czb", "e3 ", e);
72
+            e.printStackTrace();
73
+        }
74
+        try {
75
+            fOut.close();
76
+        } catch (IOException e) {
77
+            Log.e("czb", "e4 ", e);
78
+            e.printStackTrace();
79
+        }
80
+    }
81
+}

+ 79 - 32
app/src/main/java/com/cfmlg/mlg/Video.java

@@ -6,6 +6,7 @@ import android.content.Intent;
6 6
 import android.content.pm.PackageManager;
7 7
 import android.content.res.AssetFileDescriptor;
8 8
 import android.graphics.Bitmap;
9
+import android.graphics.BitmapFactory;
9 10
 import android.graphics.SurfaceTexture;
10 11
 import android.media.MediaPlayer;
11 12
 import android.media.SoundPool;
@@ -97,6 +98,8 @@ public class Video extends AppCompatActivity {
97 98
 
98 99
     private native int GetJPGFileData(byte[] in, byte[] data, byte[] name);
99 100
 
101
+    public static int position = 0;
102
+
100 103
     private native int DeleteAllJPG();
101 104
 
102 105
     private native int GetVersion(byte[] out);
@@ -143,6 +146,8 @@ public class Video extends AppCompatActivity {
143 146
         long period1 = 1;
144 147
         service.scheduleAtFixedRate(new Task1(), initialDelay1, period1, TimeUnit.SECONDS);
145 148
 
149
+        binding.imv.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ya));
150
+
146 151
         new Thread(new Runnable() {
147 152
             @Override
148 153
             public void run() {
@@ -152,43 +157,75 @@ public class Video extends AppCompatActivity {
152 157
         binding.handleCap.setOnClickListener(new View.OnClickListener() {
153 158
             @Override
154 159
             public void onClick(View v) {
155
-                handler.postDelayed(new Runnable() {
156
-                    @Override
160
+                binding.imv.setVisibility(View.VISIBLE);
161
+                new Thread() {
157 162
                     public void run() {
158
-                        totalTime--;
159
-                        countdownTextView.setText(String.valueOf(totalTime));
160
-                        countdownTextView.setVisibility(View.VISIBLE);
161
-                        if (totalTime > 0) {
162
-                            handler.postDelayed(this, 1000);
163
-                        } else {
164
-                            totalTime = 4;
165
-                            countdownTextView.setVisibility(View.GONE);
166
-                            SoundPool soundPool = new SoundPool.Builder().setMaxStreams(1).build();
167
-                            int soundId = soundPool.load(Video.this, R.raw.kuaimen, 1); // 加载音频资源
168
-                            soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
169
-                                @Override
170
-                                public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
171
-                                    soundPool.play(soundId, 1, 1, 1, 0, 1); // 播放音频
172
-                                }
173
-                            });
174
-                            Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
175
-                            saveImageToGallery(getApplicationContext(), bitmap);
163
+                        while (position == 0) {
176 164
                             try {
177
-                                File file = new File(getSdPath(), System.currentTimeMillis() + ".jpg");
178
-                                OutputStream outputStream = new FileOutputStream(file);
179
-
180
-                                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
181
-
182
-                                outputStream.close();
183
-                                Toast.makeText(Video.this, "图片已保存到" + getSdPath() + "目录", Toast.LENGTH_SHORT).show();
184
-                            } catch (FileNotFoundException e) {
185
-                                throw new RuntimeException(e);
186
-                            } catch (IOException e) {
165
+                                Thread.sleep(1000);
166
+                            } catch (InterruptedException e) {
187 167
                                 throw new RuntimeException(e);
188 168
                             }
189 169
                         }
170
+
171
+                        handler.postDelayed(new Runnable() {
172
+                            @Override
173
+                            public void run() {
174
+                                binding.imv.setVisibility(View.GONE);
175
+                                totalTime--;
176
+                                countdownTextView.setText(String.valueOf(totalTime));
177
+                                countdownTextView.setVisibility(View.VISIBLE);
178
+                                if (totalTime > 0) {
179
+                                    handler.postDelayed(this, 1000);
180
+                                } else {
181
+                                    totalTime = 4;
182
+                                    countdownTextView.setVisibility(View.GONE);
183
+                                    SoundPool soundPool = new SoundPool.Builder().setMaxStreams(1).build();
184
+                                    int soundId = soundPool.load(Video.this, R.raw.kuaimen, 1); // 加载音频资源
185
+                                    soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
186
+                                        @Override
187
+                                        public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
188
+                                            soundPool.play(soundId, 1, 1, 1, 0, 1); // 播放音频
189
+                                        }
190
+                                    });
191
+                                    Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
192
+                                    saveImageToGallery(getApplicationContext(), bitmap);
193
+                                    try {
194
+                                        String name = "1";
195
+                                        switch (position) {
196
+                                            case 1:
197
+                                                name = "左上";
198
+                                                break;
199
+                                            case 2:
200
+                                                name = "右上";
201
+                                                break;
202
+                                            case 3:
203
+                                                name = "左下";
204
+                                                break;
205
+                                            case 4:
206
+                                                name = "右下";
207
+                                                break;
208
+                                        }
209
+                                        File file = new File(getSdPath(), name + "_" + DateUtils.getCharFormatDay() + ".jpg");
210
+                                        OutputStream outputStream = new FileOutputStream(file);
211
+
212
+                                        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
213
+
214
+                                        outputStream.close();
215
+                                        position = 0;
216
+                                    } catch (FileNotFoundException e) {
217
+                                        throw new RuntimeException(e);
218
+                                    } catch (IOException e) {
219
+                                        throw new RuntimeException(e);
220
+                                    }
221
+                                }
222
+
223
+                            }
224
+                        }, 50);
190 225
                     }
191
-                }, 1000);
226
+                }.start();
227
+
228
+
192 229
 
193 230
             }
194 231
         });
@@ -326,6 +363,14 @@ public class Video extends AppCompatActivity {
326 363
                 handler.postDelayed(new Runnable() {
327 364
                     @Override
328 365
                     public void run() {
366
+                        binding.imv.setVisibility(View.VISIBLE);
367
+                        while (position == 0) {
368
+                            try {
369
+                                Thread.sleep(1000);
370
+                            } catch (InterruptedException e) {
371
+                                throw new RuntimeException(e);
372
+                            }
373
+                        }
329 374
                         totalTime--;
330 375
                         countdownTextView.setText(String.valueOf(totalTime));
331 376
                         countdownTextView.setVisibility(View.VISIBLE);
@@ -358,10 +403,12 @@ public class Video extends AppCompatActivity {
358 403
                                 throw new RuntimeException(e);
359 404
                             }
360 405
                         }
406
+
407
+                        binding.imv.setVisibility(View.GONE);
408
+                        position = 0;
361 409
                     }
362 410
                 }, 1000);
363 411
 
364
-
365 412
                 inputStream.close();
366 413
                 socket.close();
367 414
             }

二进制
app/src/main/res/drawable/team.png


二进制
app/src/main/res/drawable/time.png


二进制
app/src/main/res/drawable/video.png


+ 414 - 41
app/src/main/res/layout/activity_history.xml

@@ -4,60 +4,433 @@
4 4
     xmlns:tools="http://schemas.android.com/tools">
5 5
 
6 6
     <data>
7
+
8
+        <variable
9
+            name="imageUrl1"
10
+            type="String" />
11
+
12
+        <variable
13
+            name="imageUrl2"
14
+            type="String" />
15
+
16
+        <variable
17
+            name="imageUrl3"
18
+            type="String" />
19
+
20
+        <variable
21
+            name="imageUrl4"
22
+            type="String" />
23
+
24
+        <variable
25
+            name="imageUrl5"
26
+            type="String" />
27
+
28
+        <variable
29
+            name="imageUrl6"
30
+            type="String" />
31
+
32
+        <variable
33
+            name="imageUrl7"
34
+            type="String" />
35
+
36
+        <variable
37
+            name="imageUrl8"
38
+            type="String" />
39
+
40
+        <variable
41
+            name="imageUrl9"
42
+            type="String" />
43
+
44
+        <variable
45
+            name="imageUrl10"
46
+            type="String" />
47
+
48
+        <variable
49
+            name="imageUrl11"
50
+            type="String" />
51
+
52
+        <variable
53
+            name="imageUrl12"
54
+            type="String" />
55
+
56
+        <variable
57
+            name="imageUrl13"
58
+            type="String" />
59
+
60
+        <variable
61
+            name="imageUrl14"
62
+            type="String" />
63
+
64
+        <variable
65
+            name="imageUrl15"
66
+            type="String" />
67
+
68
+        <variable
69
+            name="imageUrl16"
70
+            type="String" />
71
+
72
+        <variable
73
+            name="imageUrl17"
74
+            type="String" />
75
+
76
+        <variable
77
+            name="imageUrl18"
78
+            type="String" />
79
+
80
+        <variable
81
+            name="imageUrl19"
82
+            type="String" />
83
+
84
+        <variable
85
+            name="imageUrl20"
86
+            type="String" />
87
+
88
+        <variable
89
+            name="imageUrl21"
90
+            type="String" />
91
+
92
+        <variable
93
+            name="imageUrl22"
94
+            type="String" />
95
+
7 96
         <variable
8
-            name="imageUrl"
97
+            name="imageUrl23"
98
+            type="String" />
99
+
100
+        <variable
101
+            name="imageUrl24"
9 102
             type="String" />
10 103
     </data>
11 104
 
12
-    <LinearLayout
105
+    <FrameLayout
13 106
         android:layout_width="match_parent"
14
-        android:layout_height="match_parent"
15
-        android:padding="10dp"
16
-        tools:context=".HistoryActivity">
107
+        android:layout_height="match_parent">
17 108
 
18
-        <TextView
19
-            android:layout_width="wrap_content"
20
-            android:layout_height="wrap_content"
21
-            android:padding="5dp"
22
-            android:text="图片"
23
-            android:textSize="17sp"
24
-            android:textStyle="bold" />
109
+        <ScrollView
110
+            android:layout_width="match_parent"
111
+            android:layout_height="match_parent">
112
+
113
+            <LinearLayout
114
+                android:layout_width="match_parent"
115
+                android:layout_height="match_parent"
116
+                android:orientation="vertical"
117
+                android:padding="10dp"
118
+                tools:context=".HistoryActivity">
119
+
120
+                <androidx.appcompat.widget.Toolbar
121
+                    android:id="@+id/toolbar"
122
+                    android:layout_width="match_parent"
123
+                    android:layout_height="?android:attr/actionBarSize"
124
+                    android:gravity="center"
125
+                    android:titleTextColor="@android:color/black">
126
+
127
+                    <TextView
128
+                        android:layout_width="wrap_content"
129
+                        android:layout_height="wrap_content"
130
+                        android:layout_gravity="center"
131
+                        android:text="历史记录"
132
+                        android:textColor="@color/black"
133
+                        android:textSize="20sp" />
134
+                </androidx.appcompat.widget.Toolbar>
135
+
136
+                <TextView
137
+                    android:id="@+id/tv1"
138
+                    android:layout_width="wrap_content"
139
+                    android:layout_height="wrap_content"
140
+                    android:padding="5dp"
141
+                    android:text="图片"
142
+                    android:textSize="17sp"
143
+                    android:textStyle="bold" />
144
+
145
+                <LinearLayout
146
+                    android:layout_width="match_parent"
147
+                    android:layout_height="wrap_content"
148
+                    android:orientation="horizontal">
149
+
150
+                    <ImageView
151
+                        android:id="@+id/img1"
152
+                        android:layout_width="80dp"
153
+                        android:layout_height="80dp"
154
+                        android:layout_margin="5dp"
155
+                        android:background="#000000"
156
+                        android:src="@{imageUrl1}"
157
+                        android:visibility="gone" />
158
+
159
+                    <ImageView
160
+                        android:id="@+id/img2"
161
+                        android:layout_width="80dp"
162
+                        android:layout_height="80dp"
163
+                        android:layout_margin="5dp"
164
+                        android:background="#000000"
165
+                        android:src="@{imageUrl2}"
166
+                        android:visibility="gone" />
167
+
168
+                    <ImageView
169
+                        android:id="@+id/img3"
170
+                        android:layout_width="80dp"
171
+                        android:layout_height="80dp"
172
+                        android:layout_margin="5dp"
173
+                        android:background="#000000"
174
+                        android:src="@{imageUrl3}"
175
+                        android:visibility="gone" />
176
+
177
+                    <ImageView
178
+                        android:id="@+id/img4"
179
+                        android:layout_width="80dp"
180
+                        android:layout_height="80dp"
181
+                        android:layout_margin="5dp"
182
+                        android:background="#000000"
183
+                        android:src="@{imageUrl4}"
184
+                        android:visibility="gone" />
185
+
186
+                </LinearLayout>
187
+
188
+                <LinearLayout
189
+                    android:layout_width="match_parent"
190
+                    android:layout_height="wrap_content"
191
+                    android:orientation="horizontal">
192
+
193
+                    <ImageView
194
+                        android:id="@+id/img5"
195
+                        android:layout_width="80dp"
196
+                        android:layout_height="80dp"
197
+                        android:layout_margin="5dp"
198
+                        android:background="#000000"
199
+                        android:src="@{imageUrl5}"
200
+                        android:visibility="gone" />
201
+
202
+                    <ImageView
203
+                        android:id="@+id/img6"
204
+                        android:layout_width="80dp"
205
+                        android:layout_height="80dp"
206
+                        android:layout_margin="5dp"
207
+                        android:background="#000000"
208
+                        android:src="@{imageUrl6}"
209
+                        android:visibility="gone" />
210
+
211
+                    <ImageView
212
+                        android:id="@+id/img7"
213
+                        android:layout_width="80dp"
214
+                        android:layout_height="80dp"
215
+                        android:layout_margin="5dp"
216
+                        android:background="#000000"
217
+                        android:src="@{imageUrl7}"
218
+                        android:visibility="gone" />
219
+
220
+                    <ImageView
221
+                        android:id="@+id/img8"
222
+                        android:layout_width="80dp"
223
+                        android:layout_height="80dp"
224
+                        android:layout_margin="5dp"
225
+                        android:background="#000000"
226
+                        android:src="@{imageUrl8}"
227
+                        android:visibility="gone" />
228
+
229
+                </LinearLayout>
230
+
231
+                <LinearLayout
232
+                    android:layout_width="match_parent"
233
+                    android:layout_height="wrap_content"
234
+                    android:orientation="horizontal">
235
+
236
+                    <ImageView
237
+                        android:id="@+id/img9"
238
+                        android:layout_width="80dp"
239
+                        android:layout_height="80dp"
240
+                        android:layout_margin="5dp"
241
+                        android:background="#000000"
242
+                        android:src="@{imageUrl9}"
243
+                        android:visibility="gone" />
244
+
245
+                    <ImageView
246
+                        android:id="@+id/img10"
247
+                        android:layout_width="80dp"
248
+                        android:layout_height="80dp"
249
+                        android:layout_margin="5dp"
250
+                        android:background="#000000"
251
+                        android:src="@{imageUrl10}"
252
+                        android:visibility="gone" />
253
+
254
+                    <ImageView
255
+                        android:id="@+id/img11"
256
+                        android:layout_width="80dp"
257
+                        android:layout_height="80dp"
258
+                        android:layout_margin="5dp"
259
+                        android:background="#000000"
260
+                        android:src="@{imageUrl11}"
261
+                        android:visibility="gone" />
262
+
263
+                    <ImageView
264
+                        android:id="@+id/img12"
265
+                        android:layout_width="80dp"
266
+                        android:layout_height="80dp"
267
+                        android:layout_margin="5dp"
268
+                        android:background="#000000"
269
+                        android:src="@{imageUrl12}"
270
+                        android:visibility="gone" />
271
+
272
+                </LinearLayout>
273
+
274
+                <TextView
275
+                    android:id="@+id/tv2"
276
+                    android:layout_width="wrap_content"
277
+                    android:layout_height="wrap_content"
278
+                    android:padding="5dp"
279
+                    android:text="视频"
280
+                    android:textSize="17sp"
281
+                    android:textStyle="bold" />
282
+
283
+                <LinearLayout
284
+                    android:layout_width="match_parent"
285
+                    android:layout_height="wrap_content"
286
+                    android:orientation="horizontal">
287
+
288
+                    <ImageView
289
+                        android:id="@+id/img13"
290
+                        android:layout_width="80dp"
291
+                        android:layout_height="80dp"
292
+                        android:layout_margin="5dp"
293
+                        android:background="#000000"
294
+                        android:src="@{imageUrl13}"
295
+                        android:visibility="gone" />
296
+
297
+                    <ImageView
298
+                        android:id="@+id/img14"
299
+                        android:layout_width="80dp"
300
+                        android:layout_height="80dp"
301
+                        android:layout_margin="5dp"
302
+                        android:background="#000000"
303
+                        android:src="@{imageUrl14}"
304
+                        android:visibility="gone" />
305
+
306
+                    <ImageView
307
+                        android:id="@+id/img15"
308
+                        android:layout_width="80dp"
309
+                        android:layout_height="80dp"
310
+                        android:layout_margin="5dp"
311
+                        android:background="#000000"
312
+                        android:src="@{imageUrl15}"
313
+                        android:visibility="gone" />
314
+
315
+                    <ImageView
316
+                        android:id="@+id/img16"
317
+                        android:layout_width="80dp"
318
+                        android:layout_height="80dp"
319
+                        android:layout_margin="5dp"
320
+                        android:background="#000000"
321
+                        android:src="@{imageUrl16}"
322
+                        android:visibility="gone" />
323
+
324
+                </LinearLayout>
325
+
326
+                <LinearLayout
327
+                    android:layout_width="match_parent"
328
+                    android:layout_height="wrap_content"
329
+                    android:orientation="horizontal">
330
+
331
+                    <ImageView
332
+                        android:id="@+id/img17"
333
+                        android:layout_width="80dp"
334
+                        android:layout_height="80dp"
335
+                        android:layout_margin="5dp"
336
+                        android:background="#000000"
337
+                        android:src="@{imageUrl17}"
338
+                        android:visibility="gone" />
339
+
340
+                    <ImageView
341
+                        android:id="@+id/img18"
342
+                        android:layout_width="80dp"
343
+                        android:layout_height="80dp"
344
+                        android:layout_margin="5dp"
345
+                        android:background="#000000"
346
+                        android:src="@{imageUrl18}"
347
+                        android:visibility="gone" />
348
+
349
+                    <ImageView
350
+                        android:id="@+id/img19"
351
+                        android:layout_width="80dp"
352
+                        android:layout_height="80dp"
353
+                        android:layout_margin="5dp"
354
+                        android:background="#000000"
355
+                        android:src="@{imageUrl19}"
356
+                        android:visibility="gone" />
357
+
358
+                    <ImageView
359
+                        android:id="@+id/img20"
360
+                        android:layout_width="80dp"
361
+                        android:layout_height="80dp"
362
+                        android:layout_margin="5dp"
363
+                        android:background="#000000"
364
+                        android:src="@{imageUrl20}"
365
+                        android:visibility="gone" />
366
+
367
+                </LinearLayout>
368
+
369
+                <LinearLayout
370
+                    android:layout_width="match_parent"
371
+                    android:layout_height="wrap_content"
372
+                    android:orientation="horizontal">
373
+
374
+                    <ImageView
375
+                        android:id="@+id/img21"
376
+                        android:layout_width="80dp"
377
+                        android:layout_height="80dp"
378
+                        android:layout_margin="5dp"
379
+                        android:background="#000000"
380
+                        android:src="@{imageUrl21}"
381
+                        android:visibility="gone" />
382
+
383
+                    <ImageView
384
+                        android:id="@+id/img22"
385
+                        android:layout_width="80dp"
386
+                        android:layout_height="80dp"
387
+                        android:layout_margin="5dp"
388
+                        android:background="#000000"
389
+                        android:src="@{imageUrl22}"
390
+                        android:visibility="gone" />
391
+
392
+                    <ImageView
393
+                        android:id="@+id/img23"
394
+                        android:layout_width="80dp"
395
+                        android:layout_height="80dp"
396
+                        android:layout_margin="5dp"
397
+                        android:background="#000000"
398
+                        android:src="@{imageUrl23}"
399
+                        android:visibility="gone" />
400
+
401
+                    <ImageView
402
+                        android:id="@+id/img24"
403
+                        android:layout_width="80dp"
404
+                        android:layout_height="80dp"
405
+                        android:layout_margin="5dp"
406
+                        android:background="#000000"
407
+                        android:src="@{imageUrl24}"
408
+                        android:visibility="gone" />
409
+
410
+                </LinearLayout>
411
+            </LinearLayout>
412
+        </ScrollView>
25 413
 
26 414
         <LinearLayout
27 415
             android:layout_width="match_parent"
28 416
             android:layout_height="wrap_content"
29
-            android:gravity="center"
30
-            android:orientation="horizontal">
31
-
32
-            <ImageView
33
-                android:id="@+id/img1"
34
-                android:layout_width="80dp"
35
-                android:layout_height="80dp"
36
-                android:layout_margin="5dp"
37
-                android:background="#000000"
38
-                android:src="@{imageUrl}" />
417
+            android:layout_gravity="bottom">
39 418
 
40
-            <ImageView
41
-                android:id="@+id/img2"
42
-                android:layout_width="80dp"
419
+            <ImageButton
420
+                android:id="@+id/imgTime"
421
+                android:layout_width="0dp"
43 422
                 android:layout_height="80dp"
44
-                android:layout_margin="5dp"
45
-                android:src="@drawable/camera" />
423
+                android:layout_weight="1"
424
+                android:scaleType="fitCenter"
425
+                android:src="@drawable/time" />
46 426
 
47
-            <ImageView
48
-                android:id="@+id/img3"
49
-                android:layout_width="80dp"
427
+            <ImageButton
428
+                android:id="@+id/imgTeam"
429
+                android:layout_width="0dp"
50 430
                 android:layout_height="80dp"
51
-                android:layout_margin="5dp"
52
-                android:src="@drawable/camera" />
53
-
54
-            <ImageView
55
-                android:id="@+id/img4"
56
-                android:layout_width="80dp"
57
-                android:layout_height="80dp"
58
-                android:layout_margin="5dp"
59
-                android:src="@drawable/camera" />
60
-
431
+                android:layout_weight="1"
432
+                android:scaleType="fitCenter"
433
+                android:src="@drawable/team" />
61 434
         </LinearLayout>
62
-    </LinearLayout>
435
+    </FrameLayout>
63 436
 </layout>

+ 15 - 0
app/src/main/res/layout/activity_show_image.xml

@@ -0,0 +1,15 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    >
8
+
9
+    <ImageView
10
+        android:layout_width="match_parent"
11
+        android:layout_height="match_parent"
12
+        android:layout_centerInParent="true"
13
+        android:id="@+id/hw"/>
14
+
15
+</RelativeLayout>

+ 10 - 6
app/src/main/res/layout/activity_video.xml

@@ -27,13 +27,17 @@
27 27
         app:srcCompat="@drawable/fan" />
28 28
     <com.cfmlg.mlg.CustomImageView
29 29
         android:id="@+id/imv"
30
-        android:layout_width="match_parent"
31
-        android:layout_height="match_parent"
32
-        android:layout_centerInParent="true"
30
+        android:layout_width="wrap_content"
31
+        android:layout_height="wrap_content"
32
+        app:layout_constraintStart_toStartOf="parent"
33
+        app:layout_constraintEnd_toEndOf="parent"
34
+        app:layout_constraintTop_toTopOf="parent"
35
+        app:layout_constraintBottom_toBottomOf="parent"
36
+        app:layout_constraintHorizontal_bias="0.5"
37
+        app:layout_constraintVertical_bias="0.5"
33 38
         android:src="@drawable/ya"
34
-        android:visibility="visible"
35
-
36
-        />
39
+        android:visibility="gone"
40
+        tools:ignore="MissingConstraints" />
37 41
     <LinearLayout
38 42
         android:id="@+id/blakgrond"
39 43
         android:layout_width="wrap_content"