Skip to content

Instantly share code, notes, and snippets.

Avatar

Ted Park ParkSangGwon

View GitHub Profile
View ObjectUtils
public class ObjectUtils {
public static boolean isEmpty(Object s) {
if (s == null) {
return true;
}
if ((s instanceof String) && (((String)s).trim().length() == 0)) {
return true;
}
if (s instanceof Map) {
View MarketVersionChecker.java
public class MarketVersionChecker {
public static String getMarketVersion(String packageName) {
try {
Document doc = Jsoup.connect(
"https://play.google.com/store/apps/details?id="
+ packageName).get();
Elements Version = doc.select(".content");
for (Element mElement : Version) {
View Dlog.java
public class Dlog {
static final String TAG = "TedPark";
/** Log Level Error **/
public static final void e(String message) {
if (BaseApplication.DEBUG)Log.e(TAG, buildLogMsg(message));
}
/** Log Level Warning **/
View CustomLoginButton.java
public class CustomLoginButton extends LinearLayout {
LinearLayout bg;
ImageView symbol;
TextView text;
public CustomLoginButton(Context context) {
super(context);
View welcome_login_button.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="@drawable/login_kakao_bg"
android:gravity="center"
android:padding="10dp">
<!-- android:background="@drawable/kakao_login_button_background" -->
View QuickReturnFooterBehavior
public class QuickReturnFooterBehavior extends CoordinatorLayout.Behavior<View> {
private static final Interpolator INTERPOLATOR = new FastOutSlowInInterpolator();
private static final long ANIMATION_DURATION = 200;
private int dyDirectionSum;
private boolean isShowing;
private boolean isHiding;
public QuickReturnFooterBehavior(Context context, AttributeSet attrs) {
@ParkSangGwon
ParkSangGwon / IncomingCallBroadcastReceiver.java
Last active Dec 17, 2015
전화가 걸려오는경우를 감지하고 전화번호 팝업으로 띄우기
View IncomingCallBroadcastReceiver.java
public class IncomingCallBroadcastReceiver extends BroadcastReceiver {
public static final String TAG = "PHONE STATE";
private static String mLastState;
private final Handler mHandler = new Handler(Looper.getMainLooper());
@Override
View CallingService.java
public class CallingService extends Service {
public static final String EXTRA_CALL_NUMBER = "call_number";
protected View rootView;
@InjectView(R.id.tv_call_number)
TextView tv_call_number;
View call_popup_top.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f00"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">
View AddCookiesInterceptor.java
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request.Builder builder = chain.request().newBuilder();
// Preference에서 cookies를 가져오는 작업을 수행
Set<String> preferences = SharedPreferenceBase.getSharedPreference(APIPreferences.SHARED_PREFERENCE_NAME_COOKIE, new HashSet<String>());