A Stylish Kotlin Toast Library for Android Apps ππ€
Success Toast | Warning Toast | Failure Toast | Default Toast |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
An impressive and versatile Kotlin-based Android library is here to elevate your app experience with its stunning and multi-functional Awesome Toast component.
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
if this shows Error in your android studio paste this
allprojects {
repositories {
...
maven { url = uri("https://www.jitpack.io" ) }
}
}
Add dependency in your app module
dependencies {
implementation 'com.github.Vibhav00:awesometoast:1.0.0'
}
1. TOAST_SUCCESS
3. TOAST_WARNING
5. TOAST_DELETE
2. TOAST_ERROR
4. TOAST_INFO
6. TOAST_NO_INTERNET
7. TOAST_PERMISSIONS_REQUIRED
8. TOAST_DEFAULT
1. LENGTH_LONG // 3 Seconds
2. LENGTH_SHORT // 2 Seconds
AwesomeToast.createToast(
this@MainActivity,
"Successfully Saved π ",
"Your item was saved successfully ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.SUCCESS,
)
AwesomeToast.createToast(
this@MainActivity,
"Provide strong password β οΈ ",
"password must contain one number ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.WARNING,
)
AwesomeToast.createToast(
this@MainActivity,
"Item Deleted ποΈ",
"item was deleted ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.DELETE,
)
AwesomeToast.createToast(
this@MainActivity,
"Failed to Save π",
"Error while saving the item ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.ERROR,
)
AwesomeToast.createToast(
this@MainActivity,
"Please Enter Email π‘ ",
"Email Should not be Empty ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.INFO,
)
AwesomeToast.createToast(
this@MainActivity,
"Connection Problem π",
"internet or wifi is not available ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.NO_INTERNET,
)
AwesomeToast.createToast(
this@MainActivity,
"Permission Required π",
"Permission for internet is Required ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.PERMISSION_REQUIRED,
)
AwesomeToast.createToast(
this@MainActivity,
"Hello Everyone π",
"Welcome to this app ",
Toast.LENGTH_SHORT,
AwesomeToastStyles.DEFAULT,
)
Copyright Β© 2024 Vibhav Kumar
This file is licensed under the Apache License, Version 2.0. You are permitted to use this file only in accordance with the terms of 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.