Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
1.添加Toast重载
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayvytr committed Mar 17, 2017
1 parent 8f62dc2 commit 3879b4b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<a href="http://www.methodscount.com/?lib=com.github.Ayvytr%3AAndroidEasyDeveloper%3A1.0.0"><img src="https://img.shields.io/badge/Methods and size-core: 15 | deps: 19163 | 20 KB-e91e63.svg"/></a>

#
#EasyAndroid Library

#[Chinese][README_CN.md]
Expand Down Expand Up @@ -52,9 +53,9 @@
SeekBarPressure: double Thumb SeekBar

###Tool classes with out Context
Convert: Type conversion class, modeled on the C# Convert class (for this
kind of love have alone bell)
Provides most of the basic types to bool, int, byte conversion, and isZero method
Convert Type conversion class, modeled on the C# Convert class (for this
kind of love have alone bell)
Provides most of the basic types to bool, int, byte conversion, and isZero methods
toBool
izZero
toInt
Expand Down Expand Up @@ -298,7 +299,7 @@
###TODO:
1. Complements Convert class
2. Create my PrettyVideoPlayer
3. Complements my library
3. Complements my library, Add more useful features
4. Personal website
5. Separate Android and Java code
5. Separate Android and Java code, Packaged into different libraries
6. Publish to JCenter
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<a href="http://www.methodscount.com/?lib=com.github.Ayvytr%3AAndroidEasyDeveloper%3A1.0.0"><img src="https://img.shields.io/badge/Methods and size-core: 15 | deps: 19163 | 20 KB-e91e63.svg"/></a>

#
#EasyAndroid 库

#[English][README.md]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.ayvytr.easyandroidlibrary.tools.withcontext;

import android.support.annotation.StringRes;
import android.widget.Toast;

import com.ayvytr.easyandroidlibrary.Easy;
import com.ayvytr.easyandroidlibrary.exception.UnsupportedInitializationException;

/**
* Toast工具类,提供简便的Toast创建和输出功能.
* @see Toast
*
* @author Ayvytr <a href="https://github.com/Ayvytr" target="_blank">'s GitHub</a>
* @see Toast
* @since 1.0.0
*/

Expand Down Expand Up @@ -60,4 +62,46 @@ public static void showLong(String text)
{
makeLong(text).show();
}

/**
* 创建Toast并返回
*
* @param id string id
* @return Toast
*/
public static Toast make(@StringRes int id)
{
return Toast.makeText(Easy.getContext(), id, Toast.LENGTH_SHORT);
}

/**
* 创建LENGTH_LONG Toast并返回
*
* @param id string id
* @return Toast
*/
public static Toast makeLong(@StringRes int id)
{
return Toast.makeText(Easy.getContext(), id, Toast.LENGTH_LONG);
}

/**
* 显示Toast
*
* @param id string id
*/
public static void show(@StringRes int id)
{
make(id).show();
}

/**
* 显示LENGTH_LONG Toast
*
* @param id string id
*/
public static void showLong(@StringRes int id)
{
makeLong(id).show();
}
}

0 comments on commit 3879b4b

Please sign in to comment.