Convert Figma logo to code with AI

yadav-rahul logoTastyToast

:bread: Make your native android Toasts Tasty

2,040
355
2,040
19

Top Related Projects

You can easily add awesome animated context menu to your app.

[Moved to MavenCentral] An Android library that takes the standard toast to the next level with many styling options. Works on all Android versions.

6,569

The usual Toast, but with steroids 💪

Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

A library that extends the Android toast framework.

🌈 A Beautiful Motion Toast Library for Kotlin Android

Quick Overview

TastyToast is an Android library that provides custom toast notifications with enhanced styling and animations. It offers a more visually appealing alternative to the standard Android Toast, allowing developers to create eye-catching notifications with various styles and icons.

Pros

  • Easy to implement and integrate into existing Android projects
  • Offers multiple pre-defined styles (success, warning, error, info, default, and confusing)
  • Supports custom animations and durations
  • Lightweight and doesn't require many dependencies

Cons

  • Limited customization options beyond the pre-defined styles
  • May not be fully compatible with all Android versions or custom ROMs
  • Lacks support for more advanced features like action buttons or swipe-to-dismiss

Code Examples

  1. Creating a success toast:
TastyToast.makeText(getApplicationContext(), "Success!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);
  1. Displaying an error toast:
TastyToast.makeText(getApplicationContext(), "Error occurred", TastyToast.LENGTH_SHORT, TastyToast.ERROR);
  1. Showing an info toast with a custom duration:
TastyToast.makeText(getApplicationContext(), "Information", 5000, TastyToast.INFO);

Getting Started

  1. Add the JitPack repository to your project's build.gradle file:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app's build.gradle file:
dependencies {
    implementation 'com.github.yadav-rahul:TastyToast:0.1.1'
}
  1. Use TastyToast in your Android activity or fragment:
import com.sdsmdg.tastytoast.TastyToast;

// ...

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

Competitor Comparisons

You can easily add awesome animated context menu to your app.

Pros of Context-Menu.Android

  • More complex and feature-rich, offering a customizable circular context menu
  • Provides smooth animations and transitions for menu items
  • Supports both icon and text-based menu items

Cons of Context-Menu.Android

  • Steeper learning curve due to its complexity
  • May require more setup and configuration
  • Potentially higher performance overhead for complex menus

Code Comparison

TastyToast:

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.WARNING);

Context-Menu.Android:

MenuObject close = new MenuObject("Close");
close.setResource(R.drawable.icn_close);

MenuParams menuParams = new MenuParams();
menuParams.setActionBarSize((int) getResources().getDimension(R.dimen.tool_bar_height));
menuParams.setMenuObjects(getMenuObjects());
menuParams.setClosableOutside(false);
mMenuDialogFragment = ContextMenuDialogFragment.newInstance(menuParams);

Summary

TastyToast is a simpler library focused on creating stylish toast notifications, while Context-Menu.Android offers a more complex and customizable circular context menu. TastyToast is easier to implement but has limited functionality, whereas Context-Menu.Android provides more features but requires more setup. The choice between the two depends on the specific needs of your project and the desired user interface.

[Moved to MavenCentral] An Android library that takes the standard toast to the next level with many styling options. Works on all Android versions.

Pros of StyleableToast

  • More customization options, including custom fonts and icons
  • Supports both Kotlin and Java
  • Actively maintained with recent updates

Cons of StyleableToast

  • Slightly more complex implementation due to additional features
  • Larger library size compared to TastyToast

Code Comparison

TastyToast:

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

StyleableToast:

StyleableToast.Builder(context)
    .text("Hello World!")
    .textColor(Color.WHITE)
    .backgroundColor(Color.BLUE)
    .show()

Summary

StyleableToast offers more customization options and supports both Kotlin and Java, making it a versatile choice for developers who want fine-grained control over their toast notifications. It's actively maintained, ensuring compatibility with the latest Android versions.

TastyToast, on the other hand, provides a simpler implementation with predefined styles, which can be beneficial for quick integration and smaller project sizes. However, it offers less customization and hasn't been updated recently.

Both libraries serve the purpose of creating custom toast notifications, but StyleableToast is more feature-rich and flexible, while TastyToast focuses on simplicity and ease of use.

6,569

The usual Toast, but with steroids 💪

Pros of Toasty

  • More customization options, including icon support and tint color
  • Larger community and more frequent updates
  • Better documentation and usage examples

Cons of Toasty

  • Slightly larger library size
  • Requires more setup code for basic usage

Code Comparison

TastyToast:

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

Toasty:

Toasty.Config.getInstance()
    .setTextColor(Color.WHITE)
    .apply();
Toasty.success(getApplicationContext(), "Hello World!", Toast.LENGTH_SHORT, true).show();

Both libraries offer enhanced toast notifications for Android, but Toasty provides more customization options and has a larger community. TastyToast has a simpler API for basic usage, while Toasty requires more setup but offers greater flexibility. Toasty supports custom icons and tint colors, making it more versatile for complex UI designs. However, this comes at the cost of a slightly larger library size. TastyToast is more lightweight and straightforward, which may be preferable for simpler projects. Ultimately, the choice between the two depends on the specific requirements of your Android application and the level of customization you need for your toast notifications.

Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

Pros of FancyToast-Android

  • More customization options, including custom icons and fonts
  • Supports both Kotlin and Java
  • Includes a builder pattern for easier toast creation

Cons of FancyToast-Android

  • Larger library size due to additional features
  • Slightly more complex implementation compared to TastyToast

Code Comparison

TastyToast:

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

FancyToast-Android:

FancyToast.makeText(this, "Hello World!", FancyToast.LENGTH_LONG, FancyToast.SUCCESS, false).show()

Both libraries offer similar basic functionality for creating custom toasts. However, FancyToast-Android provides more advanced features and customization options. It supports both Kotlin and Java, making it more versatile for different Android development environments.

TastyToast is simpler to implement and has a smaller library size, which may be preferable for projects with limited resources or those requiring only basic toast functionality.

FancyToast-Android's builder pattern allows for more flexible toast creation, but it may require slightly more code for basic use cases. The choice between the two libraries ultimately depends on the specific needs of the project and the desired level of customization for toast messages.

A library that extends the Android toast framework.

Pros of SuperToasts

  • More customization options for toast appearance and behavior
  • Supports multiple toast types (success, error, info, warning)
  • Includes additional features like progress bars and buttons in toasts

Cons of SuperToasts

  • Larger library size due to more features
  • Slightly more complex implementation for basic use cases
  • Less frequent updates and maintenance

Code Comparison

TastyToast:

TastyToast.makeText(getApplicationContext(), "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

SuperToasts:

SuperToast.create(this, "Hello World!", Style.DURATION_LONG)
    .setStyle(Style.GREEN)
    .setIcon(R.drawable.icon_success, IconPosition.LEFT)
    .show();

Both libraries offer simple ways to create and display toasts, but SuperToasts provides more customization options in a single method chain. TastyToast has a more straightforward API for basic use cases, while SuperToasts allows for more detailed customization of appearance and behavior.

TastyToast is lighter and easier to implement for simple toast messages, while SuperToasts offers more advanced features at the cost of a slightly more complex API and larger library size.

🌈 A Beautiful Motion Toast Library for Kotlin Android

Pros of MotionToast

  • More customizable with additional toast types and styles
  • Supports Jetpack Compose for modern Android development
  • Actively maintained with recent updates and contributions

Cons of MotionToast

  • Larger library size due to additional features and dependencies
  • Steeper learning curve for developers new to Jetpack Compose
  • May require more setup and configuration compared to TastyToast

Code Comparison

TastyToast:

TastyToast.makeText(context, "Hello World!", TastyToast.LENGTH_LONG, TastyToast.SUCCESS);

MotionToast:

MotionToast.createColorToast(this,
    "Hurray success 😍",
    "Upload Completed successfully!",
    MotionToastStyle.SUCCESS,
    MotionToast.GRAVITY_BOTTOM,
    MotionToast.LONG_DURATION,
    ResourcesCompat.getFont(this, R.font.helvetica_regular))

The code comparison shows that MotionToast offers more customization options, including custom fonts and positioning, while TastyToast provides a simpler API with fewer parameters. MotionToast's implementation is more verbose but allows for greater flexibility in toast appearance and behavior.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

TastyToast

platform API License Android Arsenal

Make your native android toast look beautiful.

Preview

gif gif gif gif gif gif

About

Refer Here Wiki

Grab the above demo app from here :

Get it on Google Play

Dependency

Add dependency in your app module

dependencies {
	compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
}

Usage

Java

TastyToast.makeText(getApplicationContext(), "Hello World !", TastyToast.LENGTH_LONG, TastyToast.WARNING);

Last parameter here is the type of toast you want to show.

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 2016 Rahul Yadav

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.