Releases: kdroidFilter/Platform-Tools
0.2.9
Full Changelog: v0.2.8...v0.2.9
0.2.8
Full Changelog: v0.2.7...v0.2.8
0.2.7
0.2.6
📢 Release Notes - PlatformTools Dark Mode Detection v0.2.6
🚀 New Features
1️⃣ Reactive Dark Mode Detection
-
New function:
isSystemInDarkMode()
- Unlike
isSystemInDarkTheme()
, which is not reactive on desktop,isSystemInDarkMode()
listens to system-wide dark mode changes in real time. - Implementation details:
- On Windows, macOS, and Linux, it uses JNA (Java Native Access) to detect theme changes dynamically.
- On Android, iOS, JVM, WebAssembly, and JavaScript, it falls back to
isSystemInDarkTheme()
, ensuring cross-platform compatibility.
Example usage in Compose Multiplatform:
MaterialTheme( colorScheme = if (isSystemInDarkMode()) darkColorScheme() else lightColorScheme() ) { // Your UI content }
- Unlike
2️⃣ Adaptive Title Bar for Dark Mode
-
On Windows, the title bar does not automatically change based on the system theme.
Solution:- Added
Window.setWindowsAdaptiveTitleBar(dark: Boolean = isSystemInDarkMode())
- Automatically updates the title bar appearance.
Usage in Compose Desktop:
Window( title = "sample", state = rememberWindowState(width = 800.dp, height = 600.dp), onCloseRequest = ::exitApplication, ) { window.minimumSize = Dimension(350, 600) window.setWindowsAdaptiveTitleBar() App() }
- Added
-
On macOS, simply add the following JVM argument in
build.gradle.kts
to enable dark mode support:compose.desktop { application { nativeDistributions { macOS { jvmArgs( "-Dapple.awt.application.appearance=system" ) } } } }
-
Linux already supports dynamic dark mode title bar updates natively, so no changes are needed.
📦 Installation
To use PlatformTools Dark Mode Detection v0.2.6, update your dependency in build.gradle.kts
:
implementation("io.github.kdroidfilter:platformtools.darkmodedetector:0.2.6")
This update brings full reactive dark mode support to all platforms and ensures proper adaptation of the title bar on Windows/macOS. Enjoy! 🚀
0.2.1
Implement cross-platform install permission handling
Full Changelog: v0.2.0...v0.2.1
0.2.0
Release v0.2.0 🎉
We are excited to announce the release of PlatformTools v0.2.0, featuring significant improvements, new functionalities, and the introduction of an entirely new module! Below is a summary of the latest additions and modifications.
🚀 What's New in v0.2.0
🌐 Core Module
New Feature: getPlatform
The Core
module now includes the getPlatform
function, which allows you to determine the specific platform or runtime environment where the application is running. This addition complements the existing getOperatingSystem
function and provides even more flexibility for platform-specific logic.
fun getPlatform(): Platform
🔧 AppManager Module
Modification: WindowsConfig
Renamed to WindowsInstallerConfig
The configuration class for managing Windows application installations has been renamed for better clarity and consistency. Update your references accordingly:
WindowsInstallerConfig.requireAdmin = false
New Features:
-
hasAppVersionChanged
: Detect if the application version has changed since the last time it was opened. Useful for update-related actions.fun hasAppVersionChanged(): Boolean
-
isFirstInstallation
: Check if it is the first installation of the app. Ideal for onboarding or initial setup.fun isFirstInstallation(): Boolean
📥 ReleaseFetcher Module
New Feature: ReleaseFetcherConfig
The ReleaseFetcher
module now includes ReleaseFetcherConfig
, a configurable object that allows you to fine-tune download buffer sizes and client timeouts for optimized performance:
ReleaseFetcherConfig.downloaderBufferSize = 4 * 1024 * 1024 // Set buffer size to 4 MB
ReleaseFetcherConfig.clientTimeOut = 60_000 // Set timeout to 60 seconds
🆕 Permission Handler Module
The Permission Handler module is a brand-new addition to the library, simplifying the process of checking and requesting permissions on Android.
Key Features:
-
Comprehensive Permission Support:
- Install Permissions
- Notifications
- Location (Coarse, Fine, Background)
- Bluetooth
- Camera
- Audio Recording
- Overlay
- Contacts (Read/Write)
- External Storage (with Android 13+ specific media permissions)
-
Ease of Use: Minimal setup and clear APIs for checking and requesting permissions with simple callbacks for granted or denied states.
Example:
fun checkAndRequestInstallPermission() {
if (hasInstallPermission()) {
println("Install permission already granted.")
} else {
requestInstallPermission(
onGranted = {
println("Install permission granted.")
},
onDenied = {
println("Install permission denied.")
}
)
}
}
📦 Dependency Updates
To include these features in your project, update your dependencies in build.gradle.kts
:
- Core Module:
implementation("io.github.kdroidfilter:platformtools.core:0.2.0")
- AppManager Module:
implementation("io.github.kdroidfilter:platformtools.appmanager:0.2.0")
- ReleaseFetcher Module:
implementation("io.github.kdroidfilter:platformtools.releasefetcher:0.2.0")
- Permission Handler Module:
implementation("io.github.kdroidfilter:platformtools.permissionhandler:0.2.0")
🛠️ Upgrading Notes
- Update any references from
WindowsConfig
toWindowsInstallerConfig
. - Leverage new utility functions such as
hasAppVersionChanged
,isFirstInstallation
, andgetPlatform
for enhanced functionality. - Explore the new
Permission Handler
module for Android-specific permission handling. - Use
ReleaseFetcherConfig
to customize download configurations in theReleaseFetcher
module.
Thank you for using PlatformTools!
- 0.2.0 by @kdroidFilter in #2
Full Changelog: v0.1.4...v0.2.0
0.1.4
Release v0.1.4 🎉
This release introduces enhancements to platform detection, extending support to JavaScript (JS) and WebAssembly (WASM) environments, alongside minor improvements and optimizations.
🛠️ Key Features
getOperatingSystem
:- Renamed from
getPlatform
for improved clarity. - Detects the operating system across JVM, JS, and WASM environments.
- Renamed from
Example:
import io.github.kdroidfilter.platformtools.getOperatingSystem
val operatingSystem = getOperatingSystem()
println("Current operating system: $operatingSystem")
Full Changelog: v0.1.3...v0.1.4
0.1.3
Release v0.1.3 🎉
This release introduces the restartApplication
feature, enabling seamless application restarts, alongside several refinements and optimizations for enhanced usability.
🛠️ Key Features
restartApplication
:- A new function to restart the current application programmatically.
- Simplifies workflows that require application restarts after updates or configuration changes.
Example:
import io.github.kdroidfilter.platformtools.appmanager.getAppInstaller
val appInstaller = getAppInstaller()
// Restart the current application
appInstaller.restartApplication()
Full Changelog: v0.1.2...v0.1.3
0.1.2
Release v0.1.2 🎉
This update introduces WindowsConfig
for enhanced installation configuration on Windows and includes minor improvements and fixes.
🛠️ Key Features
WindowsConfig
:- New object to configure Windows installation settings.
requireAdmin
(default:true
) can be set tofalse
for non-admin installations.
Example:
WindowsConfig.requireAdmin = false
🌐 Notes
WindowsConfig
simplifies user-level installations and caters to non-admin users.
Full Changelog: v0.1.1...v0.1.2
0.1.1
Release v0.1.1 🎉
What's New
- Improved Documentation: Enhanced module documentation for better clarity.
- Refactored Structure: Optimized the library's structure to remove unused targets.
- Enhanced Update Checker: Added refinements for smoother release fetching and update checks.
- Cache Directory Access: Retrieve platform-independent cache directories for JVM and Android.
- Application Versioning: Added functionality to manage and fetch application versions on JVM and Android.
- Release Fetcher: Improved support for fetching the latest release information from GitHub repositories, tailored to specific platforms.
- Downloader: Enhanced functionality for downloading files with robust progress tracking and error handling.
Full Changelog: v0.1.0...v0.1.1