Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.greycellofp:tastytoast

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.greycellofp:tastytoast

A simple, lightweight alternative to android's system wide toast.

  • 1.0.2
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

TastyToast

Note: Still WIP!

Contextual toasts that stick to an activity. There are three available flavors of toasts (which you could extend and customize as well) - Alert Toast, Confirmation Toast & Message Toasts.

##Gradle Dependency

Add this in your project app's build.gradle

dependencies{
    compile 'com.greycellofp:tastytoast:1.0.1'
}

Version

1.0.1

#Quick Usage

  • Message Toasts
    TastyToast.makeText(YourActivty.this, "your message text", TastyToast.STYLE_MESSAGE).show();

message demo

  • Alert Toasts
TastyToast.makeText(YourActivity.this, "some alert text", TastyToast.STYLE_ALERT).show();

alert demo

  • Confirmation Toasts
TastyToast.makeText(YourActivity.this, "some confirmation text", TastyToast.STYLE_CONFIRM).show();

confirmation demo

  • Variable duration
//sets a variable duration based on the text size with time boundaries at 3sec <= t <= 10sec
TastyToast.makeText(YourActivity.this, "a long text ~ more than 120 characters", TastyToast.STYLE_MESSAGE).enableVariableDuration().show();
  • Swipe to dismiss
//uses Jake Wharton's SwipeDismissTouchListener
TastyToast.makeText(YourActivity.this, "Some text", TastyToast.STYLE_MESSAGE).enableSwipeDismiss().show();
  • Styling

You can customise your TastyToast by providing a Style input, or you can provide your own custom views like so

makeText(Activity context, CharSequence text, Style style, int layoutId)
makeText(Activity context, CharSequence text, Style style, View customView)
  • Text Size
float textSize = 20; //you should of course consider converting to sp
TastyToast.makeText(YourActivity.this, "Some text", TastyToast.STYLE_MESSAGE, textSize).show();

Development

PRs highly appreciated

License

Public License

FAQs

Package last updated on 07 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc