ProductPromotion
Logo

Kotlin

made by https://0x3d.site

GitHub - matteocrippa/karamba: A collection of useful Kotlin extension for Android
A collection of useful Kotlin extension for Android - matteocrippa/karamba
Visit Site

GitHub - matteocrippa/karamba: A collection of useful Kotlin extension for Android

GitHub - matteocrippa/karamba: A collection of useful Kotlin extension for Android

karamba

A collection of useful Kotlin extension for Android

karamba

Install

Add to gradle in allprojects

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

then add this

compile 'com.github.matteocrippa:karamba:1.2.0'

Usage

Karamba provides you a list of different and useful extensions for your project, here the list organized by the type extended.

General

  • support(apiVersion), lambda that allow you to run code only if current SDK is up to specified one
  • supportKitkat(), lambda that checks if kitkat is supported and run the code
  • supportLollipop(), lambda that checks if lollipop is supported and run the code

Bitmap

  • base64(), produces a base64 representation of the current bitmap
  • resize(height, width), resize the current bitmap to new format

Boolean

  • toggle(), handle the bool as a toogle changing the value to opposite one, then the new value is returned (not yet possible to change this)
  • random(), returns a random boolean value, then the new value is returned (not yet possible to change this)

Date

  • convertTo(format), converts current date to a custom format provided as argument (eg. dd-MM-yy HH:mm)
  • toCalendar(), converts current date to Calendar
  • isFuture(), returns true if date is in the future
  • isPast(), returns true if date is in the past
  • isToday(), returns if current date is today
  • isTomorrow(), returns if current date is tomorrow
  • isYesterday(), returns if current date is yesterday
  • today(), returns today's date
  • tomorrow(), returns tomorrow's date
  • yesterday(), returns yesterday's date
  • hour(), returns current date hour as number
  • minute(), returns current date minutes as number
  • second(), returns current date seconds as number
  • month(), returns current date month as number
  • monthName(), returns current date month as long name
  • year(), returns current date year as number
  • day(), returns current date day as number
  • dayOfWeek(), returns current date day of the week as number
  • dayOfWeekName(), returns current date weekday as string
  • dayOfYear(), returns current date day of year as number

Double

  • localCurrency(currency), converts current double to the currency format passed as argument (eg. EUR)
  • celsiusToFahrenheit(), converts current double to fahrenheit
  • fahrenheitToCelsius(), converts current double to celsius

Drawable

  • toBitmap(), converts the current drawable in Bitmap

Int

  • readableDistanceFromMeters(), converts an int amount of meters in a readable meter, kilometers distance
  • commaSeparatedId(), converts an array of int, in a string of comma separated items
  • random(), provides a random number in the range provided (eg. (0..10).random())

String

  • isValidEmail(), returns if current string is a valid email
  • isUrl(), returns if current string is a valid url
  • isNumeric(), returns if current string contains a number
  • isPhoneNumber(), returns if current string contains a phone number
  • random(lenght), returns a random string of provided length
  • toBitmap(), convert current base64 string into Bitmap
  • ellipsize(chars), ellipsizes the current string, truncating at defined amount of characters
  • toDate(format), converts current string in a Date object using the provided format
  • plainText(), removes all html formatting from current string
  • toCamelCase(), camel case the current string current string

View

  • toBitmap(), converts current view into Bitmap

Credits

Icon is taken by free emojii set by Vincent Le Moign

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory