CodeKit

General

Category
Free
Tag
Tools
License
MIT License
Min SDK
19 (Android 4.4 KitKat)
Registered
Sep 7, 2021
Favorites
0
Link
https://github.com/ctrlbytes/CodeKit
See also
ApkChannelBuilder
dryrun
international
vcard-androidParser
j2j

Additional

Language
Kotlin
Version
0.2.0 (May 29, 2021)
Created
Jul 24, 2020
Updated
Sep 2, 2021
Owner
CtrlBytes (ctrlbytes)
Contributor
Lakshmi Sankar (plsankar)
1
Activity
Badge
Generate
Download
Source code

Blurb

CodeKit

Adding to your project

  1. Add the JitPack repository to your build.gradle at the end of repositories:
repositories {
  ...
  maven { url 'https://jitpack.io' }
}
  1. Add the dependency
implementation 'com.github.ctrlbytes:CodeKit:LATEST_VERSION_HERE'

Usage

ConnectivityUtils

ConnectivityUtils.isInternetOn(context);
ConnectivityUtils.isMobileDataOn(context);
ConnectivityUtils.isWiFiOn(context);

AppsInDevice

AppsInDevice.isInstalled(context, packageName)

Context KTX

launchActivity(activityClass) { intent ->
    putExtra()
}

openUrl(urlString)

toast(stringRes|string)
toast(stringRes|string, LENGTH_SHORT)

openAppInPlayStore() // will open current app
openAppInPlayStore(appPackageName) // will open the specified package

Fragment KTX

toast(stringRes|string)
toast(stringRes|string, LENGTH_SHORT)

TextInputLayout KTX

getValue()
setValue(string)
clear()

View KTX

hide() // visibility gone by default
hide(VISIBLE|GONE) // or specify
show() // visibility visible

Date KTX

format("dd-MM-yyy")
format("dd-MM-yyy", locale)
format(simpleDateFormat)

Cursor KTX

val items = dbCursor.toList {
   it.getString(0)
}

Utils KTX

runSafe {
    // do things that may throw error and don't care about the error (error will be printed to the console)
}