https://github.com/paulcoding810/android-tools
https://github.com/paulcoding810/android-tools
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/paulcoding810/android-tools
- Owner: paulcoding810
- License: mit
- Created: 2025-01-25T10:20:16.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-18T16:36:46.000Z (3 months ago)
- Last Synced: 2025-02-18T17:30:13.491Z (3 months ago)
- Language: Kotlin
- Homepage: https://central.sonatype.com/artifact/com.paulcoding/androidtools
- Size: 115 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AndroidTools
[](https://central.sonatype.com/artifact/com.paulcoding/androidtools)
A collection of utility functions and extensions for Android development.
## Installation
Add the dependency to your app's build.gradle:
```groovy
implementation("com.paulcoding:androidtools:1.0.0")
```## Usage
Initialize AndroidTools in your Application class:
```kotlin
AndroidTools.initialize(context) {
enableLogging = true // Optional, default is true
enableCrashReporting = true // Optional, default is true
}
```### Features
#### Logging
```kotlin
log("Your message") // Prints formatted log message
someValue.alsoLog() // Logs value and returns it
```#### File Operations
```kotlin
context.readFile("path/to/file.txt") // Read text file
context.readJSONFile("data.json") // Read and parse JSON file
```#### Toast Messages
```kotlin
makeToast("Message") // Show short toast
makeToast(R.string.message) // Show toast from string resource
```#### Navigation
```kotlin
// Animated navigation composable with fade transitions
NavGraphBuilder.animatedComposable(
route = "route",
content = { /* Your composable content */ }
)
```#### App Info
```kotlin
getAppName(context) // Get application name
context.getSignature() // Get app signature details
```#### Extensions
Activity Extensions:
```kotlin
window.setSecureScreen(true) // Enable/disable secure screen
```Context Extensions:
```kotlin
context.openInBrowser("https://example.com") // Open URL in browser
```List Extensions:
```kotlin
lazyListState.isScrolledToEnd() // Check if LazyList is at the end
lazyListState.isScrollingUp() // Observe scroll direction
```String Extensions:
```kotlin
"hello".toCapital() // Capitalize first letter
"text".toInputStream() // Convert string to InputStream
```## License
[MIT](LICIENSE)
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.