├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── dvoiss │ │ └── literallytoastdemo │ │ └── MainActivity.kt │ └── res │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── ic_launcher_background.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lit_toast.gif ├── literallytoast ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── fonts │ │ └── yummy_bread.ttf │ ├── java │ └── com │ │ └── dvoiss │ │ └── literallytoast │ │ ├── LitToast.kt │ │ ├── ToastSpringListener.kt │ │ └── ToastUtils.kt │ └── res │ ├── drawable-hdpi │ └── toast.png │ ├── drawable-ldpi │ └── toast.png │ ├── drawable-mdpi │ └── toast.png │ ├── drawable-xhdpi │ └── toast.png │ ├── drawable-xxhdpi │ └── toast.png │ ├── drawable │ └── toast.png │ ├── layout │ └── literallytoast.xml │ ├── raw │ └── toaster.wav │ └── values │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | toast.psd 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 david 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Literally Toast 2 | 3 | 🍞 A toast library for Android. 4 | 5 | [![](https://jitpack.io/v/dvoiss/literallytoast.svg)](https://jitpack.io/#dvoiss/literallytoast) 6 | 7 | 8 | 9 | ### Usage: 10 | 11 | 🔥 Use the `LitToast` to get lit and show your users a **proper toast**. 12 | 13 | ```java 14 | LitToast.create(context, "My special toast...", 1000) 15 | .setPlayToasterSound(true) 16 | .show(); 17 | ``` 18 | 19 | Add the jitpack repo to your root `build.gradle`: 20 | 21 | ``` 22 | allprojects { 23 | repositories { 24 | maven { url 'https://jitpack.io' } 25 | } 26 | } 27 | ``` 28 | 29 | Add the dependency in your app `build.gradle`: 30 | 31 | ``` 32 | compile 'com.github.dvoiss:literallytoast:1.0.0' 33 | ``` 34 | 35 | ### Features: 36 | 37 | * 🍞🔥 Show a toast, with the message burned into the toast. 38 | * 🔊 Play a toaster sound 39 | * 👍 Feature request? Create an issue or pull request! 40 | 41 | ### Road-map: 42 | 43 | * 🙏 Variation with Jesus image on toast 44 | * 🥖 🥐 French toast? Different types of toast (🥑 Avocado?) 45 | * 😢 There is no toast queue to set up multiple toasts. A toaster class (queue) should be written, the queue should only allow for two toasts because most toasters only handle that (unless you've got 💰) 46 | 47 | Resources used: 48 | 49 | * [Toast image](https://commons.wikimedia.org/wiki/File:Toast-2.jpg) from wikimedia 50 | * [Bread font](https://www.dafont.com/bread.font) from dafont.com 51 | * [Toaster sound](https://freesound.org/people/Adam_N/sounds/164557/) from freesound.org 52 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | android { 6 | compileSdkVersion cCompileSdkVersion 7 | buildToolsVersion cBuildToolsVersion 8 | 9 | defaultConfig { 10 | applicationId "com.dvoiss.literallytoastdemo" 11 | minSdkVersion cMinSdkVersion 12 | targetSdkVersion cTargetSdkVersion 13 | versionCode cVersionCode 14 | versionName cVersionName 15 | 16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | } 26 | 27 | dependencies { 28 | compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 29 | 30 | compile 'com.android.support:appcompat-v7:26.1.0' 31 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 32 | 33 | compile project(':literallytoast') 34 | } 35 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/davidvoiss/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvoiss/literallytoastdemo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dvoiss.literallytoastdemo 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import android.view.View 6 | import com.dvoiss.literallytoast.LitToast 7 | 8 | class MainActivity : AppCompatActivity() { 9 | 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.activity_main) 13 | findViewById(R.id.show_toast_button) 14 | .setOnClickListener { 15 | LitToast.create(this, R.string.toast_demo_text, 1000) 16 | .setPlayToasterSound(true) 17 | .show() 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |