UReflection


Source link: https://github.com/mnayef95/UReflection

UReflection library

A light-weight android library that can be quickly integrated into any app to use android utils.

Example Uses

  • Check gps enabled.
  • Check internet connection.
  • Check internet available.
  • Check is wifi.
  • Check is fast mobile network connection.
  • Get wifi scan.
  • Get network type name.
  • Get current wifi network info.
  • Md5 hash.
  • Sha1 hash.
  • Base64 encryption.
  • Base64 decryption.
  • Get app url on play store.
  • Get country code.
  • Get current date.
  • Get current time.
  • Get app hash key.
  • Get device language.
  • Get version name.
  • Get version code.
  • Get status bar height.
  • Get navigation bar height.
  • Get screen height.
  • Get screen width.
  • Get date after some days.
  • Get day of week.
  • Get week of month.
  • Get font from asset.
  • Inflate xml layout.
  • Read text file from asset.

Example UReflection:

Application Class

@Override public void onCreate() {

  super.onCreate();

  UReflection.init(this);
 
}
 

Java class

@AppUrl String appUrl;  @Override protected void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  setContentView(R.layout.activity_main);

UReflection.bind(this);
 
}
 

Example bind by variables name:

JAVA

@AppUrl String appUrl; @IsConnected boolean isConnected; @Md5 String md5 = "Mohamed";  @Override protected void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  setContentView(R.layout.activity_main);

UReflection.bind(this);

md5 = "Hamdan"
  UReflection.bind(this, "md5");

  Log.e(TAG, md5);

// multi variables
  UReflection.bind(this, "md5", "isConnected", "appUrl");
 
}
 

How do I get set up?

Project-level build.gradle (<project>/build.gradle):

allprojects {

  repositories {

...

maven {
 url 'https://jitpack.io' 
}

  
}
 
}
 

App-level build.gradle (<project>/<app-module>/build.gradle):

compile 'com.github.mnayef95.UReflection:annotations:v1.2.1' compile 'com.github.mnayef95.UReflection:utils:v1.2.1' annotationProcessor 'com.github.mnayef95.UReflection:compiler:v1.2.1' 

Support annotations

@AppUrl() @Base64Decode(Flags) @Base64Encode(Flags) @CountryCode() @CurrentDate(Format) @CurrentTime @DateAfter(Days) @DayOfWeek() @DeviceLanguage() @Font(Asset path) @GpsEnabled() @HashKey() @Inflate(Xml layout) @IsConnected() @IsFastNetwork() @IsNetworkAvailable() @IsWifi() @Md5() @NavBarHeight() @NetworkTypeName() @ScreenHeight() @ScreenWidth() @Sha1() @StatusBarHeight() @TextFromAsset(Asset path) @VersionCode() @VersionName() @WeekOfMonth() @WifiInfo() @WifiScanResults() 

Resources

A set of RxJava2 Extensions to get/set values of SharedPreferences in a super simple way.

Tempo is a Kotlin library for Android to get the current time from multiple sources: SNTP, GPS; or your own time source.

An OpenCV based library for Android to scan (detect and crop) ID documents or Passports.

An infinite scrolling timeline to pick a date.

Full Animation Control on Paths and VectorDrawables.

Smooth UI for Credit Card Entry on Android device, perform check for supported credit card types , pan length and luhn check. Inspired by Uber credit card entry interface.

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