Giter VIP home page Giter VIP logo

huxyapp's Introduction

Create a customized toast message with amazing features , with few lines of code Today.

HuxyApp

HuxyApp is a Library eases creating custom and styled toast notifications with few lines of code.

Try it out today.

Requirements Used.

  1. Android.
  2. Java.

How to set up HuxyApp (Toast Library).

Step 1.

  • Add the JitPack repository to your build file as below :
  allprojects {
     		repositories {
     			...
     			maven { url 'https://jitpack.io' }
     		}
     	}

Step 2.

  • Add the dependency
dependencies {

	         implementation 'com.github.huxaiphaer:HuxyLab:1.0.0'     
	}

Then "walaaa", you are good to go. :)

How to use the Library.

For a success Message.

HuxyApp.successToast(Context, "No internet connection please.");

The code above enables a developer to set the Context , Message , Position of the toast , xOffset and yOffset.

So the developer can be able to set the properties of the application. Since this is the Success Toast , it comes with a GREEN background color.

Below is the sample of the Toast :

success_toast_gif

Below is an example :
 HuxyApp.successToast(MainActivity.this, "Good Internet Connection")
                .setPadding(3)
                .setPositionAndOffSet(Gravity.CENTER,0,0);

For a danger Message.

Below is the Example of Danger toast, you need to specify the dangerToast(). By default this toast's background is RED.

HuxyApp.dangerToast(MainActivity.this, "Bad Internet Connection")
                .setPadding(3)
                .setPositionAndOffSet(Gravity.CENTER,0,0);

This is an example of the toast message.

dangertoast

For a Warning Message.

Below is the example of a warningToast. You just need to specify the method warningToast(). By default this toast's background is ORANGE

HuxyApp.warningToast(MainActivity.this, "Slow Internet Connection")
                .setPadding(3)
                .setPositionAndOffSet(Gravity.CENTER,0,0);

This is an example of a warning message.

warningtoast

For a custom Toast Message.

If you want to come up with your custom message, such as changing the Background color or the texColor etc. you have to use the customToast().

Below is the implementation :

 String Bg = "#000000";
        String textColor ="#ffffff";
        HuxyApp.customToast(MainActivity.this, "No internet connection please.",Bg,textColor)
                .setPositionAndOffSet(Gravity.BOTTOM,0,20);

Below is a sample of the output.

customtoast

Setting a custom Font Style For the Toast Message.

This library gives a capability of setting a toast message with a different font style such as Times New Roman, Calibri, Arial etc.

Steps to set up a custom font styled toast message.

  • Step 1.

Initialize HuxyApp and give it an attribute called setFontStyle(Context,FontPath).

HuxyApp.customToast(MainActivity.this, "No internet connection please.",Bg,textColor)
                .setPositionAndOffSet(Gravity.BOTTOM,0,0)
                .setFontStyle(this,R.font.font_name);

  • Step 2.

Download the font of your choice , you can use Google Fonts Site

  • Step 3.

Then create a folder called font inside the res folder. e.g app/src/main/res/font

  • Step 4.

Place any font of your choice , and then run the application. The toast should appear with your font style or type.

Below is the sample of the output.

custom_font

Contribution to the Library.

Feel free to contribute to this Project , by raising Pull Requests (PRs), so that they are reviewed and merged. Contributors could also take the initiative of reviewing other developers PRs.

If you are happy with the library, please donate.

Authors.

huxyapp's People

Contributors

huxaiphaer avatar

Watchers

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