An open API service indexing awesome lists of open source software.

https://github.com/paulcoding810/android-tools


https://github.com/paulcoding810/android-tools

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# AndroidTools

[![Maven Central](https://img.shields.io/maven-central/v/com.paulcoding/androidtools.svg)](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.