Code Monkey home page Code Monkey logo

notils's Introduction

notils CI status Download from Bintray Apache 2.0 Licence

Never again need a .utils. package yur scurvy sea dogs!

Notils comes in two modules - notils-java contains classes that don't depend on anything from the Android SDK, while notils-android contains classes that do.

Description

notils contains a set of common classes that we use in our projects:

  • AndroidUtils, for showing the keyboard, checking running services, etc.
  • ClassCaster - to help with listeners between Activitys & Fragments
  • No need to cast when finding Fragments
  • No need to double type your types when creating collections
  • Simple Fade animations in & out done for you
  • Simple Log to give to give automatic details of where the Log executed
  • StrictMode Management - enable strict mode in one line
  • WebViews, allowing custom loading of different scenarios (raw assets, external urls)
  • ToastDisplayers for saner displaying of Toast notifications
  • SimpleDateFormatThreadSafe allowing you to use date formatting from multiple threads
  • DeveloperError - custom exceptions for explicit declaration / faster feedback when something goes wrong
  • SimpleTextWatcher - simple implementation of android.text.TextWatcher with stub implementations of each method
  • QueryUtils - easily create placeholders for ContentResolver operations selection
  • DeviceDetection - to detect whether the user has Amazon or Intel x86 devices.
  • AndroidVersion - to check the Android version in a nicer way.

Adding to your project

To start using this library, add these lines to the build.gradle of your project:

repositories {
    jcenter()
}

dependencies {
    compile 'com.novoda:notils-java:3.1.5'
    compile 'com.novoda:notils-android:3.1.5'
}

Simple usage

Here are a few examples.

  • Use the Views class to avoid casting your views over and over!
UserFragment userFragment = Fragments.findFragmentById(fragmentmanager, R.id.userFragment);
  • Use DeveloperError to let other devs know a problem in the code or prevent potential issues:
switch (menuOptionId) {
    case R.id.menu_take_picture:
        // Start the camera...
    break;
    case R.id.menu_from_gallery:
        // Open the gallery...
    break;
    default:
        throw new DeveloperError("Unhandled case in switch statement!");
}
  • Object-oriented Toasts!
Toaster toaster = new Toaster(context);
toaster.popToast("Good morning!"); // Short toast
toaster.popBurntToast("Good night!"); // Long toast
toaster.dropInBath(); // Cancells all active toasts this toaster created
  • Check the javadoc for more! The package structure allows you to easily see what's in each package.

Links

Here are a list of useful links:

  • We always welcome people to contribute new features or bug fixes, here is how
  • If you have a problem check the Issues Page first to see if we are working on it
  • For further usage or to delve more deeply checkout the Project Wiki
  • Looking for community help, browse the already asked Stack Overflow Questions or use the tag: support-notils when posting a new question

notils's People

Contributors

ataulm avatar blundell avatar ouchadam avatar frankiesardo avatar xrigau avatar zegnus avatar danybony avatar devisnik avatar tasomaniac avatar mr-archano avatar quentin23soleil avatar rock3r avatar dorvaryn avatar stefanhoth avatar fourlastor avatar friedger avatar joetimmins avatar sgaland avatar lgvalle avatar henriquerocha avatar jonreeve avatar markosullivan94 avatar shivgadhia avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.