AppToolkit is a versatile Android library designed to streamline development by providing pre-built components and utilities that adhere to modern design principles.
- Pre-built Ktor Client: A ready-to-use Ktor client for efficient network operations.
- Material Design Spacers: Predefined spacers that align with Material Design guidelines.
- Android 15 Style Preferences: Customizable settings preferences styled after Android 15.
- Clipboard Helper: Utilities for seamless clipboard interactions.
- Intent Helper: Simplified handling of Android intents.
- AboutLibraries Integration: Easy redirection to AboutLibraries by Mike Penz for displaying open-source licenses.
- ScreenHelper: A utility class to determine screen types (e.g., tablet, phone, orientation). open-source licenses.
To integrate AppToolkit into your project, add the following dependency to your build.gradle
file:
For Kotlin DSL:
dependencies {
api("com.github.D4rK7355608:AppToolkit:+") {
isTransitive = true
}
}
For Groovy DSL:
dependencies {
api('com.github.D4rK7355608:AppToolkit:+') {
transitive = true
}
}
Note: Enabling transitive dependencies ensures that all necessary dependencies included in AppToolkit are available in your project, simplifying setup and reducing potential conflicts.
Here's how to utilize some of the components provided by AppToolkit:
Initialize and use the pre-built Ktor client for network requests:
import com.example.apptoolkit.network.KtorClient
val client = KtorClient.instance
// Use 'client' to make network requests
Implement spacers in your Compose UI to maintain consistent spacing:
import com.example.apptoolkit.ui.Spacers
Spacer(modifier = Modifier.height(Spacers.medium))
Integrate Android 15 styled preferences into your settings screen:
import com.example.apptoolkit.preferences.PreferenceScreen
PreferenceScreen {
// Define your preferences here
}
Copy text to the clipboard with ease:
import com.example.apptoolkit.utils.ClipboardHelper
ClipboardHelper.copyToClipboard(context , "Sample text")
Launch activities or share content using Intent Helper:
import com.example.apptoolkit.utils.IntentHelper
IntentHelper.shareText(context , "Check out AppToolkit!")
Redirect users to the AboutLibraries screen to display open-source licenses:
IntentsHelper.openLicensesScreen(
context = context ,
eulaHtmlString = eulaHtmlString ,
changelogHtmlString = changelogHtmlString ,
appName = R.string.app_name ,
appVersion = BuildConfig.VERSION_NAME ,
appVersionCode = BuildConfig.VERSION_CODE ,
appShortDescription = R.string.app_short_description
)
Contributions are welcome! Please fork the repository and submit a pull request. For major changes, open an issue first to discuss your ideas.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For any questions or suggestions, feel free to reach out to me at d4rk7355608@gmail.com.