Comments (7)
Hello @searchy2, sorry for any inconveniences. You can change the text color and more parameters with this (check the README.md
):
Toasty.Config.getInstance()
.setErrorColor(@ColorInt int errorColor) // optional
.setInfoColor(@ColorInt int infoColor) // optional
.setSuccessColor(@ColorInt int successColor) // optional
.setWarningColor(@ColorInt int warningColor) // optional
.setTextColor(@ColorInt int textColor) // optional
.setToastTypeface(AssetManager assetManager, String fontPath) // optional
.apply(); // required
EDIT: The icon is being tinted along with the text color, but if you want I can add a feature to turn that off. (Ex: tintIcon(boolean)
).
EDIT2: In fact I'm gonna add it, wait for version 1.2.2
.
from toasty.
Okay, now all the options are:
Toasty.Config.getInstance()
.setErrorColor(@ColorInt int errorColor) // optional
.setInfoColor(@ColorInt int infoColor) // optional
.setSuccessColor(@ColorInt int successColor) // optional
.setWarningColor(@ColorInt int warningColor) // optional
.setTextColor(@ColorInt int textColor) // optional
.tintIcon(boolean tintIcon) // optional (apply textColor also to the icon)
.setToastTypeface(AssetManager assetManager, String fontPath) // optional
.apply(); // required
Remember to update to version 1.2.2
.
from toasty.
Thanks for the care you put into the library and continually making it better. I think I understand how the changes work. I have one question that I am still confused about that I hope you can clear up.
Is there a method to set the color of a custom toast? I see that you can set Info, Error, and Warning toast colors. How do you set it for the custom toast? Thanks!
from toasty.
Thanks for your words. You can still change a custom Toast color the same way as before. The custom()
method accepts a @ColorInt int tintColor
parameter which corresponds to the color that the Toast will have.
from toasty.
Oh! I thought the tint color was used to specify the color for the text and icon. I did not realize that it was for the background color. Will try to upgrade now, hopefully everything goes smoothly!
from toasty.
Hope it goes smoothly. 😄 By the way, I've released version 1.2.3
. The only noticeable changes take place on this method:
.setToastTypeface(@NonNull Typeface typeface) // optional
Now it accepts a Typeface object.
from toasty.
Everything works smoothly!
from toasty.
Related Issues (20)
- An error occurs when getting the icon in the component.
- ToastUtil 简单封装
- 内存泄漏问题
- I'm getting error Failed to resolve: com.github.GrednerG:Toasty:1.4 HOT 4
- ToastyUtils.java line 1 es.dmoral.toasty.ToastyUtils.getDrawable HOT 2
- andy
- Feature request: support text shadow - TextView.setShadowLayer(float radius, float dx, float dy, int colour) HOT 1
- NullPointerException 想请问下这个空指针异常是由于什么原因造成的
- ColorHub - Color Palette no longer exists on g play
- memory leak HOT 1
- normal状态下的Toast白底黑字,normalWithDarkThemeSupport这个方法能否优化一下
- Show multiple toast at same time vertical
- Migration to mavencentral HOT 2
- Duration longer than Toast.LENGTH_LONG? HOT 2
- It didn't work HOT 1
- App Promotion
- leak
- leaks 内存泄漏 HOT 1
- How to solve Memory leak
- is this lib deprecated in android API 34? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toasty.