An Android library where I keep my custom classes, extensions and other files that help me during the development of my Android projects.
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
}
//...
The Swiss Army Knife is currently divided in 3 packages:
- FlowCallAdapterFactory: a Retrofit
CallAdapter
to output the responses as Flow. - GeneralConverterFactory: a general class to create different Retrofit
Converter
s. - 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.
- 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.
- PrivateFlow: an interface that allows the creation of
PrivateStateFlow
andPrivateSharedFlow
. - StringExtensions: a set of extensions useful for String manipulation.
- 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.
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
Vinicius Egidio (vinicius.io)