This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dexode.fragment; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v4.app.Fragment; | |
import android.view.KeyEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RealPathUtil { | |
public static String getRealPath(Context context, Uri fileUri) { | |
String realPath; | |
// SDK < API11 | |
if (Build.VERSION.SDK_INT < 11) { | |
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri); | |
} | |
// SDK >= 11 && SDK < 19 | |
else if (Build.VERSION.SDK_INT < 19) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.s16.data; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not object class. AndroidManifest.xml error happen. | |
class MainApplication : Application() { | |
init { | |
instance = this | |
} | |
companion object { | |
private var instance: MainApplication? = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Copyright (C) 2014 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
// we cannot call setDefaultValues for multiple fragment based XML preference | |
// files with readAgain flag set to false, so always check KEY_HAS_SET_DEFAULT_VALUES | |
if (!PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) | |
.getBoolean(PreferenceManager.KEY_HAS_SET_DEFAULT_VALUES, false)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.io.OutputStream; | |
import android.graphics.Bitmap; | |
import android.graphics.Bitmap.Config; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
public class AnimatedGifEncoder { | |
protected int width; // image size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.webserveis.httpredirectiontrace.utils; | |
import android.net.Uri; | |
import android.util.Log; | |
import android.util.Patterns; | |
import android.webkit.URLUtil; | |
import java.io.UnsupportedEncodingException; | |
import java.net.IDN; | |
import java.net.MalformedURLException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.* | |
import kotlin.coroutines.CoroutineContext | |
abstract class UseCase<T, Params : Any> { | |
private lateinit var parentJob: Job | |
private lateinit var params: Params | |
private var isAttachedToLifecycle = false | |
private val backgroundContext: CoroutineContext = Dispatchers.IO | |
private val foregroundContext: CoroutineContext = Dispatchers.Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pascalwelsch.extensions | |
import android.app.Activity | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Build | |
import android.os.Bundle | |
/** | |
* Extensions for simpler launching of Activities |
OlderNewer