/ComposeToast

Animated Jetpack Compose replacement of android standart Toast messages

Primary LanguageKotlinApache License 2.0Apache-2.0

ComposeToast

Animated Jetpack Compose replacement of android standard Toast messages

Copy ToastHost.kt file to your repository and you are ready to engage!

//Usage example
val toastHostState = remember { ToastHostState() }
val scope = rememberCoroutineScope()

Button(
    onClick = { 
        scope.launch {
            toastHostState.showToast(/*Your Visuals*/)
        }
    }
) {
    Text("Show Toast")
}

ToastHost(hostState = toastHostState)

Note

Also remember to add this dependencies to local build.gradle folder

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("androidx.compose.ui:ui:1.4.0-alpha03")
implementation("androidx.compose.material3:material3:1.1.0-alpha03")

Find this repository useful? ❤️

Support it by joining stargazers for this repository. ⭐
And follow me for my next creations! 🤩

License

Designed and developed by 2023 T8RIN

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.