Starmel / app-core

Contains classes that can be reused in different projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Awesome Download

App Core

A set of extensions for Kotlin and RX utilities for more comfortable development of android applications. This library is designed to combine often used functions in development and provide a convenient API for working with widespread, boilerplate tasks. Each project contains an utility package, so this project is called upon to replace it, as well as find a quick solution for everyday tasks. You can add the library completely or select only the modules you need.

See Getting Started for more information about how to start using this library.

Few samples:

Date extensions:

var sampleDate:Date = System.currentTimeMillis().toDate()
var formattedDate = sampleDate
                        .toStringWithFormat(CommonFormats.FORMAT_SIMPLE_DATE_TIME)

Fonts and Spans extensions:

var spannableText = someStingText.applyFont(context, "Roboto-Bold.ttf")
var spannableText = (someStringText.applySpanSet()
                      add font(getTypeface("Roboto-Bold.ttf")) toText "Digital"
                      and font(getTypeface("Roboto-Italic.ttf")) from start2 to end2
                      and relativeSize(1.8f) toText "revolution"
                      and foregroundColor(Color.GREEN) from start3
                      and absSize(28f.spToPx(context).toInt()) toText "we do.").build()

Intents:

  callIntent("+### ### ## ##").launch(context)
 selectContactIntent()
        .launchForResult(context)
        .subscribe(
           { rxResult:RxActivityResult->
                   doSomeThingWithResult(rxResult)
           },
           { 
             it.message.toString.showToast(contxt)
           })

For full list of provided functions select one of detailed readme in list below:

For more information about how to use - look into sample project

Getting Started

To add App Core to your project, add the following to your app module's build.gradle:

repositories {
    maven {
        url  "https://dl.bintray.com/nullgr-dev/maven"
    }
}

dependencies {
    // for all modules
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
    
    // core-all
    implementation "com.nullgr.core:core-all:$CORE_VERSION"
    implementation "androidx.recyclerview:recyclerview:$RECYCLER_VERSION"
    implementation "androidx.appcompat:appcompat:$COMPAT_VERSION"
    implementation "androidx.browser:browser:$BROWSER_VERSION"
    implementation "androidx.annotation:annotation:$ANOTATION_VERSION"
    implementation "com.google.android.gms:play-services-location:$PLAY_SERVICES_VERSION"
    
    // core-adapter
    implementation "com.nullgr.core:core-adapter:$CORE_VERSION"
    implementation "androidx.recyclerview:recyclerview:$RECYCLER_VERSION"
    
    // core-adapter-ktx
    implementation "com.nullgr.core:core-adapter:$CORE_VERSION"
    implementation "com.nullgr.core:core-adapter-ktx:$CORE_VERSION"
    implementation "androidx.recyclerview:recyclerview:$RECYCLER_VERSION"
    
    // core-collections
    implementation "com.nullgr.core:core-collections:$CORE_VERSION"
    
    // core-common
    implementation "com.nullgr.core:core-common:$CORE_VERSION"
    
    // core-date
    implementation "com.nullgr.core:core-date:$CORE_VERSION"
    
    // core-font
    implementation "com.nullgr.core:core-font:$CORE_VERSION"
    implementation "androidx.appcompat:appcompat:$COMPAT_VERSION"
    
    // core-hardware
    implementation "com.nullgr.core:core-hardware:$CORE_VERSION"
     
    // core-intents
    implementation "com.nullgr.core:core-intents:$CORE_VERSION"
    implementation "androidx.browser:browser:$BROWSER_VERSION"
    implementation "androidx.annotation:annotation:$ANOTATION_VERSION"
    
    // core-interactor
    implementation "com.nullgr.core:core-interactor:$CORE_VERSION"
    
    // core-preferences
    implementation "com.nullgr.core:core-preferences:$CORE_VERSION"
    
    // core-resources
    implementation "com.nullgr.core:core-resources:$CORE_VERSION"
    implementation "androidx.annotation:annotation:$ANOTATION_VERSION"
    
    // core-rx
    implementation "com.nullgr.core:core-rx:$CORE_VERSION"
    
    // core-rx-contacts
    implementation "com.nullgr.core:core-rx-contacts:$CORE_VERSION"
    implementation "androidx.annotation:annotation:$ANOTATION_VERSION"
    
    // core-rx-location
    implementation "com.nullgr.core:core-rx-location:$CORE_VERSION"
    implementation "com.google.android.gms:play-services-location:$PLAY_SERVICES_VERSION"
    
    // core-ui
    implementation "com.nullgr.core:core-ui:$CORE_VERSION"
    implementation "androidx.recyclerview:recyclerview:$RECYCLER_VERSION"
    implementation "androidx.appcompat:appcompat:$COMPAT_VERSION"
    
    //core-security
    implementation "com.nullgr.core:core-security:$CORE_VERSION"
    implementation "androidx.appcompat:appcompat:$COMPAT_VERSION"
}

Project Status

This project is currently in preview, and we are seeking feedback from the developers community. We are open to suggestions for improvements and new ideas. Please see the "How to Contribute" section if you would like to contribute.

During the preview period, the App Core APIs may change at anytime. Of course, we will try to minimize such changes, but if this becomes necessary, all the necessary migrations will be described in CHANGELOG When the project reaches a stable state, we will update it to version 1.0.0 (or later). For all new versions we will log changes in CHANGELOG.

How to Contribute

Please read carefully the file CONTRIBUTION

License

MIT License

Copyright (c) 2018 Nullgravity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Contains classes that can be reused in different projects

License:MIT License


Languages

Language:Kotlin 99.9%Language:Java 0.1%