Convert Figma logo to code with AI

code-mc logoloadtoast

Pretty material design toasts with feedback animations

1,533
222
1,533
11

Top Related Projects

6,569

The usual Toast, but with steroids 💪

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

:bread: Make your native android Toasts Tasty

A library that extends the Android toast framework.

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 Beautiful Motion Toast Library for Kotlin Android

Quick Overview

LoadToast is an Android library that provides a simple and customizable loading toast animation. It offers a sleek, material design-inspired loading indicator that can be easily integrated into Android applications to enhance user experience during loading or processing operations.

Pros

  • Easy to implement and customize
  • Smooth, visually appealing animations
  • Follows Material Design principles
  • Lightweight and doesn't require many dependencies

Cons

  • Limited to Android platform
  • May not be suitable for complex loading scenarios
  • Hasn't been updated recently (last commit in 2017)
  • Limited documentation and examples

Code Examples

  1. Basic usage:
LoadToast lt = new LoadToast(this);
lt.setText("Loading...");
lt.show();

// When loading is complete
lt.success();
  1. Customizing appearance:
LoadToast lt = new LoadToast(this);
lt.setTextColor(Color.WHITE);
lt.setBackgroundColor(Color.BLUE);
lt.setProgressColor(Color.GREEN);
lt.show();
  1. Handling errors:
LoadToast lt = new LoadToast(this);
lt.setText("Processing...");
lt.show();

// If an error occurs
lt.error();

Getting Started

To use LoadToast in your Android project, follow these steps:

  1. Add the JitPack repository to your build file:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app's build.gradle file:
dependencies {
    implementation 'com.github.code-mc:loadtoast:1.0.12'
}
  1. Sync your project with Gradle files.

  2. Use LoadToast in your Activity or Fragment:

import net.steamcrafted.loadtoast.LoadToast;

// In your code
LoadToast lt = new LoadToast(this);
lt.setText("Loading...");
lt.show();

Competitor Comparisons

6,569

The usual Toast, but with steroids 💪

Pros of Toasty

  • Offers more customization options for toast appearance and behavior
  • Supports custom icons and fonts for enhanced visual appeal
  • Provides easy-to-use builder pattern for creating toasts

Cons of Toasty

  • Lacks built-in loading animation functionality
  • Does not support progress tracking or success/error states
  • May require more setup code for basic usage compared to LoadToast

Code Comparison

LoadToast:

LoadToast lt = new LoadToast(this).setMessage("Loading").show();
// Perform task
lt.success();

Toasty:

Toasty.Config.getInstance()
    .setTextColor(Color.WHITE)
    .apply();
Toasty.info(context, "Info toast", Toast.LENGTH_SHORT, true).show();

LoadToast focuses on providing a simple loading indicator with success/error states, while Toasty offers more customization options for creating various types of toast messages. LoadToast is better suited for displaying loading progress, whereas Toasty excels in creating visually appealing and customizable toast notifications for different purposes.

[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

  • Offers more customization options for toast appearance
  • Supports icon integration within the toast message
  • Provides easier text styling and positioning

Cons of StyleableToast

  • Limited to toast notifications, lacks progress indicator functionality
  • May require more setup for basic toast messages

Code Comparison

StyleableToast:

StyleableToast.makeText(context, "Hello World!", R.style.myToast).show()

LoadToast:

LoadToast lt = new LoadToast(this).setProgressColor(Color.RED).setText("Sending...").show();
lt.success();

Key Differences

  • StyleableToast focuses on enhancing the visual appearance of toast messages
  • LoadToast provides a progress indicator functionality
  • StyleableToast offers more customization options for text and background
  • LoadToast is better suited for showing loading states and operation results

Use Cases

StyleableToast:

  • Displaying visually appealing notifications
  • Customizing toast appearance to match app theme

LoadToast:

  • Showing progress for ongoing operations
  • Indicating success or failure of tasks

Community and Maintenance

  • Both projects are open-source and available on GitHub
  • StyleableToast has more recent updates and active maintenance
  • LoadToast has a larger number of stars and forks on GitHub

:bread: Make your native android Toasts Tasty

Pros of TastyToast

  • Offers a wider variety of toast styles and animations
  • Includes custom icons and colors for different toast types
  • Provides more customization options for toast appearance

Cons of TastyToast

  • Larger library size due to additional features
  • May require more setup and configuration
  • Potentially higher learning curve for developers

Code Comparison

TastyToast:

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

LoadToast:

LoadToast lt = new LoadToast(this);
lt.setText("Sending...");
lt.show();

TastyToast offers more built-in toast types and styles, while LoadToast focuses on a simpler, progress-oriented approach. TastyToast requires specifying the toast type in the method call, whereas LoadToast uses a more traditional object-oriented approach with separate method calls for setting text and showing the toast.

Both libraries aim to enhance the default Android toast functionality, but they cater to different use cases. TastyToast is more suitable for applications requiring diverse toast styles, while LoadToast is better for scenarios where loading progress feedback is the primary concern.

A library that extends the Android toast framework.

Pros of SuperToasts

  • Offers a wider variety of toast types (SuperActivityToast, SuperCardToast, etc.)
  • Provides more customization options for appearance and behavior
  • Includes built-in animations and progress indicators

Cons of SuperToasts

  • More complex API, potentially steeper learning curve
  • Larger library size due to additional features
  • Less frequent updates and maintenance compared to LoadToast

Code Comparison

LoadToast usage:

LoadToast lt = new LoadToast(context).setMessage("Loading");
lt.show();
// ... perform task
lt.success();

SuperToasts usage:

SuperActivityToast.create(context, "Loading", Style.DURATION_SHORT)
    .setFrame(Style.FRAME_LOLLIPOP)
    .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BLUE))
    .show();

SuperToasts offers more customization options but requires more code for basic usage. LoadToast provides a simpler API for quick implementation of loading indicators with success/error states.

Both libraries serve similar purposes but cater to different needs. LoadToast is ideal for simple loading indicators, while SuperToasts is better suited for applications requiring diverse toast types and extensive customization.

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

  • Offers a wider variety of toast styles and customization options
  • Includes built-in icons for different toast types (success, error, warning, etc.)
  • Allows for easy creation of custom toast layouts

Cons of FancyToast-Android

  • Larger library size due to additional features and resources
  • May require more setup and configuration for basic use cases
  • Potentially higher learning curve for developers new to custom toast implementations

Code Comparison

FancyToast-Android:

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

LoadToast:

LoadToast lt = new LoadToast(this).setProgressColor(Color.RED).setText("Uploading...").setTranslationY(100);
lt.show();

FancyToast-Android provides a more expressive API for creating toasts with predefined styles, while LoadToast focuses on a simpler, progress-oriented approach. FancyToast-Android offers more customization options out of the box, but LoadToast provides a more streamlined experience for loading-specific notifications.

Both libraries aim to enhance the default Android toast functionality, with FancyToast-Android offering a broader range of use cases and LoadToast specializing in progress-related notifications. The choice between the two depends on the specific requirements of your project and the level of customization needed for toast messages.

🌈 A Beautiful Motion Toast Library for Kotlin Android

Pros of MotionToast

  • Offers a wider variety of toast styles and animations
  • Supports Jetpack Compose for modern Android development
  • Provides more customization options for toast appearance

Cons of MotionToast

  • May have a steeper learning curve due to more features
  • Potentially larger library size and impact on app performance
  • Less focused on a single, specific use case compared to LoadToast

Code Comparison

LoadToast:

val lt = LoadToast(this).setProgressColor(Color.RED).setText("Uploading...")
lt.show()
// ... perform task
lt.success()

MotionToast:

MotionToast.createColorToast(this,
    "Upload Complete!",
    "File has been successfully uploaded",
    MotionToastStyle.SUCCESS,
    MotionToast.GRAVITY_BOTTOM,
    MotionToast.LONG_DURATION,
    ResourcesCompat.getFont(this, R.font.helvetica_regular))

LoadToast focuses on a simple progress-to-success flow, while MotionToast offers more complex toast creation with various styles and options. MotionToast provides a more comprehensive solution for different types of notifications, whereas LoadToast is more specialized for loading scenarios.

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

Load Toast Library

The default toasts are ugly and don't really provide much more than a short message. This small library provides a better toast which will give the user feedback by morphing into a checkmark or cross (success and fail). The lifetime of the toast is completely controlled by you.

Demo

Usage

Step 1

Gradle

dependencies {
    compile 'net.steamcrafted:load-toast:1.0.12'
}

Step 2

The API is very simple, create a new toast by providing a context:

LoadToast lt = new LoadToast(context);

Change the displayed text:

lt.setText("Sending Reply...");

If you don't have a message to display, the toast will shrink to only show the circular loader.

Then proceed to show the toast:

lt.show();

When your background thingy is done provide feedback to the user and hide the toast:

// Call this if it was successful
lt.success();

// Or this method if it failed
lt.error();

// Or if no feedback is desired you can simply hide the toast
lt.hide();

To properly position the toast use the following method to adjust the Y offset:

lt.setTranslationY(100); // y offset in pixels

You can also change the colors of the different toast elements:

lt.setTextColor(Color.RED).setBackgroundColor(Color.GREEN).setProgressColor(Color.BLUE);

In some situations a border might be desired for increased visibility, by default it is transparent:

// Change the border color
lt.setBorderColor(int color);

// Change the border width
lt.setBorderWidthPx(int widthPx);
lt.setBorderWidthDp(int widthDp);
lt.setBorderWidthRes(int resourceId);

When displaying a message in a RTL language you can force the text to marquee from left to right instead of the default right to left:

// pass in false for RTL text, true for LTR text
lt.setTextDirection(boolean isLeftToRight);

These can be chained as you can see.

License

Released under the Apache 2.0 License