Android utils for context and thread.
dependencies {
compile 'com.nillith:miscutils:0.2.2'
}###1 Init Init MiscUtils in you Application class.
publicclassAppextendsApplication {
@OverridepublicvoidonCreate() {
super.onCreate();
MiscUtils.init(getApplicationContext()); // Init MiscUtils
}
}Add the above class to AndroidManifest.xml
<applicationandroid:name=".App"###2 Supported Operations ####2.1 Static Fields
MiscUtils.MAIN_HANDLER//Handler for main threadMiscUtils.SCHEDULED_EXECUTOR####2.2 Static Methods
voidMiscUtils.init(ContextapplicationContext)
MiscUtils.getApplicationContext()
MiscUtils.isUiThread()
MiscUtils.isUiThread(Threadthread)
MiscUtils.runOnUiThread(Runnablerunnable)
MiscUtils.runOnUiThread(Runnablerunnable, longdelayMillis)
MiscUtils.runSeriallyOnBackgroundThread(Runnablerunnable)
MiscUtils.runOnBackgroundThread(Runnablerunnable)
MiscUtils.runOnBackgroundThread(Runnablerunnable, longdelayMillis)
MiscUtils.showToast(CharSequencemessage)
MiscUtils.showToast(@StringResintresId)
MiscUtils.showToast(CharSequencemessage, intduration)
MiscUtils.showToast(@StringResintresId, int duration)
MiscUtils.inflateLayout(Viewview, @LayoutResintresId)
MiscUtils.inflateLayout(Activityactivity, @LayoutResintresId)
MiscUtils.inflateLayout(Windowwindow, @LayoutResintresId)
MiscUtils.inflateLayout(Dialogdialog, @LayoutResintresId)
MiscUtils.inflateLayout(@LayoutResintresId)
MiscUtils.inflateLayout(Contextcontext, @LayoutResintresId)
MiscUtils.attachLayout(ViewGroupviewGroup, @LayoutResintresId)####2.3 Class
SimplePagerAdapterMatchParentDialogNillith, 2016. Licensed under an Apache-2 license.