ThemeSwitchButton
A composable button that toggles between light and dark themes with animation.
This button displays a theme-aware icon and, when clicked, triggers a theme transition animation through the provided animationState. The button is rendered in a popup to ensure proper position tracking for animations that require press position information (such as io.github.themeanimator.ThemeAnimationFormat.CircularAroundPress).
The button uses Material Design's IconButton component and automatically updates its icon based on the current theme state.
Parameters
The ThemeAnimationState that controls the theme switch animation. This state tracks the current theme and manages the animation lifecycle.
The icon to display on the button. Defaults to DefaultButtonIcon which shows a sun icon for dark theme and moon icon for light theme. Custom icons can be provided using ThemeSwitchIcon implementations.
The modifier to be applied to the button container. Note that due to the popup rendering, some layout modifiers may not behave as expected.
The target size of the internal icon. Defaults to 20.dp.
The scale factor to apply to the icon. Defaults to 1.0f (no scaling). Use values greater than 1.0f to enlarge the icon or less than 1.0f to shrink it.