10 | * Author JPH
11 | * Date 2015-08-26 下午1:44:26
12 | */
13 | public interface CompressImage {
14 | void compress();
15 |
16 | /**
17 | * 压缩结果监听器
18 | */
19 | interface CompressListener {
20 | /**
21 | * 压缩成功
22 | *
23 | * @param images 已经压缩图片
24 | */
25 | void onCompressSuccess(ArrayList
10 | * Author: JPH
11 | * Date: 2016/8/11 17:01
12 | */
13 | public class TImage implements Serializable {
14 | private String originalPath;
15 | private String compressPath;
16 | private FromType fromType;
17 | private boolean cropped;
18 | private boolean compressed;
19 |
20 | private TImage(String path, FromType fromType) {
21 | this.originalPath = path;
22 | this.fromType = fromType;
23 | }
24 |
25 | private TImage(Uri uri, FromType fromType) {
26 | this.originalPath = uri.getPath();
27 | this.fromType = fromType;
28 | }
29 |
30 | public static TImage of(String path, FromType fromType) {
31 | return new TImage(path, fromType);
32 | }
33 |
34 | public static TImage of(Uri uri, FromType fromType) {
35 | return new TImage(uri, fromType);
36 | }
37 |
38 | public String getOriginalPath() {
39 | return originalPath;
40 | }
41 |
42 | public void setOriginalPath(String originalPath) {
43 | this.originalPath = originalPath;
44 | }
45 |
46 | public String getCompressPath() {
47 | return compressPath;
48 | }
49 |
50 | public void setCompressPath(String compressPath) {
51 | this.compressPath = compressPath;
52 | }
53 |
54 | public FromType getFromType() {
55 | return fromType;
56 | }
57 |
58 | public void setFromType(FromType fromType) {
59 | this.fromType = fromType;
60 | }
61 |
62 | public boolean isCropped() {
63 | return cropped;
64 | }
65 |
66 | public void setCropped(boolean cropped) {
67 | this.cropped = cropped;
68 | }
69 |
70 | public boolean isCompressed() {
71 | return compressed;
72 | }
73 |
74 | public void setCompressed(boolean compressed) {
75 | this.compressed = compressed;
76 | }
77 |
78 | public enum FromType {
79 | CAMERA, OTHER
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/takephoto-lib/src/main/java/org/devio/takephoto/model/TIntentWap.java:
--------------------------------------------------------------------------------
1 | package org.devio.takephoto.model;
2 |
3 | import android.content.Intent;
4 |
5 | /**
6 | * Author: JPH
7 | * Date: 2016/7/26 14:23
8 | */
9 | public class TIntentWap {
10 | private Intent intent;
11 | private int requestCode;
12 |
13 | public TIntentWap() {
14 | }
15 |
16 | public TIntentWap(Intent intent, int requestCode) {
17 | this.intent = intent;
18 | this.requestCode = requestCode;
19 | }
20 |
21 | public Intent getIntent() {
22 | return intent;
23 | }
24 |
25 | public void setIntent(Intent intent) {
26 | this.intent = intent;
27 | }
28 |
29 | public int getRequestCode() {
30 | return requestCode;
31 | }
32 |
33 | public void setRequestCode(int requestCode) {
34 | this.requestCode = requestCode;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/takephoto-lib/src/main/java/org/devio/takephoto/model/TResult.java:
--------------------------------------------------------------------------------
1 | package org.devio.takephoto.model;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * TakePhoto 操作成功返回的处理结果
7 | * Author: JPH
8 | * Date: 2016/8/11 17:01
9 | */
10 | public class TResult {
11 | private ArrayList