AndroidMiscUtils


Source link: https://github.com/nillith/AndroidMiscUtils

AndroidMiscUtils

Android utils for context and thread.

Add Gradle Dependencies

dependencies {

  compile 'com.nillith:miscutils:0.2.2' 
}

How to use

###1 Init Init MiscUtils in you Application class.

public class App extends Application {

  @Override
  public void onCreate() {

super.onCreate();

MiscUtils.init(getApplicationContext());
 // Init MiscUtils
  
}
 
}

Add the above class to AndroidManifest.xml

 <application

android:name=".App"

###2 Supported Operations ####2.1 Static Fields

  MiscUtils.MAIN_HANDLER //Handler for main thread

MiscUtils.SCHEDULED_EXECUTOR

####2.2 Static Methods

  void MiscUtils.init(Context applicationContext)

MiscUtils.getApplicationContext()

MiscUtils.isUiThread()

MiscUtils.isUiThread(Thread thread)

MiscUtils.runOnUiThread(Runnable runnable)

MiscUtils.runOnUiThread(Runnable runnable, long delayMillis)

MiscUtils.runSeriallyOnBackgroundThread(Runnable runnable)

MiscUtils.runOnBackgroundThread(Runnable runnable)

MiscUtils.runOnBackgroundThread(Runnable runnable, long delayMillis)

MiscUtils.showToast(CharSequence message)

MiscUtils.showToast(@StringRes int resId)

MiscUtils.showToast(CharSequence message, int duration)

MiscUtils.showToast(@StringRes int resId, int duration)

MiscUtils.inflateLayout(View view, @LayoutRes int resId)

MiscUtils.inflateLayout(Activity activity, @LayoutRes int resId)

MiscUtils.inflateLayout(Window window, @LayoutRes int resId)

MiscUtils.inflateLayout(Dialog dialog, @LayoutRes int resId)

MiscUtils.inflateLayout(@LayoutRes int resId)

MiscUtils.inflateLayout(Context context, @LayoutRes int resId)

MiscUtils.attachLayout(ViewGroup viewGroup, @LayoutRes int resId)

####2.3 Class

  SimplePagerAdapter

MatchParentDialog

License

Nillith, 2016. Licensed under an Apache-2 license.

Resources

additional functions for TextView.

  • drawable icon
  • drawable tint
  • border etc..

An example project / library of outside layout activity.

This is contains below components:

  • AlignedOutsideActivity
  • ScaleOutsideActivity
  • TranslateOutsideActivity

A simple way to use opencv in your app without having to worry about native libraries and ndk. This library packages the native opencv libs and exposes the Java api to users. The library also includes simple helper classes for camera and video recording.

Android Block style Button.

BlockButton is an extension of LinearLayout (thinking of extending RelativeLayout too..) hence, orientation should be set.

A tool to analysis Android/Java project dependencies.

DroidBot is a lightweight test input generator for Android.

It can send random or scripted input events to an Android app, achieve higher test coverage more quickly, and generate a UI transition graph (UTG) after testing.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes