Giter Club home page Giter Club logo

fancytoast's Introduction

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
  repositories {
    ...
    maven { url "https://jitpack.io" }
  }
}

Dependency

Add this to your module's build.gradle file

dependencies {
  ...
  implementation 'com.github.SKProtech:FancyToast:1.2.0'
}

Screenshots

Usage

To display an Success Toast:

FancyToast.makeText(getApplicationContext(), "Example of Success Toast", FancyToast.LENGTH_LONG, FancyToast.SUCCESS).show();

To display an Warning Toast:

FancyToast.makeText(getApplicationContext(), "Example of Warning Toast", FancyToast.LENGTH_LONG, FancyToast.WARNING).show();

To display an Info Toast:

FancyToast.makeText(getApplicationContext(), "Example of Info Toast", FancyToast.LENGTH_LONG, FancyToast.INFO).show();

To display an Error Toast:

FancyToast.makeText(getApplicationContext(), "Example of Error Toast", FancyToast.LENGTH_LONG, FancyToast.ERROR).show();

To display a Default Toast:

FancyToast.makeText(getApplicationContext(), "Example of Default Toast", FancyToast.LENGTH_LONG, FancyToast.DEFAULT).show();

To use FancyToast.Builder:

bindBuilder(your Builder)

Customization

Initialization

FancyToast.Builder builder = new FancyToast.Builder();

To set custom Title

builder.setTitle("Your Custom Title");

To set custom Typeface

builder.setTypeface(Typeface.SERIF);

Or

builder.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/your_font.ttf"));

Important note:

Use Builder just Before makeText method

FancyToast.bindBuilder(builder).makeText(MainActivity.this, "", FancyToast.LENGTH_LONG, FancyToast.SUCCESS).show();

Apps using FancyToast

Want to be here? Open an issue or make a pull request.

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

License

Copyright 2020 Protech Inc

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.

fancytoast's People

Contributors

skprotech avatar hasrat-ali avatar

Stargazers

Md. Abdul Salam  avatar Dev Emafine avatar thatmidcoder393 avatar Netsnake avatar  avatar  avatar Egemen ÖZOGUL avatar

Watchers

Netsnake avatar  avatar

fancytoast's Issues

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.