Skip to content

Instantly share code, notes, and snippets.

/**
* 비동기로 비트맵 이미지에 Blur효과를 설정하고 필요한 후 처리들을 한다.
*
* @author KangSung-Woo
*/
public class AsyncBlurTask
extends AsyncTask<Bitmap, Integer, Bitmap> {
// 이미지 리사이징 할 최소 사이즈
public static final int DEFAULT_SIZE_PX = 30;
private static final String TAG = AsyncBlurTask.class.getSimpleName();
public class ClearableEditText
extends EditText
implements View.OnTouchListener, View.OnFocusChangeListener, TextWatcherAdapter.TextWatcherListener {
public interface OnTextClearedListener {
void wasClearedText();
}
private Drawable drawables;
private OnTextClearedListener textClearedListener;
public class TextWatcherAdapter
implements TextWatcher {
private final EditText view;
private final TextWatcherListener listener;
public TextWatcherAdapter(EditText editText, TextWatcherListener listener) {
this.view = editText;
this.listener = listener;
}
/**
* ImageUtils
*
* @author KangSung-Woo
* @since 2015/10/23
*/
public class ImageUtils {
public static final int DEFAULT_TRANSITION_DRATION = 150;
private static final String TAG = ImageUtils.class.getSimpleName();
/**
* SWPreferences 클래스
*
* @author SungWoo Kang
* @since 2015/08/25
*/
public class SWPreferences {
// 네이밍 법칙
/**
* This evaluator can be used to perform type interpolation between integer
* values that represent ARGB colors.
* <p/>
* 2015/03/26 강성우 : ArgbEvaluator가 API 21이상 에서만 동작하기 때문에 따로 구현 하였음.
*/
public class ArgbEvaluatorCompat implements TypeEvaluator {
private static final ArgbEvaluatorCompat sInatance = new ArgbEvaluatorCompat();
/**
@ksu3101
ksu3101 / file_copy.java
Created June 9, 2016 09:00
File delete method
/**
* 파일 하나를 복사 한다. AsyncTask등에 태워서 처리 할 것
*
* @param from 복사할 파일의 절대 경로 혹은 객체
* @param target 저장할 파일의 경로 혹은 객체
* @param <T> String or File instance
* @return true일 경우 파일 복사가 성공적으로 수행 됨.
*/
public static <T> boolean fileCopy(T from, T target) {
if (from != null) {
@ksu3101
ksu3101 / scaled_bitmap.java
Created June 9, 2016 09:05
resize Bitmap image
/**
* get Aspaect ratio image resize point
*
* @param src 원본 비트맵 이미지
* @param maxValue 원하는 값
* @return 리사이징된 비트맵의 width, height가 설정된 Point객체 혹은 null
*/
public static Point createScaledBitmapSize(Bitmap src, int maxValue) {
Point p = null;
if (src != null) {
@ksu3101
ksu3101 / getStatusBarHeight.java
Created June 23, 2016 06:35
안드로이드 상단 status bar의 높이를 얻는 메소드
/**
* StatusBar의 높이를 얻는다.
*
* @param context Context instance
* @return pixel size of Statusbar height or 0
*/
public static int getStatusBarHeight(Context context) {
if (context != null) {
int statusBarHeightResourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (statusBarHeightResourceId > 0) {
@ksu3101
ksu3101 / getNavBarHeight.java
Created June 23, 2016 06:35
안드로이드 하단 Navigation bar 가 존재 시 높이를 얻는 메소드. (없을 경우 0을 반환)
/**
* 하단 Navigation bar의 높이를 얻는다.
*
* @param context Context instance
* @return pixel size of bottom of Navigation bar height or 0
*/
public static int getNavigationBarHeight(Context context) {
if (context != null) {
int statusBarHeightResourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (statusBarHeightResourceId > 0) {