Skip to content

An Android library containing an assortment of small helper classes, functions and views useful for Android projects.

Notifications You must be signed in to change notification settings

TazkiyaTech/android-utils

Repository files navigation

Android Utils Library

This library contains a mixture of small helper classes, functions and views useful for Android projects.

Collections

  • ArrayExtensions – Provides a Kotlin extension function for checking whether an Array contains any of the elements of another array.
  • CollectionExtensions – Provides a Kotlin extension function for checking whether a Collection contains any of the elements of another collection.
  • ImmutableList – Provides a helper method for creating immutable copies of java.util.List instances
  • ImmutableMap – Provides a helper method for creating immutable copies of java.util.Map instances.
  • ImmutableSet – Provides a helper method for creating immutable copies of java.util.Set instances.
  • ListExtensions – Provides a Kotlin extension function for joining a List of String objects into a single String object.

Display

  • Colors – Provides a number of Kotlin extension functions for converting between different colour representations.
  • Dimensions – Provides a number of Kotlin extension functions for converting between different dimension units.
  • Themes – Provides a number of Kotlin extension functions for getting colours such as the primary text colour out of the theme.

Fragments

  • DialogFragmentExtensions – Provides a Kotlin extension function which allows a DialogFragment to be shown even after the activity's state has been saved.

Network

  • NetworkInspector – Provides helper methods for checking the state of the network.

Streams

  • StreamCopier – Provides an easy method for copying the contents of an input stream to an output stream.
  • StringInputStream – Provides an easy method for reading in the contents of an input stream and converting it to a String instance.
  • StringOutputStream – Provides an easy method for writing a String instance to an output stream.

Text

  • CharSequenceExtensions – Provides a number of Kotlin extension functions for the CharSequence class.
  • SpannableExtensions – Provides a number of Kotlin extension functions for adding spans to an android.text.Spannable instance.
  • SpannableStringBuilderExtensions – Provides a number of Kotlin extension functions for adding spans to an android.text.SpannableStringBuilder instance.

Views

  • RecyclerViewExtensions – Provides Kotlin extension functions for drawing a colored divider or a vertical gap between items in a RecyclerView.
  • SimpleTouchListener – An implementation of the android.view.View.OnTouchListener interface that simply reports when a android.view.View is touched down and when the touch is subsequently released or canceled.
  • SpinnerLookalikeView – An extension of the android.widget.FrameLayout class that looks like an android.widget.Spinner view.

Setup

To use the above utilities within your app simply add the following repository and dependency declaration in the build.gradle file of your Android project:

repositories { mavenCentral() } dependencies { implementation 'com.tazkiyatech:android-utils:0.2.5' }

About

An Android library containing an assortment of small helper classes, functions and views useful for Android projects.

Topics

Resources

Stars

Watchers

Forks