├── .DS_Store ├── GlideToast.iml ├── GlydeToast.iml ├── LICENSE ├── README.md ├── app-debug.apk ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── jeevandeshmukh │ │ └── glidetoast │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── jeevandeshmukh │ │ │ └── glidetoast │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_android_black_24dp.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── jeevandeshmukh │ └── glidetoast │ └── ExampleUnitTest.java ├── build.gradle ├── gifs ├── bottom.gif ├── center.gif ├── default.gif ├── fail.gif ├── info.gif ├── success.gif ├── top.gif └── warn.gif ├── glidetoastlib ├── .gitignore ├── build.gradle ├── glidetoastlib.iml ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── jeevandeshmukh │ │ └── glidetoastlib │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── jeevandeshmukh │ │ │ └── glidetoastlib │ │ │ └── GlideToast.java │ └── res │ │ ├── anim │ │ ├── dialog_dismiss.xml │ │ └── dialog_show.xml │ │ ├── drawable │ │ ├── default_shape.xml │ │ ├── error_shape.xml │ │ ├── ic_check_black_24dp.xml │ │ ├── ic_clear_black_24dp.xml │ │ ├── ic_info_outline_black_24dp.xml │ │ ├── ic_pan_tool_black_24dp.xml │ │ ├── info_shape.xml │ │ ├── success_shape.xml │ │ └── warning_shape.xml │ │ ├── layout │ │ └── item_toast.xml │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── jeevandeshmukh │ └── glidetoastlib │ └── ExampleUnitTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imjeevandeshmukh/GlideToast/c552deac9c37701d5297037e4b7b86defc2ec4a6/.DS_Store -------------------------------------------------------------------------------- /GlideToast.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /GlydeToast.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jeevan Deshmukh 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 | # GlideToast 2 | An Android library to build flying animated toast message. 3 | 4 | --- 5 | 6 | ## Releases: 7 | 8 | #### Current release: 1.0 9 | 10 | You can see all the library releases [here](https://github.com/imjeevandeshmukh/GlideToast/releases). 11 | 12 | --- 13 | 14 | ## Screenshots 15 |      16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | --- 25 | Download the sample apk [here](https://github.com/imjeevandeshmukh/GlideToast/raw/master/app-debug.apk). 26 | 27 | --- 28 | 29 | ## Usage: 30 | 31 | ### Adding the depencency 32 | 33 | Add this to your root *build.gradle* file: 34 | 35 | ``` 36 | allprojects { 37 | repositories { 38 | ... 39 | maven { url 'https://jitpack.io' } 40 | } 41 | } 42 | ``` 43 | 44 | Now add the dependency to your app build.gradle file: 45 | 46 | ``` 47 | implementation 'com.github.imjeevandeshmukh:GlideToast:1.0' 48 | 49 | ``` 50 | 51 | ### Creating the GlideToast with Java 52 | 53 | Here is a complete snippet of it usage: 54 | 55 | ```java 56 | ### USE CASE 1:Simple GlideToast; 57 | 58 | 1st parameter = Activity 59 | 2nd parameter = String 60 | 3rd parameter = int i.e., duration 61 | 62 | ### SAMPLE CODE: 63 | 64 | new GlideToast.makeToast(MainActivity.this,"Some random text here", GlideToast.LENGTHLONG).show(); 65 | 66 | ### USE CASE 2:Style GlideToast; 67 | 68 | 1st parameter = Activity 69 | 2nd parameter = String 70 | 3rd parameter = int i.e., duration 71 | 4th parameter = string style i.e., 72 | DEFAULTTOAST 73 | SUCCESSTOAST 74 | FAILTOAST 75 | WARNINGTOAST 76 | INFOTOAST 77 | CUSTOMTOAST(When you pass in CUSTOMTOAST,you must pass in icon and background color using use case 4 or case 4 construtor) 78 | 79 | ### SAMPLE CODE: 80 | 81 | 82 | new GlideToast.makeToast(MainActivity.this,"Some random text here", GlideToast.LENGTHLONG,GlideToast.SUCCESSTOAST).show(); 83 | 84 | 85 | ### USE CASE 3:Set Gravity to GlideToast; 86 | 87 | 1st parameter = Activity 88 | 2nd parameter = String 89 | 3rd parameter = int i.e., duration 90 | 4th parameter = String style i.e.,6 Options to select from. (default is DEFAULTTOAST) 91 | 1.DEFAULTTOAST 92 | 2.SUCCESSTOAST 93 | 3.FAILTOAST 94 | 4.WARNINGTOAST 95 | 5.INFOTOAST 96 | 6.CUSTOMTOAST(When you pass in CUSTOMTOAST,you must pass in icon and background color using use case 4 or case 4 construtor) 97 | 5th parameter = int gravity i.e., 98 | 1.TOP 99 | 2.BOTTOM 100 | 3.CENTER 101 | 102 | ### SAMPLE CODE: 103 | 104 | 105 | new GlideToast.makeToast(MainActivity.this,"Some random text here",GlideToast.LENGTHLONG,GlideToast.SUCCESSTOAST,GlideToast.TOP).show(); 106 | 107 | 108 | ### USE CASE 4:Custom background color and icon to GlideTOAST; 109 | 110 | 1st parameter = Activity 111 | 2nd parameter = String 112 | 3rd parameter = int i.e., duration 113 | 4th parameter = String style i.e.,6 Options to select from. (default is DEFAULTTOAST) 114 | 1.DEFAULTTOAST 115 | 2.SUCCESSTOAST 116 | 3.FAILTOAST 117 | 4.WARNINGTOAST 118 | 5.INFOTOAST 119 | 6.CUSTOMTOAST(When you pass in CUSTOMTOAST,you must pass in icon and background color using this construtor) 120 | 5th parameter = int gravity i.e., 121 | 1.TOP 122 | 2.BOTTOM 123 | 3.CENTER 124 | 6th parameter = int icon i.e.,drawable icon 125 | 7th parameter = String color i.e.,pass in hex color code in a string. 126 | 127 | ### SAMPLE CODE: 128 | 129 | 130 | new GlideToast.makeToast(MainActivity.this,"Some random text here",GlideToast.LENGTHLONG,GlideToast.SUCCESSTOAST,GlideToast.TOP,R.drawable.someicon,"#ffffff").show(); 131 | 132 | 133 | ``` 134 | 135 | ## License 136 | 137 | ``` 138 | MIT License 139 | 140 | Copyright (c) 2018 imjeevandeshmukh 141 | 142 | Permission is hereby granted, free of charge, to any person obtaining a copy 143 | of this software and associated documentation files (the "Software"), to deal 144 | in the Software without restriction, including without limitation the rights 145 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 146 | copies of the Software, and to permit persons to whom the Software is 147 | furnished to do so, subject to the following conditions: 148 | 149 | The above copyright notice and this permission notice shall be included in all 150 | copies or substantial portions of the Software. 151 | 152 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 153 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 154 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 155 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 156 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 157 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 158 | SOFTWARE. 159 | ``` 160 | 161 | -------------------------------------------------------------------------------- /app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imjeevandeshmukh/GlideToast/c552deac9c37701d5297037e4b7b86defc2ec4a6/app-debug.apk -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.jeevan.glidetoast" 7 | minSdkVersion 15 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(include: ['*.jar'], dir: 'libs') 23 | implementation 'com.android.support:appcompat-v7:27.1.1' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.2' 25 | testImplementation 'junit:junit:4.12' 26 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 28 | implementation project(':glidetoastlib') 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/jeevandeshmukh/glidetoast/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.jeevandeshmukh.glidetoast; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.jeevan.glydetoast", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/jeevandeshmukh/glidetoast/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jeevandeshmukh.glidetoast; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | 8 | import com.jeevandeshmukh.glidetoastlib.GlideToast; 9 | 10 | public class MainActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_main); 16 | Button bt = (Button)findViewById(R.id.button); 17 | bt.setOnClickListener(new View.OnClickListener() { 18 | @Override 19 | public void onClick(View view) { 20 | 21 | new GlideToast.makeToast(MainActivity.this,"Some random here", GlideToast.LENGTHQUICK, GlideToast.CUSTOMTOAST, GlideToast.TOP,R.drawable.ic_android_black_24dp, "#EC407A").show(); 22 | 23 | 24 | 25 | 26 | } 27 | }); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_android_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 |