grenderg / toasty Goto Github PK
View Code? Open in Web Editor NEWThe usual Toast, but with steroids 💪
License: GNU Lesser General Public License v3.0
The usual Toast, but with steroids 💪
License: GNU Lesser General Public License v3.0
when i try to make this
Toasty.error(SignUpActivity.this, getString(R.string.action_save));
update: not add .show yet
it not accept it it want a charsequesne how to solve this ?
Hi, is there any specific reason as to why android:label is used in the library? I'm asking since it causes conflicts when merging the AndroidManifests.
Now, I know there's workarounds (like using tools:replace) but if it's not needed, could you remove it? It just adds unnecessary clutter.
Thanks in advance 👍
The previous toast should be cancelled when a new toast is emitted. The new toast should be displayed immediately instead of cumulating all toasts and times in a "queue".
Could you please fix this? Do you have a workaround for this problem for me?
Hi, thx for this useful library... How can I change icon position for persian and arabic (rtl text) to right of text?
Hi @GrenderG , thanks for the great library!
I have a question about how the text padding for Toasty is set. Usually, text in Toasty has a 16-20dp left right margin. However, when I am using the library in a fullscreen activity, the text padding disappears. What is setting the toast's text padding?
P.S. I am currently adding spaces around my toast messages like " Toast Message " to simulate padding. It works great :D
Hello,
please add my news app Daily - News flipped around to the list of apps implementing Toasty. Thanks for your great library!
http://play.google.com/store/apps/details?id=com.fa.daily.free
I can PR if you want the feature in your lib
Hi @GrenderG ,
This library is absolutely amazing and I am currently using it in 3 apps! Today when I upgraded from v1.1.5 to 1.2.0, the existing code broke because the set text color value was removed. Why was set text color removed? How is text color controlled now? Thank you for your great work!
as 3.0.1
build.gradle
compileSdkVersion 26 buildToolsVersion "26.0.3" minSdkVersion 16 targetSdkVersion 26 compile 'com.github.GrenderG:Toasty:1.2.8'
Activity
Toasty.success(applicationContext, "sss").show()
error msg
01-03 16:47:27.553 26958-26958/com.dreamtd.tapplay E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dreamtd.tapplay, PID: 26958 java.lang.NoSuchFieldError: No static field toast_icon of type I in class Les/dmoral/toasty/R$id; or its superclasses (declaration of 'es.dmoral.toasty.R$id' appears in /data/app/com.dreamtd.tapplay-2/base.apk:classes22.dex) at es.dmoral.toasty.Toasty.custom(Toasty.java:174) at es.dmoral.toasty.Toasty.success(Toasty.java:132) at es.dmoral.toasty.Toasty.success(Toasty.java:122)
Hi @GrenderG
Great plugin you have here, just request if possible to have or assign the toast radius (so corners are not so rounded).
Programmatically
Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, textColor, tintColor, duration, withIcon, cornerRadius, true).show();
Hi, I'm using Toasty in my Facebook app Touch for Facebook now, please add it to the list!
http://play.google.com/store/apps/details?id=com.fa.touch.free
Whats SDK MIN?
Error:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.github.GrenderG:Toasty:1.2.8.
hi 博主,这个toast会重复弹出。可以优化一下
Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, textColor, tintColor, duration, withIcon, true).show();
what does "withIcon" stand for?
Also is their a way to have your own custom colors while using Toasty's default icons like the checkmark?
i add whole project maven and jcenter() to repositories and it doesn't work it gives an error
I copied and pasted the gradle compile statement as pasted in the readme, but it doesn't resolve. Using android studio 3 with Kotlin.
I think replacing the .9 image, with the custom shape to the background may be better
I want to make a toast at the top of an activity ,how to set the gravity?
So that it will appear near it, but without overlapping it?
I'm getting error Failed to resolve: com.github.GrednerG:Toasty:1.1.2 whenever I try to build.
Here is my gradle file:
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hi @GrenderG
Great plugin you have here, just request if possible to have or assign the toast borders etc
Something like ...
Programmatically
Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, textColor, tintColor, duration, withIcon, borderLeftThickness, borderLeftColor, true).show();
I want small toast minimum 7dp padding but not applying in that .where can i change that
So I just published an update to my app, ChromoPhoto, and included your Toasty project! When in the app, it shows snackbars for most notifications, and out of the app, the customized Toastys.
I also have one in-app Toasty for the set image quality dialog.
You said to post an issue if an app is using your Toasty, so here I am :D
I also plan on using them more, and even adding them to my app, Get Assistant if I have time.
Also, thanks for the gorgeous customized toasts, they look great!
Here's my app: https://play.google.com/store/apps/details?id=com.trivisionzero.chromophoto
The latest update is 1.5, I just published it, so it may take a while to roll out everywhere.
Is possible to show toast in screen center?
Wow, these toasts look amazing! A definite upgrade to the system default toast messages. I have a quick question about the toast features. Is it possible to customize the color of a toast message? I see that there are different types of toast notifications such as Red for error, Green for success, and Grey for Normal. Would it not be easier to just have one toast that can be customized with the desired color?
I use Toasty, and I had the following error :
Exception java.lang.IndexOutOfBoundsException: setSpan (9 ... 9) ends beyond length 4
android.text.SpannableStringBuilder.checkRange (SpannableStringBuilder.java:1090)
android.text.SpannableStringBuilder.setSpan (SpannableStringBuilder.java:665)
android.text.SpannableStringBuilder.setSpan (SpannableStringBuilder.java:658)
android.text.Selection.setSelection (Selection.java:76)
android.text.Selection.setSelection (Selection.java:87)
android.widget.EditText.setSelection (EditText.java:98)
android.widget.EditText.performAccessibilityActionInternal (EditText.java:138)
android.view.View.performAccessibilityAction (View.java:8889)
android.view.AccessibilityInteractionController.performAccessibilityActionUiThread (AccessibilityInteractionController.java:668)
android.view.AccessibilityInteractionController.-wrap6 (AccessibilityInteractionController.java)
android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1194)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5417)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
As in my code, I don't use SpannableString, I suppose it can be from Toasty library...
I don't know on which Toasty it happens, so I don't know which string make this error (may be a special character like "" ?). Sorry, I cannot give more details...
怎么显示Toast时间更长呢?貌似设置了无效,看了源码没使用时间设置?
I think it will be better to move color variables into resource file.
It will reduce code duplication
it will increase readability, since I thought through code that warning and error colors are constants, also actualy they not
It will give the user more flexibility to config toast. They will able to rewrite your color resources in their own complex resources files. Suppose, we have aaplication, that for different regions use different color schemes. With code-config-aproach it will request for library user more effort to adjust colors by config changes, that if colors were in resource file
The default animation is just passable and I think that will be more delightful if user can set their own animation. Thx~ XD
Android OS version 7.1
when I call Toasty in onCreate(), Toasty show only 1 sec.
This probrem causes only Android 7.1.
Toast.makeText(LENGTH_LONG).show() works fine.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toasty.success(getApplicationContext(), "this toast show only 1 sec", Toast.LENGTH_LONG).show(); // (A)
}
});
Toasty.success(getApplicationContext(), "this toast show 4 sec", Toast.LENGTH_LONG).show(); // (B)
}
}
Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.3.1) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
androidTestCompile 'com.android.support:support-annotations:23.1.1'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
compile 'com.github.GrenderG:Toasty:1.2.5'
}
version 1.2.6 not working
Gradle can't find the lib
I add compile
'com.github.GrenderG:Toasty:1.1.4'
into buil.gradle (app) with the rest of the lib, but get Failed to resolve: com.github.GrenderG:Toasty:1.1.4
error message.
ANy help?
Can I set the Toast width and height? If not,Can you Support?
Just hide the Icon
hi how can i change the font (custom) ?
without supportRtl how can i change icon position?
Great library, just having an issue with it which I think is a bug. When I create any type of Toasty the text and icon have no right or left padding. Using Android 7.1.1 on API 25.
Please add me to the list 👍
Thanks!! :D
https://play.google.com/store/apps/details?id=org.imperium.imperious.Pastebin
java.lang.NoSuchFieldError: No static field toast_icon of type I in class Les/dmoral/toasty/R$id; or its superclasses (declaration of 'es.dmoral.toasty.R$id' appears in
To display the usual Toast with icon:
Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();
i use :
Toasty.normal(MainActivity.this, "Icon Toast", R.drawable.ic_check_circle_black_24dp).show();
is the same as : Toasty.normal(MainActivity.this, "Normal Toast").show();
Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, tintColor, duration, withIcon,
shouldTint).show();
I want to use this to make a custom toast but the problem is I cannot understand what is tintColor here for? is it for the text or background of the toast?
Could you please post an example for clearer understanding?
Toasty.custom(this, "Success!", R.drawable.ic_check_circle_black_24dp, R.color.white, Toast.LENGTH_SHORT, withIcon, R.color.success).show();
I have done this so far and stuck with the withIcon
thing.
Any help would be appreciated.
Got this exception from crash reporting in my app:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.content.Context.getDrawable(int)' on a null object reference
at es.dmoral.toasty.ToastyUtils.getDrawable(ToastyUtils.java:53)
at es.dmoral.toasty.Toasty.info(Toasty.java:116)
at es.dmoral.toasty.Toasty.info(Toasty.java:106)
I can import it in 1.1.2 but when i upgrade it fails.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.github.GrenderG:Toasty:1.2.5'
testCompile 'junit:junit:4.12'
}
The text is smaller than the standard Toast. Is there a way to adjust this?
Hi, I'm using Toasty in my Photo Gallery App now, please add it to the list :) (New version not yet online...)
https://play.google.com/store/apps/details?id=com.levionsoftware.photos
build error
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\tariq\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\d8468f24b31c24ee8d29575dc26584f6\res\values-v26\values-v26.xml
Error:(9, 5) error: resource android:attr/colorError not found.
Error:(13, 5) error: resource android:attr/colorError not found.
Error:(17, 5) error: style attribute 'android:attr/keyboardNavigationCluster' not found.
C:\Users\tariq\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\d8468f24b31c24ee8d29575dc26584f6\res\values\values.xml
Error:(252, 5) error: resource android:attr/fontStyle not found.
Error:(252, 5) error: resource android:attr/font not found.
Error:(252, 5) error: resource android:attr/fontWeight not found.
C:\Users\tariq\Desktop\adnan laravel android pharamacy\materiallogindemo-master\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml
Error:(7) resource android:attr/colorError not found.
Error:(11) resource android:attr/colorError not found.
Error:(15) style attribute 'android:attr/keyboardNavigationCluster' not found.
C:\Users\tariq\Desktop\adnan laravel android pharamacy\materiallogindemo-master\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(438) resource android:attr/fontStyle not found.
Error:(438) resource android:attr/font not found.
Error:(438) resource android:attr/fontWeight not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 13s
Information:17 errors
Information:0 warnings
Information:See complete output in console
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.