Giter Site home page Giter Site logo

toastic's Introduction

🟒 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.

toastic's People

Contributors

yagmurerdogan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.