Skip to content

🐒 Toastic is the new way for creating custom toast messages.

License

Notifications You must be signed in to change notification settings

yagmurerdogan/Toastic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🟒 Success Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Success Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.SUCCESS,
                    isIconAnimated = true
                ).show()
            }

πŸ”΅ Info Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Info Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.INFO,
                    isIconAnimated = true
                ).show()
            }

🟑 Warning Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Warning Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.WARNING,
                    isIconAnimated = true
                ).show()
            }

πŸ”΄ Error Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Error Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.ERROR,
                    isIconAnimated = true
                ).show()
            }

⚫️ Default Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Default Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.DEFAULT,
                    isIconAnimated = true
                ).show()
            }

πŸ’πŸ»β€β™€οΈ Can I customize the Toastic more?


πŸ’– Customized Default Toastic

    button.setOnClickListener {
                Toastic.toastic(
                    context = this@MainActivity,
                    message = "This is Default Toastic!",
                    duration = Toastic.LENGTH_SHORT,
                    type = Toastic.DEFAULT,
                    isIconAnimated = true,
                    customIcon = R.drawable.ic_heart,
                    font = R.font.helveticabold,
                    customBackground = R.drawable.bg_pink,
                    textColor = Color.WHITE,
                    customIconAnimation = R.anim.rotate
                ).show()
            }

πŸ“Œ F.A.Q

✨ Can I add any icon I want instead of defaults? πŸ‘‰πŸ» Yes!

customIcon = R.drawable.ic_heart

✨ Can I add any animation to icon instead of defaults? πŸ‘‰πŸ» Yes!

customIconAnimation = R.anim.rotate

✨ Can I use different font style for text? πŸ‘‰πŸ» Yes!

font = R.font.helveticabold

✨ Can I change the text color? πŸ‘‰πŸ» Yes!

textColor = Color.WHITE

✨ Can I change the background? πŸ‘‰πŸ» Yes!

customBackground = R.drawable.bg_pink

✨ I don't want to use any animation for icon. Is that possible to use without animation? πŸ‘‰πŸ» Yes!

isIconAnimated = false

πŸ§œπŸ»β€β™€οΈ Sample App

sampleApp.mp4

πŸ›Ό Thanks for Icons

Tick icons created by Alfredo Hernandez - Flaticon

Error icons created by Ilham Fitrotul Hayat - Flaticon

Warning icons created by Creatype - Flaticon

Info icons created by Plastic Donut - Flaticon

🌸 Implementation

repositories {  
 maven { url 'https://jitpack.io' }  
}  
  
dependencies {  
 implementation 'com.github.yagmurerdogan:Toastic:latest-version'
}  

🌍 Contribution

Please feel free to contribute!

If this will be your first contributon, you can check this website.

πŸ“š License

Created by 2022 yagmurerdogan (Yağmur Erdoğan)

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.