c) {
35 | return (c == null || c.size() == 0);
36 | }
37 |
38 | /**
39 | * join collection to string, separator is {@link #DEFAULT_JOIN_SEPARATOR}
40 | *
41 | *
42 | * join(null) = "";
43 | * join({}) = "";
44 | * join({a,b}) = "a,b";
45 | *
46 | *
47 | * @param collection
48 | * @return join collection to string, separator is {@link #DEFAULT_JOIN_SEPARATOR}. if collection is empty, return
49 | * ""
50 | */
51 | public static String join(Iterable collection) {
52 | return collection == null ? "" : TextUtils.join(DEFAULT_JOIN_SEPARATOR, collection);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/DistanceUtil.java:
--------------------------------------------------------------------------------
1 | package com.common.util;
2 |
3 | import com.stickercamera.App;
4 |
5 | public class DistanceUtil {
6 |
7 | public static int getCameraAlbumWidth() {
8 | return (App.getApp().getScreenWidth() - App.getApp().dp2px(10)) / 4 - App.getApp().dp2px(4);
9 | }
10 |
11 | // 相机照片列表高度计算
12 | public static int getCameraPhotoAreaHeight() {
13 | return getCameraPhotoWidth() + App.getApp().dp2px(4);
14 | }
15 |
16 | public static int getCameraPhotoWidth() {
17 | return App.getApp().getScreenWidth() / 4 - App.getApp().dp2px(2);
18 | }
19 |
20 | //活动标签页grid图片高度
21 | public static int getActivityHeight() {
22 | return (App.getApp().getScreenWidth() - App.getApp().dp2px(24)) / 3;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/IOUtil.java:
--------------------------------------------------------------------------------
1 | package com.common.util;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.ByteArrayOutputStream;
5 | import java.io.Closeable;
6 | import java.io.IOException;
7 | import java.io.InputStream;
8 | import java.io.InputStreamReader;
9 |
10 | /**
11 | * IO工具
12 | */
13 | public class IOUtil {
14 | /**
15 | * 把流读成字符串
16 | *
17 | * @param is
18 | * 输入流
19 | * @return 字符串
20 | */
21 | public static String convertStreamToString(InputStream is) {
22 | BufferedReader reader = new BufferedReader(new InputStreamReader(is));
23 | StringBuilder sb = new StringBuilder();
24 | String line = null;
25 | try {
26 | while ((line = reader.readLine()) != null) {
27 | sb.append(line);
28 | }
29 | } catch (IOException e) {
30 |
31 | } finally {
32 | try {
33 | is.close();
34 | } catch (IOException e) {
35 |
36 | }
37 | }
38 | return sb.toString();
39 | }
40 |
41 | /**
42 | * 关闭流
43 | *
44 | * @param stream
45 | * 可关闭的流
46 | */
47 | public static void closeStream(Closeable stream) {
48 | try {
49 | if (stream != null)
50 | stream.close();
51 | } catch (IOException e) {
52 |
53 | }
54 | }
55 |
56 | public static byte[] InputStreamToByte(InputStream is) throws IOException {
57 |
58 | ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
59 | int ch;
60 | while ((ch = is.read()) != -1) {
61 | bytestream.write(ch);
62 | }
63 | byte byteData[] = bytestream.toByteArray();
64 | bytestream.close();
65 | return byteData;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/ImageLoaderUtils.java:
--------------------------------------------------------------------------------
1 | package com.common.util;
2 |
3 | import android.widget.ImageView;
4 |
5 | import com.nostra13.universalimageloader.core.DisplayImageOptions;
6 | import com.nostra13.universalimageloader.core.ImageLoader;
7 | import com.nostra13.universalimageloader.core.imageaware.ImageViewAware;
8 |
9 | /**
10 | * UIL 工具类
11 | * Created by sky on 15/7/26.
12 | */
13 | public class ImageLoaderUtils {
14 |
15 | /**
16 | * display local image
17 | * @param uri
18 | * @param imageView
19 | * @param options
20 | */
21 | public static void displayLocalImage(String uri, ImageView imageView, DisplayImageOptions options) {
22 | ImageLoader.getInstance().displayImage("file://" + uri, new ImageViewAware(imageView), options, null, null);
23 | }
24 |
25 | /**
26 | * display Drawable image
27 | * @param uri
28 | * @param imageView
29 | * @param options
30 | */
31 | public static void displayDrawableImage(String uri, ImageView imageView, DisplayImageOptions options) {
32 | ImageLoader.getInstance().displayImage("drawable://" + uri, new ImageViewAware(imageView), options, null, null);
33 | }
34 |
35 |
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/MD5Util.java:
--------------------------------------------------------------------------------
1 |
2 | package com.common.util;
3 |
4 | import java.security.MessageDigest;
5 | import java.security.NoSuchAlgorithmException;
6 |
7 | public class MD5Util {
8 |
9 | /**
10 | * MD5加密
11 | *
12 | * @param val
13 | * @return
14 | * @throws NoSuchAlgorithmException
15 | */
16 | public static String getMD5(String val) {
17 | MessageDigest md5;
18 | try {
19 | md5 = MessageDigest.getInstance("MD5");
20 | md5.update(val.getBytes());
21 | byte[] m = md5.digest();// 加密
22 | return getString(m);
23 | } catch (NoSuchAlgorithmException e) {
24 | return val;
25 | }
26 |
27 | }
28 |
29 | private static String getString(byte[] b) {
30 | StringBuffer sb = new StringBuffer();
31 | for (int i = 0; i < b.length; i++) {
32 | sb.append(b[i]);
33 | }
34 | return sb.toString();
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/SystemUtils.java:
--------------------------------------------------------------------------------
1 | package com.common.util;
2 |
3 | /**
4 | * SystemUtils
5 | *
6 | * @author Trinea 2013-5-15
7 | */
8 | public class SystemUtils {
9 |
10 | /** recommend default thread pool size according to system available processors, {@link #getDefaultThreadPoolSize()} **/
11 | public static final int DEFAULT_THREAD_POOL_SIZE = getDefaultThreadPoolSize();
12 |
13 | private SystemUtils() {
14 | throw new AssertionError();
15 | }
16 |
17 | /**
18 | * get recommend default thread pool size
19 | *
20 | * @return if 2 * availableProcessors + 1 less than 8, return it, else return 8;
21 | * @see {@link #getDefaultThreadPoolSize(int)} max is 8
22 | */
23 | public static int getDefaultThreadPoolSize() {
24 | return getDefaultThreadPoolSize(8);
25 | }
26 |
27 | /**
28 | * get recommend default thread pool size
29 | *
30 | * @param max
31 | * @return if 2 * availableProcessors + 1 less than max, return it, else return max;
32 | */
33 | public static int getDefaultThreadPoolSize(int max) {
34 | int availableProcessors = 2 * Runtime.getRuntime().availableProcessors() + 1;
35 | return availableProcessors > max ? max : availableProcessors;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/common/util/TimeUtils.java:
--------------------------------------------------------------------------------
1 | package com.common.util;
2 |
3 | import java.text.DateFormat;
4 | import java.text.SimpleDateFormat;
5 | import java.util.Date;
6 |
7 | /**
8 | * TimeUtils
9 | *
10 | * @author Trinea 2013-8-24
11 | */
12 | public class TimeUtils {
13 |
14 | public static final SimpleDateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
15 | public static final SimpleDateFormat DATE_FORMAT_DATE = new SimpleDateFormat("yyyy-MM-dd");
16 |
17 | private TimeUtils() {
18 | throw new AssertionError();
19 | }
20 |
21 | /**
22 | * long time to string
23 | *
24 | * @param timeInMillis
25 | * @param dateFormat
26 | * @return
27 | */
28 | public static String getTime(long timeInMillis, SimpleDateFormat dateFormat) {
29 | return dateFormat.format(new Date(timeInMillis));
30 | }
31 |
32 | public static String dtFormat(Date date, String dateFormat){
33 | return getFormat(dateFormat).format(date);
34 | }
35 |
36 | private static final DateFormat getFormat(String format) {
37 | return new SimpleDateFormat(format);
38 | }
39 |
40 | /**
41 | * long time to string, format is {@link #DEFAULT_DATE_FORMAT}
42 | *
43 | * @param timeInMillis
44 | * @return
45 | */
46 | public static String getTime(long timeInMillis) {
47 | return getTime(timeInMillis, DEFAULT_DATE_FORMAT);
48 | }
49 |
50 | /**
51 | * get current time in milliseconds
52 | *
53 | * @return
54 | */
55 | public static long getCurrentTimeInLong() {
56 | return System.currentTimeMillis();
57 | }
58 |
59 | /**
60 | * get current time in milliseconds, format is {@link #DEFAULT_DATE_FORMAT}
61 | *
62 | * @return
63 | */
64 | public static String getCurrentTimeInString() {
65 | return getTime(getCurrentTimeInLong());
66 | }
67 |
68 | /**
69 | * get current time in milliseconds
70 | *
71 | * @return
72 | */
73 | public static String getCurrentTimeInString(SimpleDateFormat dateFormat) {
74 | return getTime(getCurrentTimeInLong(), dateFormat);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/CameraGrid.java:
--------------------------------------------------------------------------------
1 | package com.customview;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.util.AttributeSet;
8 | import android.view.View;
9 |
10 | /**
11 | * 照相机井字线
12 | * Created by sky on 2015/7/7.
13 | */
14 | public class CameraGrid extends View {
15 |
16 | private int topBannerWidth = 0;
17 | private Paint mPaint;
18 |
19 | public CameraGrid(Context context) {
20 | this(context,null);
21 | }
22 |
23 | public CameraGrid(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | init();
26 | }
27 |
28 | private void init(){
29 | mPaint = new Paint();
30 | mPaint.setColor(Color.WHITE);
31 | mPaint.setAlpha(120);
32 | mPaint.setStrokeWidth(1f);
33 | }
34 |
35 |
36 | //画一个井字,上下画两条灰边,中间为正方形
37 | @Override
38 | protected void onDraw(Canvas canvas) {
39 | super.onDraw(canvas);
40 | int width = this.getWidth();
41 | int height = this.getHeight();
42 | if (width < height) {
43 | topBannerWidth = height - width;
44 | }
45 | if (showGrid) {
46 | canvas.drawLine(width / 3, 0, width / 3, height, mPaint);
47 | canvas.drawLine(width * 2 / 3, 0, width * 2 / 3, height, mPaint);
48 | canvas.drawLine(0, height / 3, width, height / 3, mPaint);
49 | canvas.drawLine(0, height * 2 / 3, width, height * 2 / 3, mPaint);
50 | }
51 | }
52 |
53 | private boolean showGrid = true;
54 |
55 | public boolean isShowGrid() {
56 | return showGrid;
57 | }
58 |
59 | public void setShowGrid(boolean showGrid) {
60 | this.showGrid = showGrid;
61 | }
62 |
63 | public int getTopWidth() {
64 | return topBannerWidth;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/GlobalLimitClickOnClickListener.java:
--------------------------------------------------------------------------------
1 | package com.customview;
2 |
3 | import android.view.View;
4 | import android.view.View.OnClickListener;
5 |
6 |
7 | /**
8 | * 全局拒绝频繁点击代理Listener
9 | *
10 | * @author tongqian.ni
11 | */
12 | public class GlobalLimitClickOnClickListener implements OnClickListener {
13 |
14 | // 全局防频繁点击
15 | private static long lastClick;
16 |
17 | private OnClickListener listener;
18 |
19 | private long intervalClick;
20 |
21 | public GlobalLimitClickOnClickListener(OnClickListener listener, long intervalClick) {
22 | this.intervalClick = intervalClick;
23 | this.listener = listener;
24 | }
25 |
26 | @Override
27 | public void onClick(View v) {
28 | if (System.currentTimeMillis() > lastClick
29 | && System.currentTimeMillis() - lastClick <= intervalClick) {
30 | return;
31 | }
32 | listener.onClick(v);
33 | lastClick = System.currentTimeMillis();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/LabelSelector.java:
--------------------------------------------------------------------------------
1 | package com.customview;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.LayoutInflater;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 | import android.widget.ImageView;
9 | import android.widget.LinearLayout;
10 |
11 | import com.github.skykai.stickercamera.R;
12 |
13 |
14 | /**
15 | * @author tongqian.ni
16 | *
17 | */
18 | public class LabelSelector extends LinearLayout {
19 |
20 | private ImageView txtLabelBtn;
21 | private ImageView addrLabelBtn;
22 |
23 | public LabelSelector(Context context) {
24 | this(context,null);
25 | }
26 |
27 | public LabelSelector(Context context, AttributeSet attr) {
28 | super(context, attr);
29 | LayoutInflater.from(context).inflate(R.layout.view_label_layout, this);
30 | txtLabelBtn = (ImageView) findViewById(R.id.iv_tag_tip);
31 | addrLabelBtn = (ImageView) findViewById(R.id.iv_tag_address);
32 | }
33 |
34 | public void setTxtClicked(OnClickListener listener) {
35 | txtLabelBtn.setOnClickListener(listener);
36 | }
37 |
38 | public void setAddrClicked(OnClickListener listener) {
39 | addrLabelBtn.setOnClickListener(listener);
40 | }
41 |
42 | public float getmLastTouchX() {
43 | return mLastTouchX;
44 | }
45 |
46 | public float getmLastTouchY() {
47 | return mLastTouchY;
48 | }
49 |
50 | private float mLastTouchX = -1;
51 | private float mLastTouchY = -1;
52 |
53 | @Override
54 | public boolean onTouchEvent(MotionEvent event) {
55 | switch (event.getAction()) {
56 | case MotionEvent.ACTION_UP:// 手指离开时
57 | case MotionEvent.ACTION_CANCEL:
58 | mLastTouchX = event.getX();
59 | mLastTouchY = event.getY();
60 | break;
61 | default:
62 | break;
63 | }
64 | return super.onTouchEvent(event);
65 | }
66 |
67 | public void showToTop() {
68 | setVisibility(View.VISIBLE);
69 | bringToFront();
70 | }
71 |
72 | public void hide() {
73 | setVisibility(View.GONE);
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/drawable/EditableDrawable.java:
--------------------------------------------------------------------------------
1 | package com.customview.drawable;
2 |
3 | import android.graphics.Paint;
4 |
5 | public interface EditableDrawable {
6 | public static final int CURSOR_BLINK_TIME = 400;
7 |
8 | public void setOnSizeChangeListener(OnSizeChange paramOnSizeChange);
9 |
10 | public void beginEdit();
11 |
12 | public void endEdit();
13 |
14 | public boolean isEditing();
15 |
16 | public CharSequence getText();
17 |
18 | public void setText(CharSequence paramCharSequence);
19 |
20 | public void setText(String paramString);
21 |
22 | public void setTextHint(CharSequence paramCharSequence);
23 |
24 | public void setTextHint(String paramString);
25 |
26 | public boolean isTextHint();
27 |
28 | public void setBounds(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4);
29 |
30 | public void setTextColor(int paramInt);
31 |
32 | public int getTextColor();
33 |
34 | public float getTextSize();
35 |
36 | public float getFontMetrics(Paint.FontMetrics paramFontMetrics);
37 |
38 | public void setTextStrokeColor(int paramInt);
39 |
40 | public int getTextStrokeColor();
41 |
42 | public void setStrokeEnabled(boolean paramBoolean);
43 |
44 | public boolean getStrokeEnabled();
45 |
46 | public int getNumLines();
47 |
48 | public static interface OnSizeChange {
49 | public void onSizeChanged(EditableDrawable paramEditableDrawable, float paramFloat1,
50 | float paramFloat2, float paramFloat3, float paramFloat4);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/drawable/FeatherDrawable.java:
--------------------------------------------------------------------------------
1 | package com.customview.drawable;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.ColorFilter;
5 | import android.graphics.PorterDuff;
6 | import android.graphics.Rect;
7 | import android.graphics.RectF;
8 | import android.graphics.Region;
9 | import android.graphics.drawable.Drawable;
10 |
11 | public interface FeatherDrawable {
12 | public void setMinSize(float paramFloat1, float paramFloat2);
13 |
14 | public float getMinWidth();
15 |
16 | public float getMinHeight();
17 |
18 | public boolean validateSize(RectF paramRectF);
19 |
20 | public void draw(Canvas paramCanvas);
21 |
22 | public void setBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
23 |
24 | public void setBounds(Rect paramRect);
25 |
26 | public void copyBounds(Rect paramRect);
27 |
28 | public Rect copyBounds();
29 |
30 | public Rect getBounds();
31 |
32 | public void setChangingConfigurations(int paramInt);
33 |
34 | public int getChangingConfigurations();
35 |
36 | public void setDither(boolean paramBoolean);
37 |
38 | public void setFilterBitmap(boolean paramBoolean);
39 |
40 | public void setCallback(Drawable.Callback paramCallback);
41 |
42 | public void invalidateSelf();
43 |
44 | public void scheduleSelf(Runnable paramRunnable, long paramLong);
45 |
46 | public void unscheduleSelf(Runnable paramRunnable);
47 |
48 | public void setAlpha(int paramInt);
49 |
50 | public void setColorFilter(ColorFilter paramColorFilter);
51 |
52 | public void setColorFilter(int paramInt, PorterDuff.Mode paramMode);
53 |
54 | public void clearColorFilter();
55 |
56 | public boolean isStateful();
57 |
58 | public boolean setState(int[] paramArrayOfInt);
59 |
60 | public int[] getState();
61 |
62 | public Drawable getCurrent();
63 |
64 | public boolean setLevel(int paramInt);
65 |
66 | public int getLevel();
67 |
68 | public boolean setVisible(boolean paramBoolean1, boolean paramBoolean2);
69 |
70 | public boolean isVisible();
71 |
72 | public int getOpacity();
73 |
74 | public Region getTransparentRegion();
75 |
76 | public float getCurrentWidth();
77 |
78 | public float getCurrentHeight();
79 |
80 | public int getMinimumWidth();
81 |
82 | public int getMinimumHeight();
83 |
84 | public boolean getPadding(Rect paramRect);
85 |
86 | public Drawable mutate();
87 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/customview/drawable/StickerDrawable.java:
--------------------------------------------------------------------------------
1 | package com.customview.drawable;
2 |
3 | import android.content.res.Resources;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BlurMaskFilter;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.Rect;
9 | import android.graphics.RectF;
10 | import android.graphics.drawable.BitmapDrawable;
11 |
12 | public class StickerDrawable extends BitmapDrawable implements FeatherDrawable {
13 | private float minWidth = 0.0F;
14 | private float minHeight = 0.0F;
15 | BlurMaskFilter mBlurFilter;
16 | Paint mShadowPaint;
17 | Bitmap mShadowBitmap;
18 | boolean mDrawShadow = true;
19 | Rect mTempRect = new Rect();
20 |
21 | public StickerDrawable(Resources resources, Bitmap bitmap) {
22 | super(resources, bitmap);
23 |
24 | this.mBlurFilter = new BlurMaskFilter(5.0F, BlurMaskFilter.Blur.OUTER);
25 | this.mShadowPaint = new Paint(1);
26 | this.mShadowPaint.setMaskFilter(this.mBlurFilter);
27 |
28 | int[] offsetXY = new int[2];
29 | this.mShadowBitmap = getBitmap().extractAlpha(this.mShadowPaint, offsetXY);
30 | }
31 |
32 | public int getBitmapWidth() {
33 | return getBitmap().getWidth();
34 | }
35 |
36 | public int getBitmapHeight() {
37 | return getBitmap().getHeight();
38 | }
39 |
40 | public void draw(Canvas canvas) {
41 | if (this.mDrawShadow) {
42 | copyBounds(this.mTempRect);
43 | canvas.drawBitmap(this.mShadowBitmap, null, this.mTempRect, null);
44 | }
45 | super.draw(canvas);
46 | }
47 |
48 | public void setDropShadow(boolean value) {
49 | this.mDrawShadow = value;
50 | invalidateSelf();
51 | }
52 |
53 | public boolean validateSize(RectF rect) {
54 | return (rect.width() >= this.minWidth) && (rect.height() >= this.minHeight);
55 | }
56 |
57 | public void setMinSize(float w, float h) {
58 | this.minWidth = w;
59 | this.minHeight = h;
60 | }
61 |
62 | public float getMinWidth() {
63 | return this.minWidth;
64 | }
65 |
66 | public float getMinHeight() {
67 | return this.minHeight;
68 | }
69 |
70 | public float getCurrentWidth() {
71 | return getIntrinsicWidth();
72 | }
73 |
74 | public float getCurrentHeight() {
75 | return getIntrinsicHeight();
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/AppConstants.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera;
2 |
3 | import android.os.Environment;
4 |
5 | /**
6 | * Created by sky on 2015/7/6.
7 | */
8 | public class AppConstants {
9 |
10 | public static final String APP_DIR = Environment.getExternalStorageDirectory() + "/StickerCamera";
11 | public static final String APP_TEMP = APP_DIR + "/temp";
12 | public static final String APP_IMAGE = APP_DIR + "/image";
13 |
14 | public static final int POST_TYPE_POI = 1;
15 | public static final int POST_TYPE_TAG = 0;
16 | public static final int POST_TYPE_DEFAULT = 0;
17 |
18 |
19 | public static final float DEFAULT_PIXEL = 1242; //按iphone6设置
20 | public static final String PARAM_MAX_SIZE = "PARAM_MAX_SIZE";
21 | public static final String PARAM_EDIT_TEXT = "PARAM_EDIT_TEXT";
22 | public static final int ACTION_EDIT_LABEL = 8080;
23 | public static final int ACTION_EDIT_LABEL_POI = 9090;
24 |
25 | public static final String FEED_INFO = "FEED_INFO";
26 |
27 |
28 | public static final int REQUEST_CROP = 6709;
29 | public static final int REQUEST_PICK = 9162;
30 | public static final int RESULT_ERROR = 404;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/CameraBaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.stickercamera.base.BaseActivity;
6 |
7 |
8 | public class CameraBaseActivity extends BaseActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | CameraManager.getInst().addActivity(this);
14 | }
15 |
16 | @Override
17 | protected void onDestroy() {
18 | super.onDestroy();
19 | CameraManager.getInst().removeActivity(this);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/CameraBaseFragmentActivity.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.stickercamera.base.BaseFragmentActivity;
6 |
7 |
8 | public class CameraBaseFragmentActivity extends BaseFragmentActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | CameraManager.getInst().addActivity(this);
14 | }
15 |
16 | @Override
17 | protected void onDestroy() {
18 | super.onDestroy();
19 | CameraManager.getInst().removeActivity(this);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/CameraManager.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 |
8 | import com.common.util.ImageUtils;
9 | import com.stickercamera.AppConstants;
10 | import com.stickercamera.app.camera.ui.CameraActivity;
11 | import com.stickercamera.app.camera.ui.CropPhotoActivity;
12 | import com.stickercamera.app.camera.ui.PhotoProcessActivity;
13 | import com.stickercamera.app.model.PhotoItem;
14 |
15 | import java.util.Stack;
16 |
17 | /**
18 | * 相机管理类
19 | * Created by sky on 15/7/6.
20 | * Weibo: http://weibo.com/2030683111
21 | * Email: 1132234509@qq.com
22 | */
23 | public class CameraManager {
24 |
25 | private static CameraManager mInstance;
26 | private Stack cameras = new Stack();
27 |
28 | public static CameraManager getInst() {
29 | if (mInstance == null) {
30 | synchronized (CameraManager.class) {
31 | if (mInstance == null)
32 | mInstance = new CameraManager();
33 | }
34 | }
35 | return mInstance;
36 | }
37 |
38 | //打开照相界面
39 | public void openCamera(Context context) {
40 | Intent intent = new Intent(context, CameraActivity.class);
41 | context.startActivity(intent);
42 | }
43 |
44 | //判断图片是否需要裁剪
45 | public void processPhotoItem(Activity activity, PhotoItem photo) {
46 | Uri uri = photo.getImageUri().startsWith("file:") ? Uri.parse(photo
47 | .getImageUri()) : Uri.parse("file://" + photo.getImageUri());
48 | if (ImageUtils.isSquare(photo.getImageUri())) {
49 | Intent newIntent = new Intent(activity, PhotoProcessActivity.class);
50 | newIntent.setData(uri);
51 | activity.startActivity(newIntent);
52 | } else {
53 | Intent i = new Intent(activity, CropPhotoActivity.class);
54 | i.setData(uri);
55 | //TODO稍后添加
56 | activity.startActivityForResult(i, AppConstants.REQUEST_CROP);
57 | }
58 | }
59 |
60 | public void close() {
61 | for (Activity act : cameras) {
62 | try {
63 | act.finish();
64 | } catch (Exception e) {
65 |
66 | }
67 | }
68 | cameras.clear();
69 | }
70 |
71 | public void addActivity(Activity act) {
72 | cameras.add(act);
73 | }
74 |
75 | public void removeActivity(Activity act) {
76 | cameras.remove(act);
77 | }
78 |
79 |
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/EffectService.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera;
2 |
3 | import com.stickercamera.app.camera.effect.FilterEffect;
4 | import com.stickercamera.app.camera.util.GPUImageFilterTools;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 |
10 | public class EffectService {
11 |
12 | private static EffectService mInstance;
13 |
14 | public static EffectService getInst() {
15 | if (mInstance == null) {
16 | synchronized (EffectService.class) {
17 | if (mInstance == null)
18 | mInstance = new EffectService();
19 | }
20 | }
21 | return mInstance;
22 | }
23 |
24 | private EffectService() {
25 | }
26 |
27 | public List getLocalFilters() {
28 | List filters = new ArrayList();
29 | filters.add(new FilterEffect("原始", GPUImageFilterTools.FilterType.NORMAL, 0));
30 |
31 | filters.add(new FilterEffect("暧昧", GPUImageFilterTools.FilterType.ACV_AIMEI, 0));
32 | filters.add(new FilterEffect("淡蓝", GPUImageFilterTools.FilterType.ACV_DANLAN, 0));
33 | filters.add(new FilterEffect("蛋黄", GPUImageFilterTools.FilterType.ACV_DANHUANG, 0));
34 | filters.add(new FilterEffect("复古", GPUImageFilterTools.FilterType.ACV_FUGU, 0));
35 | filters.add(new FilterEffect("高冷", GPUImageFilterTools.FilterType.ACV_GAOLENG, 0));
36 | filters.add(new FilterEffect("怀旧", GPUImageFilterTools.FilterType.ACV_HUAIJIU, 0));
37 | filters.add(new FilterEffect("胶片", GPUImageFilterTools.FilterType.ACV_JIAOPIAN, 0));
38 | filters.add(new FilterEffect("可爱", GPUImageFilterTools.FilterType.ACV_KEAI, 0));
39 | filters.add(new FilterEffect("落寞", GPUImageFilterTools.FilterType.ACV_LOMO, 0));
40 | filters.add(new FilterEffect("加强", GPUImageFilterTools.FilterType.ACV_MORENJIAQIANG, 0));
41 | filters.add(new FilterEffect("暖心", GPUImageFilterTools.FilterType.ACV_NUANXIN, 0));
42 | filters.add(new FilterEffect("清新", GPUImageFilterTools.FilterType.ACV_QINGXIN, 0));
43 | filters.add(new FilterEffect("日系", GPUImageFilterTools.FilterType.ACV_RIXI, 0));
44 | filters.add(new FilterEffect("温暖", GPUImageFilterTools.FilterType.ACV_WENNUAN, 0));
45 |
46 | return filters;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/adapter/FilterAdapter.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.adapter;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.TextView;
10 |
11 |
12 | import com.github.skykai.stickercamera.R;
13 | import com.stickercamera.app.camera.effect.FilterEffect;
14 | import com.stickercamera.app.camera.util.GPUImageFilterTools;
15 |
16 | import java.util.List;
17 |
18 | import jp.co.cyberagent.android.gpuimage.GPUImageFilter;
19 | import jp.co.cyberagent.android.gpuimage.GPUImageView;
20 |
21 | /**
22 | * @author tongqian.ni
23 | *
24 | */
25 | public class FilterAdapter extends BaseAdapter {
26 |
27 | List filterUris;
28 | Context mContext;
29 | private Bitmap background;
30 |
31 | private int selectFilter = 0;
32 |
33 | public void setSelectFilter(int selectFilter) {
34 | this.selectFilter = selectFilter;
35 | }
36 |
37 | public int getSelectFilter() {
38 | return selectFilter;
39 | }
40 |
41 | public FilterAdapter(Context context, List effects, Bitmap backgroud) {
42 | filterUris = effects;
43 | mContext = context;
44 | this.background = backgroud;
45 | }
46 |
47 | @Override
48 | public int getCount() {
49 | return filterUris.size();
50 | }
51 |
52 | @Override
53 | public Object getItem(int position) {
54 | return filterUris.get(position);
55 | }
56 |
57 | @Override
58 | public long getItemId(int position) {
59 | return position;
60 | }
61 |
62 | @Override
63 | public View getView(int position, View convertView, ViewGroup parent) {
64 | EffectHolder holder = null;
65 | if (convertView == null) {
66 | LayoutInflater layoutInflater = LayoutInflater.from(mContext);
67 | convertView = layoutInflater.inflate(R.layout.item_bottom_filter, null);
68 | holder = new EffectHolder();
69 | holder.filteredImg = (GPUImageView) convertView.findViewById(R.id.small_filter);
70 | holder.filterName = (TextView) convertView.findViewById(R.id.filter_name);
71 | convertView.setTag(holder);
72 | } else {
73 | holder = (EffectHolder) convertView.getTag();
74 | }
75 |
76 | final FilterEffect effect = (FilterEffect) getItem(position);
77 |
78 | holder.filteredImg.setImage(background);
79 | holder.filterName.setText(effect.getTitle());
80 | //if (!effect.isOri() && effect.getType() != null) {
81 | GPUImageFilter filter = GPUImageFilterTools.createFilterForType(mContext, effect.getType());
82 | holder.filteredImg.setFilter(filter);
83 |
84 | return convertView;
85 | }
86 |
87 | class EffectHolder {
88 | GPUImageView filteredImg;
89 | TextView filterName;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/adapter/GalleryAdapter.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.AbsListView;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ImageView;
10 |
11 | import com.common.util.DistanceUtil;
12 | import com.common.util.ImageLoaderUtils;
13 | import com.github.skykai.stickercamera.R;
14 | import com.nostra13.universalimageloader.core.ImageLoader;
15 | import com.stickercamera.app.model.PhotoItem;
16 |
17 | import java.util.List;
18 |
19 | /**
20 | * @author tongqian.ni
21 | *
22 | */
23 | public class GalleryAdapter extends BaseAdapter {
24 |
25 | private Context mContext;
26 | private List values;
27 | public static GalleryHolder holder;
28 |
29 | /**
30 | * @param albumActivity
31 | * @param values
32 | */
33 | public GalleryAdapter(Context context, List values) {
34 | this.mContext = context;
35 | this.values = values;
36 | }
37 |
38 | @Override
39 | public int getCount() {
40 | return values.size();
41 | }
42 |
43 | @Override
44 | public Object getItem(int position) {
45 | return values.get(position);
46 | }
47 |
48 | @Override
49 | public long getItemId(int position) {
50 | return position;
51 | }
52 |
53 | @Override
54 | public View getView(int position, View convertView, ViewGroup parent) {
55 | final GalleryHolder holder;
56 | int width = DistanceUtil.getCameraAlbumWidth();
57 | if (convertView == null) {
58 | LayoutInflater layoutInflater = LayoutInflater.from(mContext);
59 | convertView = layoutInflater.inflate(R.layout.item_gallery, null);
60 | holder = new GalleryHolder();
61 | holder.sample = (ImageView) convertView.findViewById(R.id.gallery_sample_image);
62 | holder.sample.setLayoutParams(new AbsListView.LayoutParams(width, width));
63 | convertView.setTag(holder);
64 | } else {
65 | holder = (GalleryHolder) convertView.getTag();
66 | }
67 | final PhotoItem gallery = (PhotoItem) getItem(position);
68 |
69 | ImageLoaderUtils.displayLocalImage(gallery.getImageUri(), holder.sample,null);
70 |
71 | return convertView;
72 | }
73 |
74 | class GalleryHolder {
75 | ImageView sample;
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/adapter/StickerToolAdapter.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.ImageView;
9 |
10 |
11 | import com.common.util.ImageLoaderUtils;
12 | import com.github.skykai.stickercamera.R;
13 | import com.nostra13.universalimageloader.core.ImageLoader;
14 | import com.stickercamera.app.model.Addon;
15 |
16 | import java.util.List;
17 |
18 | /**
19 | *
20 | * 贴纸适配器
21 | * @author tongqian.ni
22 | */
23 | public class StickerToolAdapter extends BaseAdapter {
24 |
25 | List filterUris;
26 | Context mContext;
27 |
28 | public StickerToolAdapter(Context context, List effects) {
29 | filterUris = effects;
30 | mContext = context;
31 | }
32 |
33 | @Override
34 | public int getCount() {
35 | return filterUris.size();
36 | }
37 |
38 | @Override
39 | public Object getItem(int position) {
40 | return filterUris.get(position);
41 | }
42 |
43 | @Override
44 | public long getItemId(int position) {
45 | return position;
46 | }
47 |
48 | @Override
49 | public View getView(int position, View convertView, ViewGroup parent) {
50 | EffectHolder holder = null;
51 | if (convertView == null) {
52 | LayoutInflater layoutInflater = LayoutInflater.from(mContext);
53 | convertView = layoutInflater.inflate(R.layout.item_bottom_tool, null);
54 | holder = new EffectHolder();
55 | holder.logo = (ImageView) convertView.findViewById(R.id.effect_image);
56 | holder.container = (ImageView) convertView.findViewById(R.id.effect_background);
57 | //holder.navImage.setOnClickListener(holder.clickListener);
58 | convertView.setTag(holder);
59 | } else {
60 | holder = (EffectHolder) convertView.getTag();
61 | }
62 |
63 | final Addon effect = (Addon) getItem(position);
64 |
65 | return showItem(convertView, holder, effect);
66 | }
67 |
68 | private View showItem(View convertView, EffectHolder holder, final Addon sticker) {
69 |
70 | holder.container.setVisibility(View.GONE);
71 | ImageLoaderUtils.displayDrawableImage(sticker.getId() + "", holder.logo, null);
72 |
73 | return convertView;
74 | }
75 |
76 | class EffectHolder {
77 | ImageView logo;
78 | ImageView container;
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/effect/FilterEffect.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.effect;
2 |
3 |
4 | import com.stickercamera.app.camera.util.GPUImageFilterTools;
5 |
6 | /**
7 | * @author tongqian.ni
8 | *
9 | */
10 | public class FilterEffect {
11 |
12 | private String title;
13 | private GPUImageFilterTools.FilterType type;
14 | private int degree;
15 |
16 | /**
17 | * @param title
18 | * @param uri
19 | */
20 | public FilterEffect(String title, GPUImageFilterTools.FilterType type, int degree) {
21 | this.type = type;
22 | this.degree = degree;
23 | this.title = title;
24 | }
25 |
26 |
27 | public GPUImageFilterTools.FilterType getType() {
28 | return type;
29 | }
30 |
31 | public String getTitle() {
32 | return title;
33 | }
34 |
35 | public int getDegree() {
36 | return degree;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/fragment/AlbumFragment.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.AdapterView;
9 | import android.widget.AdapterView.OnItemClickListener;
10 | import android.widget.GridView;
11 |
12 |
13 | import com.github.skykai.stickercamera.R;
14 | import com.stickercamera.app.camera.CameraManager;
15 | import com.stickercamera.app.camera.adapter.GalleryAdapter;
16 | import com.stickercamera.app.model.PhotoItem;
17 |
18 | import java.util.ArrayList;
19 |
20 | /**
21 | * @author tongqian.ni
22 | */
23 | public class AlbumFragment extends Fragment {
24 | private ArrayList photos = new ArrayList();
25 |
26 | public AlbumFragment() {
27 | super();
28 | }
29 |
30 | @Override
31 | public void onSaveInstanceState(Bundle outState) {
32 | super.onSaveInstanceState(outState);
33 | }
34 |
35 | public static Fragment newInstance(ArrayList photos) {
36 | Fragment fragment = new AlbumFragment();
37 | Bundle args = new Bundle();
38 | args.putSerializable("photos", photos);
39 | fragment.setArguments(args);
40 | return fragment;
41 | }
42 |
43 | @Override
44 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
45 | super.onCreateView(inflater, container, savedInstanceState);
46 | View root = inflater.inflate(R.layout.fragment_album, null);
47 | photos = (ArrayList) getArguments().getSerializable("photos");
48 | albums = (GridView) root.findViewById(R.id.albums);
49 | albums.setOnItemClickListener(new OnItemClickListener() {
50 |
51 | @Override
52 | public void onItemClick(AdapterView> arg0, View arg1, int arg2, long arg3) {
53 | PhotoItem photo = photos.get(arg2);
54 | CameraManager.getInst().processPhotoItem(getActivity(), photo);
55 | }
56 | });
57 | return root;
58 | }
59 |
60 | @Override
61 | public void onResume() {
62 | super.onResume();
63 | albums.setAdapter(new GalleryAdapter(getActivity(), photos));
64 | }
65 |
66 | private GridView albums;
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/util/CameraHelperBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 CyberAgent
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.stickercamera.app.camera.util;
18 |
19 | import android.content.Context;
20 | import android.content.pm.PackageManager;
21 | import android.hardware.Camera;
22 | import android.hardware.Camera.CameraInfo;
23 |
24 | import com.stickercamera.app.camera.util.CameraHelper.CameraHelperImpl;
25 | import com.stickercamera.app.camera.util.CameraHelper.CameraInfo2;
26 |
27 | public class CameraHelperBase implements CameraHelperImpl {
28 |
29 | private final Context mContext;
30 |
31 | public CameraHelperBase(final Context context) {
32 | mContext = context;
33 | }
34 |
35 | @Override
36 | public int getNumberOfCameras() {
37 | return hasCameraSupport() ? 1 : 0;
38 | }
39 |
40 | @Override
41 | public Camera openCamera(final int id) {
42 | return Camera.open();
43 | }
44 |
45 | @Override
46 | public Camera openDefaultCamera() {
47 | return Camera.open();
48 | }
49 |
50 | @Override
51 | public boolean hasCamera(final int facing) {
52 | if (facing == CameraInfo.CAMERA_FACING_BACK) {
53 | return hasCameraSupport();
54 | }
55 | return false;
56 | }
57 |
58 | @Override
59 | public Camera openCameraFacing(final int facing) {
60 | if (facing == CameraInfo.CAMERA_FACING_BACK) {
61 | return Camera.open();
62 | }
63 | return null;
64 | }
65 |
66 | @Override
67 | public void getCameraInfo(final int cameraId, final CameraInfo2 cameraInfo) {
68 | cameraInfo.facing = CameraInfo.CAMERA_FACING_BACK;
69 | cameraInfo.orientation = 90;
70 | }
71 |
72 | private boolean hasCameraSupport() {
73 | return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/util/CameraHelperGB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 CyberAgent
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.stickercamera.app.camera.util;
18 |
19 | import android.annotation.TargetApi;
20 | import android.hardware.Camera;
21 | import android.hardware.Camera.CameraInfo;
22 |
23 | import com.stickercamera.app.camera.util.CameraHelper.CameraHelperImpl;
24 | import com.stickercamera.app.camera.util.CameraHelper.CameraInfo2;
25 |
26 | @TargetApi(9)
27 | public class CameraHelperGB implements CameraHelperImpl {
28 |
29 | @Override
30 | public int getNumberOfCameras() {
31 | return Camera.getNumberOfCameras();
32 | }
33 |
34 | @Override
35 | public Camera openCamera(final int id) {
36 | return Camera.open(id);
37 | }
38 |
39 | @Override
40 | public Camera openDefaultCamera() {
41 | return Camera.open(0);
42 | }
43 |
44 | @Override
45 | public boolean hasCamera(final int facing) {
46 | return getCameraId(facing) != -1;
47 | }
48 |
49 | @Override
50 | public Camera openCameraFacing(final int facing) {
51 | return Camera.open(getCameraId(facing));
52 | }
53 |
54 | @Override
55 | public void getCameraInfo(final int cameraId, final CameraInfo2 cameraInfo) {
56 | CameraInfo info = new CameraInfo();
57 | Camera.getCameraInfo(cameraId, info);
58 | cameraInfo.facing = info.facing;
59 | cameraInfo.orientation = info.orientation;
60 | }
61 |
62 | private int getCameraId(final int facing) {
63 | int numberOfCameras = Camera.getNumberOfCameras();
64 | CameraInfo info = new CameraInfo();
65 | for (int id = 0; id < numberOfCameras; id++) {
66 | Camera.getCameraInfo(id, info);
67 | if (info.facing == facing) {
68 | return id;
69 | }
70 | }
71 | return -1;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/util/MatrixUtils.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.util;
2 |
3 | import android.graphics.Matrix;
4 |
5 | public class MatrixUtils
6 | {
7 | public static void mapPoints(Matrix matrix, float[] points)
8 | {
9 | float[] m = { 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F };
10 | matrix.getValues(m);
11 |
12 | points[0] = (points[0] * m[0] + m[2]);
13 | points[1] = (points[1] * m[4] + m[5]);
14 |
15 | if (points.length == 4) {
16 | points[2] = (points[2] * m[0] + m[2]);
17 | points[3] = (points[3] * m[4] + m[5]);
18 | }
19 | }
20 |
21 | public static float[] getScale(Matrix matrix)
22 | {
23 | float[] points = new float[9];
24 | matrix.getValues(points);
25 | return new float[] { points[0], points[4] };
26 | }
27 |
28 | public static float[] getValues(Matrix m)
29 | {
30 | float[] values = new float[9];
31 | m.getValues(values);
32 | return values;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/camera/util/UIUtils.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.camera.util;
2 |
3 | import android.content.Context;
4 | import android.view.Gravity;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.Toast;
8 |
9 | public class UIUtils {
10 |
11 | public static final int HIGHLIGHT_MODE_PRESSED = 2;
12 | public static final int HIGHLIGHT_MODE_CHECKED = 4;
13 | public static final int HIGHLIGHT_MODE_SELECTED = 8;
14 |
15 | public static final int GLOW_MODE_PRESSED = 2;
16 | public static final int GLOW_MODE_CHECKED = 4;
17 | public static final int GLOW_MODE_SELECTED = 8;
18 |
19 | public static boolean checkBits(int status, int checkBit) {
20 | return (status & checkBit) == checkBit;
21 | }
22 |
23 | /**
24 | * Creates a custom {@link Toast} with a custom layout View
25 | *
26 | * @param context
27 | * the context
28 | * @param resId
29 | * the custom view
30 | * @return the created {@link Toast}
31 | */
32 | public static Toast makeCustomToast(Context context, int resId) {
33 | View view = LayoutInflater.from(context).inflate(resId, null);
34 | Toast t = new Toast(context);
35 | t.setDuration(Toast.LENGTH_SHORT);
36 | t.setView(view);
37 | t.setGravity(Gravity.CENTER, 0, 0);
38 | return t;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/model/Addon.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.model;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.common.util.StringUtils;
5 |
6 | import java.util.List;
7 |
8 |
9 | /**
10 | * 本地简单使用,实际项目中与贴纸相关的属性可以添加到此类中
11 | */
12 | public class Addon {
13 | private int id;
14 |
15 | //JSON用到
16 | public Addon() {
17 |
18 | }
19 |
20 | public Addon(int id) {
21 | this.id = id;
22 | }
23 |
24 | public int getId() {
25 | return id;
26 | }
27 |
28 | public void setId(int id) {
29 | this.id = id;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/model/Album.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.model;
2 |
3 |
4 | import com.common.util.StringUtils;
5 |
6 | import java.io.Serializable;
7 | import java.util.ArrayList;
8 |
9 | /**
10 | * @author tongqian.ni
11 | *
12 | */
13 | public class Album implements Serializable {
14 |
15 | private static final long serialVersionUID = 5702699517846159671L;
16 | private String albumUri;
17 | private String title;
18 | private ArrayList photos;
19 |
20 | public Album(String title, String uri, ArrayList photos) {
21 | this.title = title;
22 | this.albumUri = uri;
23 | this.photos = photos;
24 | }
25 |
26 | public String getAlbumUri() {
27 | return albumUri;
28 | }
29 |
30 | public void setAlbumUri(String albumUri) {
31 | this.albumUri = albumUri;
32 | }
33 |
34 | public String getTitle() {
35 | return title;
36 | }
37 |
38 | public void setTitle(String title) {
39 | this.title = title;
40 | }
41 |
42 | public ArrayList getPhotos() {
43 | return photos;
44 | }
45 |
46 | public void setPhotos(ArrayList photos) {
47 | this.photos = photos;
48 | }
49 |
50 | @Override
51 | public int hashCode() {
52 | if (albumUri == null) {
53 | return super.hashCode();
54 | } else {
55 | return albumUri.hashCode();
56 | }
57 | }
58 |
59 | @Override
60 | public boolean equals(Object o) {
61 | if (o != null && (o instanceof Album)) {
62 | return StringUtils.equals(albumUri, ((Album) o).getAlbumUri());
63 | }
64 | return false;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/model/FeedItem.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.model;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * 图片Module
7 | * Created by sky on 15/7/18.
8 | */
9 | public class FeedItem {
10 |
11 | private String imgPath;
12 | private List tagList;
13 |
14 | public FeedItem(){
15 |
16 | }
17 |
18 | public FeedItem(List tagList,String imgPath){
19 | this.imgPath = imgPath;
20 | this.tagList = tagList;
21 | }
22 |
23 | public List getTagList() {
24 | return tagList;
25 | }
26 |
27 | public void setTagList(List tagList) {
28 | this.tagList = tagList;
29 | }
30 |
31 | public String getImgPath() {
32 | return imgPath;
33 | }
34 |
35 | public void setImgPath(String imgPath) {
36 | this.imgPath = imgPath;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/app/model/TagItem.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.app.model;
2 |
3 |
4 |
5 | import java.io.Serializable;
6 |
7 | public class TagItem implements Serializable {
8 | private static final long serialVersionUID = 2685507991821634905L;
9 | private long id;
10 | private int type;
11 | private String name;
12 | private double x = -1;
13 | private double y = -1;
14 |
15 | private int recordCount;
16 | private boolean left = true;
17 |
18 |
19 | public boolean isLeft() {
20 | return left;
21 | }
22 | public void setLeft(boolean left) {
23 | this.left = left;
24 | }
25 | public int getRecordCount() {
26 | return recordCount;
27 | }
28 |
29 | public void setRecordCount(int recordCount) {
30 | this.recordCount = recordCount;
31 | }
32 |
33 | public TagItem() {
34 |
35 | }
36 |
37 | public TagItem(int type, String label) {
38 | this.type = type;
39 | this.name = label;
40 | }
41 |
42 | public long getId() {
43 | return id;
44 | }
45 |
46 | public void setId(long id) {
47 | this.id = id;
48 | }
49 |
50 | public int getType() {
51 | return type;
52 | }
53 |
54 | public void setType(int type) {
55 | this.type = type;
56 | }
57 |
58 | public String getName() {
59 | return name;
60 | }
61 |
62 | public void setName(String name) {
63 | this.name = name;
64 | }
65 |
66 | public double getX() {
67 | return x;
68 | }
69 |
70 | public void setX(double x) {
71 | this.x = x;
72 | }
73 |
74 | public double getY() {
75 | return y;
76 | }
77 |
78 | public void setY(double y) {
79 | this.y = y;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/base/ActivityResponsable.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.base;
2 |
3 | import android.content.DialogInterface;
4 | import android.content.DialogInterface.OnCancelListener;
5 |
6 | public interface ActivityResponsable {
7 | /**
8 | * 弹对话框
9 | *
10 | * @param title
11 | * 标题
12 | * @param msg
13 | * 消息
14 | * @param positive
15 | * 确定
16 | * @param positiveListener
17 | * 确定回调
18 | * @param negative
19 | * 否定
20 | * @param negativeListener
21 | * 否定回调
22 | */
23 | public void alert(final String title, final String msg, final String positive,
24 | final DialogInterface.OnClickListener positiveListener,
25 | final String negative, final DialogInterface.OnClickListener negativeListener);
26 |
27 | /**
28 | * 弹对话框
29 | *
30 | * @param title
31 | * 标题
32 | * @param msg
33 | * 消息
34 | * @param positive
35 | * 确定
36 | * @param positiveListener
37 | * 确定回调
38 | * @param negative
39 | * 否定
40 | * @param negativeListener
41 | * 否定回调
42 | * @param isCanceledOnTouchOutside
43 | * 是否外部点击取消
44 | */
45 | public void alert(final String title, final String msg, final String positive,
46 | final DialogInterface.OnClickListener positiveListener,
47 | final String negative,
48 | final DialogInterface.OnClickListener negativeListener,
49 | Boolean isCanceledOnTouchOutside);
50 |
51 | /**
52 | * TOAST
53 | *
54 | * @param msg
55 | * 消息
56 | * @param period
57 | * 时长
58 | */
59 | public void toast(final String msg, final int period);
60 |
61 | /**
62 | * 显示进度对话框
63 | *
64 | * @param msg
65 | * 消息
66 | */
67 | public void showProgressDialog(final String msg);
68 |
69 | /**
70 | * 显示可取消的进度对话框
71 | *
72 | * @param msg
73 | * 消息
74 | */
75 | public void showProgressDialog(final String msg, final boolean cancelable,
76 | final OnCancelListener cancelListener);
77 |
78 | /**
79 | * 取消进度对话框
80 | *
81 | */
82 | public void dismissProgressDialog();
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/base/BaseFragmentActivity.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.base;
2 |
3 | import android.support.v4.app.FragmentActivity;
4 | import android.view.View;
5 |
6 | import com.customview.CommonTitleBar;
7 | import com.github.skykai.stickercamera.R;
8 |
9 | /**
10 | * Created by sky on 15/7/6.
11 | */
12 | public class BaseFragmentActivity extends FragmentActivity {
13 |
14 | protected CommonTitleBar titleBar;
15 |
16 | @Override
17 | public void setContentView(int layoutResID) {
18 | super.setContentView(layoutResID);
19 | //titleBar = (CommonTitleBar) findViewById(R.id.title_layout);
20 | if (titleBar != null)
21 | titleBar.setLeftBtnOnclickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View v) {
24 | finish();
25 | }
26 | });
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/stickercamera/base/util/GenericProgressDialog.java:
--------------------------------------------------------------------------------
1 | package com.stickercamera.base.util;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.ProgressBar;
8 | import android.widget.TextView;
9 |
10 | import com.github.skykai.stickercamera.R;
11 |
12 |
13 | public class GenericProgressDialog extends AlertDialog {
14 | private ProgressBar mProgress;
15 | private TextView mMessageView;
16 | private CharSequence mMessage;
17 | private boolean mIndeterminate;
18 | private boolean mProgressVisiable;
19 |
20 | public GenericProgressDialog(Context context) {
21 | super(context/*,R.style.Float*/);
22 | }
23 |
24 | public GenericProgressDialog(Context context, int theme) {
25 | super(context,/*, R.style.Float*/theme);
26 | }
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.view_progress_dialog);
32 | mProgress = (ProgressBar) findViewById(android.R.id.progress);
33 | mMessageView = (TextView) findViewById(R.id.message);
34 |
35 | setMessageAndView();
36 | setIndeterminate(mIndeterminate);
37 | }
38 |
39 | private void setMessageAndView() {
40 | mMessageView.setText(mMessage);
41 |
42 | if (mMessage == null || "".equals(mMessage)) {
43 | mMessageView.setVisibility(View.GONE);
44 | }
45 |
46 | mProgress.setVisibility(mProgressVisiable ? View.VISIBLE : View.GONE);
47 | }
48 |
49 | @Override
50 | public void setMessage(CharSequence message) {
51 | mMessage = message;
52 | }
53 |
54 | /**
55 | * 圈圈可见性设置
56 | * @param progressVisiable 是否显示圈圈
57 | */
58 | public void setProgressVisiable(boolean progressVisiable) {
59 | mProgressVisiable = progressVisiable;
60 | }
61 |
62 | public void setIndeterminate(boolean indeterminate) {
63 | if (mProgress != null) {
64 | mProgress.setIndeterminate(indeterminate);
65 | } else {
66 | mIndeterminate = indeterminate;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/aviary_delete_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/aviary_delete_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/aviary_resize_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/aviary_resize_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_flash_auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_flash_auto.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_flash_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_flash_off.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_flash_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_flash_on.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_flip.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/camera_library.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/camera_library.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/default_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/default_img.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/dot.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_camera_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/ic_camera_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_biaoqian.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/icon_biaoqian.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_biaoqian_i.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/icon_biaoqian_i.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/lookup_amatorka.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/lookup_amatorka.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/next.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/point_poi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/point_poi.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/position.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/position.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/select_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/select_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/simple_toast_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/simple_toast_bg.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker5.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker6.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker7.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/sticker8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/sticker8.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/tip.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/vertical_shaped_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/vertical_shaped_button.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/vertical_shaped_button_click.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-hdpi/vertical_shaped_button_click.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/aviary_delete_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-mdpi/aviary_delete_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/aviary_resize_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-mdpi/aviary_resize_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/aviary_delete_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-xhdpi/aviary_delete_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/aviary_resize_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-xhdpi/aviary_resize_knob.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/background_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/black_white_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bottom_tool.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_crop_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_take_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cam_focus.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corners_bg_white_2r_borderd.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/toolbar_shadow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_album.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
17 |
18 |
28 |
29 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
12 |
18 |
19 |
20 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_album.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_bottom_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
22 |
23 |
24 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_bottom_tool.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
22 |
23 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_gallery.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_picture.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toolbar_shadow_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_drawable_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_label.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
22 |
23 |
32 |
33 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_label_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
24 |
25 |
29 |
30 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 |
49 |
50 |
53 |
54 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_label_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_progress_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
22 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_transient_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/aimei.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/aimei.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/danhuang.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/danhuang.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/danlan.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/danlan.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/fugu.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/fugu.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/gaoleng.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/gaoleng.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/huaijiu.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/huaijiu.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/jiaopian.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/jiaopian.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/keai.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/keai.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/lomo.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/lomo.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/morenjiaqiang.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/morenjiaqiang.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/nuanxin.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/nuanxin.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/qingxin.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/qingxin.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/rixi.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/rixi.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/tone_cuver_sample.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/tone_cuver_sample.acv
--------------------------------------------------------------------------------
/app/src/main/res/raw/wennuan.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/app/src/main/res/raw/wennuan.acv
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #00000000
5 | #ff000000
6 | #ffffffff
7 | #666666
8 | #ffff0000
9 | #f5f3f0
10 | #cbc4c6
11 | #ff5d65
12 | #cccccc
13 | #cbc4c6
14 | #e8e3e3
15 | #6e686a
16 |
17 |
18 | #D5D5D5
19 |
20 | #f3f3f3
21 | #666666
22 | #1a000000
23 | #77000000
24 |
25 |
26 |
27 | #FF6347
28 | #F4511E
29 | #FF5722
30 |
31 |
32 | #2196F3
33 | #1976D2
34 | #448AFF
35 |
36 | #6633B5E5
37 | #ffbebebe
38 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | StickerCamera
3 |
4 | Hello world!
5 | Settings
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
18 |
19 |
20 |
25 |
26 |
31 |
32 |
33 |
37 |
38 |
43 |
44 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 |
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:1.2.3'
10 | classpath 'me.tatarka:gradle-retrolambda:3.1.0'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 |
16 |
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | jcenter()
22 | maven { url("https://oss.sonatype.org/content/repositories/snapshots/") }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jul 05 22:10:29 CST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenshot/Screenshot_01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_01.gif
--------------------------------------------------------------------------------
/screenshot/Screenshot_2015-07-19-11-21-39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_2015-07-19-11-21-39.png
--------------------------------------------------------------------------------
/screenshot/Screenshot_2015-07-19-11-22-05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_2015-07-19-11-22-05.png
--------------------------------------------------------------------------------
/screenshot/Screenshot_2015-07-19-11-23-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_2015-07-19-11-23-00.png
--------------------------------------------------------------------------------
/screenshot/Screenshot_2015-07-19-11-23-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_2015-07-19-11-23-04.png
--------------------------------------------------------------------------------
/screenshot/Screenshot_2015-07-19-11-23-22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/Screenshot_2015-07-19-11-23-22.png
--------------------------------------------------------------------------------
/screenshot/StickerCamera.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Skykai521/StickerCamera/d0a9c4d3f0ea1acfe339128624ddcb28c4bf85df/screenshot/StickerCamera.zip
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':Gpu-Image', ':ImageViewTouch'
2 |
--------------------------------------------------------------------------------