├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── es
│ │ └── dmoral
│ │ └── toastysample
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── PCap Terminal.otf
│ ├── java
│ │ └── es
│ │ │ └── dmoral
│ │ │ └── toastysample
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── drawable-hdpi
│ │ └── ic_pets_white_48dp.png
│ │ ├── drawable-mdpi
│ │ └── ic_pets_white_48dp.png
│ │ ├── drawable-xhdpi
│ │ └── ic_pets_white_48dp.png
│ │ ├── drawable-xxhdpi
│ │ └── ic_pets_white_48dp.png
│ │ ├── drawable-xxxhdpi
│ │ └── ic_pets_white_48dp.png
│ │ ├── drawable
│ │ └── laptop512.png
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── es
│ └── dmoral
│ └── toastysample
│ └── ExampleUnitTest.java
├── art
├── collage.png
├── scr_1.png
├── scr_2.png
├── scr_3.png
├── scr_4.png
├── scr_5.png
├── scr_6.png
├── scr_7.png
├── scr_8.png
└── web_hi_res_512.png
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── toasty
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── es
│ └── dmoral
│ └── toasty
│ └── ExampleInstrumentedTest.java
├── main
├── AndroidManifest.xml
├── java
│ └── es
│ │ └── dmoral
│ │ └── toasty
│ │ ├── Toasty.java
│ │ └── ToastyUtils.java
└── res
│ ├── drawable-hdpi
│ └── toast_frame.9.png
│ ├── drawable-ldpi
│ └── toast_frame.9.png
│ ├── drawable-mdpi
│ └── toast_frame.9.png
│ ├── drawable-xhdpi
│ └── toast_frame.9.png
│ ├── drawable-xxhdpi
│ └── toast_frame.9.png
│ ├── drawable
│ ├── ic_check_white_24dp.xml
│ ├── ic_clear_white_24dp.xml
│ ├── ic_error_outline_white_24dp.xml
│ └── ic_info_outline_white_24dp.xml
│ ├── layout
│ └── toast_layout.xml
│ └── values
│ ├── colors.xml
│ └── strings.xml
└── test
└── java
└── es
└── dmoral
└── toasty
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the ART/Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | out/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # Android Studio Navigation editor temp files
30 | .navigation/
31 |
32 | # Android Studio captures folder
33 | captures/
34 |
35 | # Intellij
36 | *.iml
37 | .idea/workspace.xml
38 |
39 | # Keystore files
40 | *.jks
41 | .idea
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://ko-fi.com/R6R21LO82)
2 |
3 | # Toasty
4 | [](https://android-arsenal.com/api?level=14) [](https://jitpack.io/#GrenderG/Toasty) [](https://android-arsenal.com/details/1/5102)
5 |
6 |
7 |
8 |
9 |
10 | The usual Toast, but with steroids.
11 |
12 | ## Prerequisites
13 |
14 | Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
15 |
16 | ```gradle
17 | allprojects {
18 | repositories {
19 | ...
20 | maven { url "https://jitpack.io" }
21 | }
22 | }
23 | ```
24 |
25 | ## Dependency
26 |
27 | Add this to your module's `build.gradle` file (make sure the version matches the JitPack badge above):
28 |
29 | ```gradle
30 | dependencies {
31 | ...
32 | implementation 'com.github.GrenderG:Toasty:1.5.2'
33 | }
34 | ```
35 |
36 | ## Configuration
37 |
38 | This step is optional, but if you want you can configure some Toasty parameters. Place this anywhere in your app:
39 |
40 | ```java
41 | Toasty.Config.getInstance()
42 | .tintIcon(boolean tintIcon) // optional (apply textColor also to the icon)
43 | .setToastTypeface(@NonNull Typeface typeface) // optional
44 | .setTextSize(int sizeInSp) // optional
45 | .allowQueue(boolean allowQueue) // optional (prevents several Toastys from queuing)
46 | .setGravity(int gravity, int xOffset, int yOffset) // optional (set toast gravity, offsets are optional)
47 | .supportDarkTheme(boolean supportDarkTheme) // optional (whether to support dark theme or not)
48 | .setRTL(boolean isRTL) // optional (icon is on the right)
49 | .apply(); // required
50 | ```
51 |
52 | You can reset the configuration by using `reset()` method:
53 |
54 | ```java
55 | Toasty.Config.reset();
56 | ```
57 |
58 | ## Usage
59 |
60 | Each method always returns a `Toast` object, so you can customize the Toast much more. **DON'T FORGET THE `show()` METHOD!**
61 |
62 | To display an error Toast:
63 |
64 | ``` java
65 | Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();
66 | ```
67 | To display a success Toast:
68 |
69 | ``` java
70 | Toasty.success(yourContext, "Success!", Toast.LENGTH_SHORT, true).show();
71 | ```
72 | To display an info Toast:
73 |
74 | ``` java
75 | Toasty.info(yourContext, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();
76 | ```
77 | To display a warning Toast:
78 |
79 | ``` java
80 | Toasty.warning(yourContext, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();
81 | ```
82 | To display the usual Toast:
83 |
84 | ``` java
85 | Toasty.normal(yourContext, "Normal toast w/o icon").show();
86 | ```
87 | To display the usual Toast with icon:
88 |
89 | ``` java
90 | Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();
91 | ```
92 |
93 | You can also create your custom Toasts with the `custom()` method:
94 | ``` java
95 | Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, tintColor, duration, withIcon,
96 | shouldTint).show();
97 | ```
98 | ### Extra
99 | [You can pass formatted text to Toasty!](https://github.com/GrenderG/Toasty/blob/master/app/src/main/java/es/dmoral/toastysample/MainActivity.java#L98-L107)
100 |
101 | **There are variants of each method, feel free to explore this library.**
102 |
103 | ## Screenshots
104 |
105 | **Please click the image below to enlarge.**
106 |
107 |
108 |
109 | ## Third Party Bindings
110 |
111 | ### React Native
112 | You may now use this library with [React Native](https://github.com/facebook/react-native) via this [module](https://github.com/prscX/react-native-toasty).
113 |
114 | Apps using Toasty
115 | --
116 |
117 | Want to be here? Open an `issue` or make a `pull request`.
118 |
119 |
185 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 |
6 | defaultConfig {
7 | applicationId "es.dmoral.toastysample"
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(include: ['*.jar'], dir: 'libs')
24 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | implementation "androidx.appcompat:appcompat:$supportLibVersion"
28 | testImplementation 'junit:junit:4.12'
29 | implementation project(':toasty')
30 | }
31 |
--------------------------------------------------------------------------------
/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 /home/grender/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 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/es/dmoral/toastysample/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package es.dmoral.toastysample;
2 |
3 | import android.content.Context;
4 | import androidx.test.InstrumentationRegistry;
5 | import androidx.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.assertEquals;
11 |
12 | /**
13 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("es.dmoral.toastysample", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/assets/PCap Terminal.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/assets/PCap Terminal.otf
--------------------------------------------------------------------------------
/app/src/main/java/es/dmoral/toastysample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package es.dmoral.toastysample;
2 |
3 | import android.graphics.Typeface;
4 | import android.graphics.drawable.Drawable;
5 | import android.os.Bundle;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import android.text.Spannable;
8 | import android.text.SpannableStringBuilder;
9 | import android.text.style.StyleSpan;
10 | import android.view.View;
11 |
12 | import es.dmoral.toasty.Toasty;
13 |
14 | import static android.graphics.Typeface.BOLD_ITALIC;
15 |
16 | /**
17 | * This file is part of Toasty.
18 | *
19 | * Toasty is free software: you can redistribute it and/or modify
20 | * it under the terms of the GNU Lesser General Public License as published by
21 | * the Free Software Foundation, either version 3 of the License, or
22 | * (at your option) any later version.
23 | *
24 | * Toasty is distributed in the hope that it will be useful,
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 | * GNU General Public License for more details.
28 | *
29 | * You should have received a copy of the GNU General Public License
30 | * along with Toasty. If not, see .
31 | */
32 |
33 | public class MainActivity extends AppCompatActivity {
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_main);
38 |
39 | findViewById(R.id.button_error_toast).setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View view) {
42 | Toasty.error(MainActivity.this, R.string.error_message, Toasty.LENGTH_SHORT, true).show();
43 | }
44 | });
45 | findViewById(R.id.button_success_toast).setOnClickListener(new View.OnClickListener() {
46 | @Override
47 | public void onClick(View view) {
48 | Toasty.success(MainActivity.this, R.string.success_message, Toasty.LENGTH_SHORT, true).show();
49 | }
50 | });
51 | findViewById(R.id.button_info_toast).setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View view) {
54 | Toasty.info(MainActivity.this, R.string.info_message, Toasty.LENGTH_SHORT, true).show();
55 | }
56 | });
57 | findViewById(R.id.button_warning_toast).setOnClickListener(new View.OnClickListener() {
58 | @Override
59 | public void onClick(View view) {
60 | Toasty.warning(MainActivity.this, R.string.warning_message, Toasty.LENGTH_SHORT, true).show();
61 | }
62 | });
63 | findViewById(R.id.button_normal_toast_wo_icon).setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View view) {
66 | Toasty.normal(MainActivity.this, R.string.normal_message_without_icon).show();
67 | }
68 | });
69 | findViewById(R.id.button_normal_toast_w_icon).setOnClickListener(new View.OnClickListener() {
70 | @Override
71 | public void onClick(View view) {
72 | Drawable icon = getResources().getDrawable(R.drawable.ic_pets_white_48dp);
73 | Toasty.normal(MainActivity.this, R.string.normal_message_with_icon, icon).show();
74 | }
75 | });
76 | findViewById(R.id.button_info_toast_with_formatting).setOnClickListener(new View.OnClickListener() {
77 | @Override
78 | public void onClick(View view) {
79 | Toasty.info(MainActivity.this, getFormattedMessage()).show();
80 | }
81 | });
82 | findViewById(R.id.button_custom_config).setOnClickListener(new View.OnClickListener() {
83 | @Override
84 | public void onClick(View view) {
85 | Toasty.Config.getInstance()
86 | .setToastTypeface(Typeface.createFromAsset(getAssets(), "PCap Terminal.otf"))
87 | .allowQueue(false)
88 | .apply();
89 | Toasty.custom(MainActivity.this, R.string.custom_message, getResources().getDrawable(R.drawable.laptop512),
90 | android.R.color.black, android.R.color.holo_green_light, Toasty.LENGTH_SHORT, true, true).show();
91 | Toasty.Config.reset(); // Use this if you want to use the configuration above only once
92 | }
93 | });
94 | }
95 |
96 | private CharSequence getFormattedMessage() {
97 | final String prefix = "Formatted ";
98 | final String highlight = "bold italic";
99 | final String suffix = " text";
100 | SpannableStringBuilder ssb = new SpannableStringBuilder(prefix).append(highlight).append(suffix);
101 | int prefixLen = prefix.length();
102 | ssb.setSpan(new StyleSpan(BOLD_ITALIC),
103 | prefixLen, prefixLen + highlight.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
104 | return ssb;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_pets_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable-hdpi/ic_pets_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_pets_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable-mdpi/ic_pets_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_pets_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable-xhdpi/ic_pets_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_pets_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable-xxhdpi/ic_pets_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_pets_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable-xxxhdpi/ic_pets_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/laptop512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/drawable/laptop512.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
27 |
28 |
38 |
39 |
49 |
50 |
60 |
61 |
71 |
72 |
82 |
83 |
93 |
94 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Toasty Sample
3 | NORMAL TOAST (WITH ICON)
4 | NORMAL TOAST (WITHOUT ICON)
5 | WARNING TOAST
6 | INFO TOAST
7 | INFO TOAST WITH FORMATTING
8 | ERROR TOAST
9 | SUCCESS TOAST
10 | CUSTOM CONFIGURATION
11 |
12 | This is an error toast.
13 | Success!
14 | Here is some info for you.
15 | Beware of the dog.
16 | Normal toast w/o icon
17 | Normal toast w/ icon
18 | sudo kill -9 everyone
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/es/dmoral/toastysample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package es.dmoral.toastysample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.assertEquals;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/art/collage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/collage.png
--------------------------------------------------------------------------------
/art/scr_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_1.png
--------------------------------------------------------------------------------
/art/scr_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_2.png
--------------------------------------------------------------------------------
/art/scr_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_3.png
--------------------------------------------------------------------------------
/art/scr_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_4.png
--------------------------------------------------------------------------------
/art/scr_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_5.png
--------------------------------------------------------------------------------
/art/scr_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_6.png
--------------------------------------------------------------------------------
/art/scr_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_7.png
--------------------------------------------------------------------------------
/art/scr_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/scr_8.png
--------------------------------------------------------------------------------
/art/web_hi_res_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/art/web_hi_res_512.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.3'
10 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | jcenter()
20 | google()
21 | }
22 | }
23 |
24 | ext {
25 | compileSdkVersion = 31
26 | minSdkVersion = 14
27 | targetSdkVersion = compileSdkVersion
28 |
29 | supportLibVersion = '1.3.1'
30 |
31 | versionCode = 152
32 | versionName = '1.5.2'
33 | }
34 |
35 | task clean(type: Delete) {
36 | delete rootProject.buildDir
37 | }
38 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # POM
2 | POM_URL=https://github.com/GrenderG/Toasty
3 |
4 | POM_SCM_URL=https://github.com/GrenderG/Toasty
5 | POM_SCM_CONNECTION=scm:git@github.com:GrenderG/Toasty.git
6 | POM_SCM_DEV_CONNECTION=scm:git@github.com:GrenderG/Toasty.git
7 | POM_SCM_URL_ISSUES=https://github.com/GrenderG/Toasty/issues
8 |
9 | POM_GITHUB_REPO=GrenderG/Toasty
10 | POM_GITHUB_README=README.md
11 |
12 | POM_LICENCE_NAME=The GNU Lesser General Public License, Version 3.0
13 | POM_LICENCE_URL=http://www.gnu.org/licenses/lgpl-3.0.html
14 | POM_LICENCE_DIST=repo
15 | POM_DEVELOPER_ID=GrenderG
16 | POM_DEVELOPER_NAME=GrenderG
17 |
18 | # Project-wide Gradle settings.
19 |
20 | # IDE (e.g. Android Studio) users:
21 | # Gradle settings configured through the IDE *will override*
22 | # any settings specified in this file.
23 |
24 | # For more details on how to configure your build environment visit
25 | # http://www.gradle.org/docs/current/userguide/build_environment.html
26 |
27 | # Specifies the JVM arguments used for the daemon process.
28 | # The setting is particularly useful for tweaking memory settings.
29 | android.enableJetifier=true
30 | android.useAndroidX=true
31 | org.gradle.jvmargs=-Xmx1536m
32 |
33 | # When configured, Gradle will run in incubating parallel mode.
34 | # This option should only be used with decoupled projects. More details, visit
35 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
36 | # org.gradle.parallel=true
37 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GrenderG/Toasty/1d9a280da12a1182d4d132a038122d4817348d62/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 05 22:23:56 CEST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':toasty'
2 |
--------------------------------------------------------------------------------
/toasty/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/toasty/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | group = 'com.github.GrenderG'
4 | version = rootProject.ext.versionName
5 |
6 | android {
7 | compileSdkVersion rootProject.ext.compileSdkVersion
8 |
9 | defaultConfig {
10 | minSdkVersion rootProject.ext.minSdkVersion
11 | targetSdkVersion rootProject.ext.targetSdkVersion
12 | versionCode rootProject.ext.versionCode
13 | versionName rootProject.ext.versionName
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation "androidx.appcompat:appcompat:$supportLibVersion"
29 | }
30 |
--------------------------------------------------------------------------------
/toasty/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 /home/grender/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 |
--------------------------------------------------------------------------------
/toasty/src/androidTest/java/es/dmoral/toasty/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package es.dmoral.toasty;
2 |
3 | import android.content.Context;
4 | import androidx.test.InstrumentationRegistry;
5 | import androidx.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 | * Instrumentation 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() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("es.dmoral.toasty.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/toasty/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/toasty/src/main/java/es/dmoral/toasty/Toasty.java:
--------------------------------------------------------------------------------
1 | package es.dmoral.toasty;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.res.Configuration;
6 | import android.graphics.Typeface;
7 | import android.graphics.drawable.Drawable;
8 | import androidx.annotation.CheckResult;
9 | import androidx.annotation.ColorInt;
10 | import androidx.annotation.ColorRes;
11 | import androidx.annotation.DrawableRes;
12 | import androidx.annotation.NonNull;
13 | import androidx.annotation.StringRes;
14 | import android.os.Build;
15 | import android.util.TypedValue;
16 | import android.view.LayoutInflater;
17 | import android.view.View;
18 | import android.widget.ImageView;
19 | import android.widget.LinearLayout;
20 | import android.widget.TextView;
21 | import android.widget.Toast;
22 |
23 | /**
24 | * This file is part of Toasty.
25 | *
26 | * Toasty is free software: you can redistribute it and/or modify
27 | * it under the terms of the GNU Lesser General Public License as published by
28 | * the Free Software Foundation, either version 3 of the License, or
29 | * (at your option) any later version.
30 | *
31 | * Toasty is distributed in the hope that it will be useful,
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 | * GNU General Public License for more details.
35 | *