This file contains hidden or 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
/** | |
* Usage : gsonBuilder.registerTypeAdapterFactory(JsonPreProcessingAdapterFactory()) | |
**/ | |
class JsonPreProcessingAdapterFactory : TypeAdapterFactory { | |
override fun <T> create(gson: Gson, type: TypeToken<T>): TypeAdapter<T>? { | |
if (!Object::class.java.isAssignableFrom(type.rawType) || | |
Iterable::class.java.isAssignableFrom(type.rawType) |
This file contains hidden or 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 android.app.UiModeManager; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.os.Build; | |
import android.util.Log; | |
import android.util.TypedValue; | |
import tv.recatch.library.R; | |
public class UtilsUISystem |
This file contains hidden or 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 abstract class AsyncTaskBase<Param, Progress, Result> extends AsyncTask<Param, Progress, Result> | |
{ | |
@TargetApi(11) | |
public final void executeCompat(Param... params) | |
{ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) | |
this.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params); | |
else | |
this.execute(params); |