diff --git a/src/MyApplication/.idea/checkstyle-idea.xml b/src/MyApplication/.idea/checkstyle-idea.xml deleted file mode 100644 index b922840..0000000 --- a/src/MyApplication/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/MyApplication/.idea/gradle.xml b/src/MyApplication/.idea/gradle.xml deleted file mode 100644 index ecf5050..0000000 --- a/src/MyApplication/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/BmobConstants.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/BmobConstants.java index bdfef5d..cd5a76f 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/BmobConstants.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/BmobConstants.java @@ -7,18 +7,12 @@ import android.os.Environment; @SuppressLint("SdCardPath") public class BmobConstants { - /** - * ��ŷ���ͼƬ��Ŀ¼ - */ + public static String BMOB_PICTURE_PATH = Environment.getExternalStorageDirectory() + "/bmobimdemo/image/"; - /** - * �ҵ�ͷ�񱣴�Ŀ¼ - */ + public static String MyAvatarDir = "/sdcard/soucang/avatar/"; - /** - * ���ջص� - */ + public static final int REQUESTCODE_UPLOADAVATAR_CAMERA = 1;//�����޸�ͷ�� public static final int REQUESTCODE_UPLOADAVATAR_LOCATION = 2;//��������޸�ͷ�� public static final int REQUESTCODE_UPLOADAVATAR_CROP = 3;//ϵͳ�ü�ͷ�� diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/CommonUtils.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/CommonUtils.java index 695fe45..683d1bb 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/CommonUtils.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/CommonUtils.java @@ -6,7 +6,7 @@ import android.net.NetworkInfo; public class CommonUtils { - /** ����Ƿ������� */ + public static boolean isNetworkAvailable(Context context) { NetworkInfo info = getNetworkInfo(context); if (info != null) { @@ -15,7 +15,7 @@ public class CommonUtils { return false; } - /** ����Ƿ���WIFI */ + public static boolean isWifi(Context context) { NetworkInfo info = getNetworkInfo(context); if (info != null) { @@ -25,7 +25,7 @@ public class CommonUtils { return false; } - /** ����Ƿ����ƶ����� */ + public static boolean isMobile(Context context) { NetworkInfo info = getNetworkInfo(context); if (info != null) { @@ -42,7 +42,7 @@ public class CommonUtils { return cm.getActiveNetworkInfo(); } - /** ���SD���Ƿ���� */ + public static boolean checkSdCard() { if (android.os.Environment.getExternalStorageState().equals( android.os.Environment.MEDIA_MOUNTED)) diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/Constants.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/Constants.java index b5baf42..47c560f 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/Constants.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/Constants.java @@ -1,8 +1,6 @@ package com.example.administrator.myapplication.utils; -/** - * Created by htq on 2016/8/10. - */ + public class Constants { public final static String BUNDLE_KEY_PAGE = "BUNDLE_KEY_PAGE"; public final static String BUNDLE_KEY_ARGS = "BUNDLE_KEY_ARGS"; diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/PhotoUtil.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/PhotoUtil.java index e332e27..2f932ce 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/PhotoUtil.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/PhotoUtil.java @@ -20,36 +20,26 @@ import java.io.IOException; public class PhotoUtil { - /** - * �������� recycle - * - * @throws - */ + public static void recycle(Bitmap bitmap) { - // ���ж��Ƿ��Ѿ����� + if (bitmap != null && !bitmap.isRecycled()) { - // ���ղ�����Ϊnull + bitmap.recycle(); bitmap = null; } System.gc(); } - /** - * ��ȡָ��·���µ�ͼƬ��ָ����С������ͼ getImageThumbnail - * - * @return Bitmap - * @throws - */ + public static Bitmap getImageThumbnail(String imagePath, int width, int height) { Bitmap bitmap = null; BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; - // ��ȡ���ͼƬ�Ŀ�͸ߣ�ע��˴���bitmapΪnull + bitmap = BitmapFactory.decodeFile(imagePath, options); - options.inJustDecodeBounds = false; // ��Ϊ false - // �������ű� + options.inJustDecodeBounds = false; int h = options.outHeight; int w = options.outWidth; int beWidth = w / width; @@ -64,9 +54,9 @@ public class PhotoUtil { be = 1; } options.inSampleSize = be; - // ���¶���ͼƬ����ȡ���ź��bitmap��ע�����Ҫ��options.inJustDecodeBounds ��Ϊ false + bitmap = BitmapFactory.decodeFile(imagePath, options); - // ����ThumbnailUtils����������ͼ������Ҫָ��Ҫ�����ĸ�Bitmap���� + bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT); return bitmap; @@ -75,9 +65,9 @@ public class PhotoUtil { /** * saveBitmap * - * @param @param filename---�����·����ʽ-��Ŀ¼�Լ��ļ��� + * @param @param filename * @param @param bitmap - * @param @param isDelete --�Ƿ�ֻ��һ�� + * @param @param isDelete * @return void * @throws */ @@ -89,7 +79,7 @@ public class PhotoUtil { } File file = new File(dirpath, filename); - // �����ڼ�ɾ��-Ĭ��ֻ����һ�� + if (isDelete) { if (file.exists()) { file.delete(); @@ -153,12 +143,7 @@ public class PhotoUtil { } } - /** - * - * ��ȡͼƬ���ԣ���ת�ĽǶ� - * @param path ͼƬ���·�� - * @return degree��ת�ĽǶ� - */ + public static int readPictureDegree(String path) { int degree = 0; @@ -185,30 +170,18 @@ public class PhotoUtil { } - /** ��תͼƬһ���Ƕ� - * rotaingImageView - * @return Bitmap - * @throws - */ + public static Bitmap rotaingImageView(int angle, Bitmap bitmap) { - // ��תͼƬ ���� + Matrix matrix = new Matrix(); matrix.postRotate(angle); - // �����µ�ͼƬ + Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); return resizedBitmap; } - /** - * ��ͼƬ��ΪԲ�� - * - * @param bitmap - * ԭBitmapͼƬ - * @param pixels - * ͼƬԲ�ǵĻ���(��λ:����(px)) - * @return ����Բ�ǵ�ͼƬ(Bitmap ����) - */ + public static Bitmap toRoundCorner(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); @@ -231,12 +204,7 @@ public class PhotoUtil { return output; } - /** - * ��ͼƬת��ΪԲ��ͷ�� - * - * @Title: toRoundBitmap - * @throws - */ + public static Bitmap toRoundBitmap(Bitmap bitmap) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); @@ -283,16 +251,16 @@ public class PhotoUtil { (int) dst_right, (int) dst_bottom); final RectF rectF = new RectF(dst); - paint.setAntiAlias(true);// ���û����޾�� + paint.setAntiAlias(true); - canvas.drawARGB(0, 0, 0, 0); // ������Canvas + canvas.drawARGB(0, 0, 0, 0); - // ���������ַ�����Բ,drawRounRect��drawCircle - canvas.drawRoundRect(rectF, roundPx, roundPx, paint);// ��Բ�Ǿ��Σ���һ������Ϊͼ����ʾ���򣬵ڶ�������͵��������ֱ���ˮƽԲ�ǰ뾶�ʹ�ֱԲ�ǰ뾶�� + + canvas.drawRoundRect(rectF, roundPx, roundPx, paint); // canvas.drawCircle(roundPx, roundPx, roundPx, paint); - paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));// ��������ͼƬ�ཻʱ��ģʽ,�ο�http://trylovecatch.iteye.com/blog/1189452 - canvas.drawBitmap(bitmap, src, dst, paint); // ��Mode.SRC_INģʽ�ϲ�bitmap���Ѿ�draw�˵�Circle + paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); + canvas.drawBitmap(bitmap, src, dst, paint); return output; } diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/ResourceParser.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/ResourceParser.java index 0529542..12a9317 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/ResourceParser.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/ResourceParser.java @@ -3,7 +3,7 @@ package com.example.administrator.myapplication.utils; import com.example.administrator.myapplication.R; /** - * Created by htq on 2016/9/15. + * Created by htq on 2018/5/20. */ public class ResourceParser { public static final int TEXT_SMALL = 0; diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SPUtils.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SPUtils.java index 7f84d80..65399e0 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SPUtils.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SPUtils.java @@ -8,7 +8,7 @@ import java.lang.reflect.Method; import java.util.Map; /** - * Created by Wentong WANG on 2016/6/6. + * Created by Wentong WANG on 2018/5/29. */ public class SPUtils { /** diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/StringUtils.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/StringUtils.java index c69a60d..46e33ce 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/StringUtils.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/StringUtils.java @@ -15,9 +15,9 @@ import java.util.regex.Pattern; /** * 字符串操作工具包 * - * @author liux (http://my.oschina.net/liux) + * @author znf * @version 1.0 - * @created 2012-3-21 + * @created 2018-4-21 */ public class StringUtils { private final static Pattern emailer = Pattern @@ -344,7 +344,7 @@ public class StringUtils { * @param dete1 * @param date2 * @return - * @author 火蚁 2015-2-9 下午4:50:06 + * @author znf 2018-5-1 */ public static long calDateDifferent(String dete1, String date2) { diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SystemUtils.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SystemUtils.java index a128e5c..743404e 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SystemUtils.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/SystemUtils.java @@ -23,7 +23,7 @@ import java.io.InputStream; import static android.content.Context.MODE_PRIVATE; /** - * Created by htq on 2016/8/10. + * Created by htq on 2018/4/10. */ public class SystemUtils { diff --git a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/TimeZoneUtil.java b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/TimeZoneUtil.java index 9c1fbe0..68670e5 100644 --- a/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/TimeZoneUtil.java +++ b/src/MyApplication/app/src/main/java/com/example/administrator/myapplication/utils/TimeZoneUtil.java @@ -4,9 +4,9 @@ import java.util.Date; import java.util.TimeZone; /** - * @author HuangWenwei + * @author znf * - * @date 2014年10月9日 + * @date 2017年10月9日 */ public class TimeZoneUtil { @@ -24,7 +24,7 @@ public class TimeZoneUtil { } /** - * 根据不同时区,转换时间 2014年7月31日 + * 根据不同时区,转换时间 2017年10月10日 * @param time * @return */ diff --git a/src/MyApplication/app/src/main/res/layout/activity_api_webview.xml b/src/MyApplication/app/src/main/res/layout/activity_api_webview.xml index ea58c8b..05df427 100644 --- a/src/MyApplication/app/src/main/res/layout/activity_api_webview.xml +++ b/src/MyApplication/app/src/main/res/layout/activity_api_webview.xml @@ -2,13 +2,6 @@ - - - - + + + + +