├── .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 | [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R21LO82) 2 | 3 | # Toasty 4 | [![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14) [![](https://jitpack.io/v/GrenderG/Toasty.svg)](https://jitpack.io/#GrenderG/Toasty) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Toasty-brightgreen.svg?style=flat)](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 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |
ColorHub - Color Palette
Daily – News flipped around
Oz! Comic Reader
Impactor Unroot
Fusemounter
BlueWords
Photo Map - Photo and Video Gallery
Maki for Facebook & Twitter
ModPE IDE
Rocket Notes
OpenHub for GitHub
openHAB
Saarang
Kad ce mi bus - red voznje
Hide Files
LogViewer for openHAB
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 |