Skip to content

Swiss Army Knife with classes, functions and extensions to help with Android development.

License

Notifications You must be signed in to change notification settings

vegidio/android-sak

Repository files navigation

Android Swiss Army Knife

An Android library where I keep my custom classes, extensions and other files that help me during the development of my Android projects.

⬇️ Download

This library is hosted in my own Maven repository, so before using it in your project you must add the repository https://maven.vinicius.io to your settings.gradle.kts file:

dependencyResolutionManagement {
    //...
    repositories {
        google()
        mavenCentral()
        maven { setUrl("https://maven.vinicius.io") } // Add this line
    }
    //...
}

With the repository added, you just need to add the dependencies that you need to your project's build.gradle.kts file:

//...
dependencies {
    implementation("io.vinicius.sak:network:24.1.16") // Network SAK
    implementation("io.vinicius.sak:util:24.1.16")    // Util SAK
    implementation("io.vinicius.sak:view:24.1.16")    // View SAK
}
//...

🧰 Toolbox

The Swiss Army Knife is currently divided in 3 packages:

Network

  • FlowCallAdapterFactory: a Retrofit CallAdapter to output the responses as Flow.
  • GeneralConverterFactory: a general class to create different Retrofit Converters.
  • GraphqlFactory: to make GraphQL requests and process the responses.
  • RestFactory: to make REST requests and process the responses.
  • NetworkState: enum with basic states and the ability to pass data to errors.

Adapter

  • BigDecimalAdapter: a Moshi adapter to de/serialize BigDecimal fields.
  • LocalDateAdapter: a Moshi adapter to de/serialize LocalDate fields.
  • LocalTimeAdapter: a Moshi adapter to de/serialize LocalTime fields.
  • LocalDateTimeAdapter: a Moshi adapter to de/serialize LocalDateTime fields.

Util

  • PrivateFlow: an interface that allows the creation of PrivateStateFlow and PrivateSharedFlow.
  • StringExtensions: a set of extensions useful for String manipulation.

View

  • InputField: an OutlinedTextField with a few extra features set by default.
  • EmailField: a InputField with e-mail parameters set by default.
  • PasswordField: a InputField with password parameters set by default.
  • ListRow: a view to be used in lists with chevron and separator set by default.
  • Lottie: a view used to display Lottie animations.
  • OverlaidColumn: a Column with multiple overlays that change depending on a state.
  • OverlaidRow: a Row with multiple overlays that change depending on a state.
  • OverlaidLazyColumn: a LazyColumn with multiple overlays that change depending on a state.
  • OverlaidLazyRow: a LazyRow with multiple overlays that change depending on a state.
  • OverlaidLazyVerticalGrid: a LazyVerticalGrid with multiple overlays that change depending on a state.

🎨 Code Correctness

This project uses Ktlint to keep the code formatted and Detekt to follow best practices. The linting is done by running the command below in the project's root dir:

$ ./gradlew ktlintFormat detekt

👨🏾‍💻 Author

Vinicius Egidio (vinicius.io)

About

Swiss Army Knife with classes, functions and extensions to help with Android development.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages