Coder Social home page Coder Social logo

tastytoast's Introduction

TastyToast

platform API License Android Arsenal

Make your native android toast look beautiful.

Preview

gif gif gif gif gif gif

About

Refer Here Wiki

Grab the above demo app from here :

Get it on Google Play

Dependency

Add dependency in your app module

dependencies {
	compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
}

Usage

Java

TastyToast.makeText(getApplicationContext(), "Hello World !", TastyToast.LENGTH_LONG, TastyToast.WARNING);

Last parameter here is the type of toast you want to show.

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

License

Copyright 2016 Rahul Yadav

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

tastytoast's People

Contributors

anastr avatar harshit211997 avatar yadav-rahul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tastytoast's Issues

enum for toast type

It would be better to use enum for toast type , storing them as integer seems to be a bad practice .

About Extendibility

Hello,your Toast is great and I like it.But actually, sometimes I really want to move it to the center of the screen(And maybe some other changes anyway).So,hope that you can give users more methods to operate the Toast or just let it extends the native Toast~~~:)

Suggest

Hi,Thank you very much for open source this library,There is a small suggestion,Is it possible to modify the background color of toast?Because some pages themselves are white background, it is not obvious,thank.

Memory leak

I'm use leakcanary in my project and I noticed a memory leak occurred.
it say's references ErrorToastView.mContext leaks MainActivity instance
here is the screenshot
74a22ca812d9785d040509e9637a0ed3

Problem on rtl layout

My application is RTL and TastyToast has problem in showing message!
You can see it on this image.
image

toast.cancel()

Hello , I think your TastyToast need a function of toast.cancel() .
I can't cancel the TastyToast when i close my activity or fragment , and i think a cancel of toast is important.
Thank's for your code , i like the TastyToast , it's beautiful

about the show time

as we know Toast and your TasyToast use the Toast_LOGIN or TOAST_SHORT to control the Toast show Time .
Can we make it more intelligence ,put a long type parameter to control the show time? Or cancel it when I want.

not working in some devices

thank you for this,
but it's not working on some ASUS and Hawaui devices, but work great on Samsung.
any ideas to fix this ?

Multiple clicks appear too long

If you accidentally multi-point several times, really very uncomfortable experience
Forgive my English is bad, directly on the code.
public static void showToast(Context context, String content) { if (toast == null) { toast = Toast.makeText(context, content, Toast.LENGTH_SHORT); } else { toast.setText(content); } toast.show(); }
I‘m learn from guolin

完善建议

建议修改吐司为静态吐司 在TastyToast类中修改 代码如下:

static Toast toast = null; //Toast的对象!
public static Toast makeText(Context context, String msg, int length, int type) {
if (toast==null) {
toast= new Toast(context);
}
替换原此位置代码即可

Make toasts customisable

After looking through the code it seems like the toasts are quite hard coded, apart from the text it displays and the duration (which matches the normal toast duration of long (1) and short (0)).

Here are some suggestions so that others can begin to use this feature in their apps:

  • A default TastyToast.show(text) call that shows a default toast.
  • Change the background color TastyToast.show(text, #color)
  • Pass in the duration in milliseconds, with a maximum bound
  • Either pass in an image or an array of images to display the icon or a gif: TastyToast.show(text, #color, #image), TastyToast.show(text, #color, #image[])

Just a few suggestions.

Error:converting bytecode to dex......

The TastyToast is awesome!
When I run my project then I got an exception,the detailed exception infomation is below.
do you know how to fix this problem.
Thx in advance.

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/facebook/rebound/AndroidSpringLooperFactory$ChoreographerAndroidSpringLooper$1;

Error:Execution failed for task ':app:transformClassesWithDexForRelease'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

Bug in animation on successive toast calls

Animation of toast gets finished by the time it is displayed in case multiple toast are called successively.

Following gif shows finished animation when second toast is displayed.
Bug Details

add rtl support

please support RTL languages so that tastytoast icon locate in right side of the layout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.