├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
├── vcs.xml
└── workspace.xml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── github
│ │ └── pierry
│ │ └── simpletoast
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── pierry
│ │ └── simpletoast
│ │ └── SimpleToast.java
│ └── res
│ ├── drawable-hdpi
│ ├── cancel.png
│ ├── info.png
│ └── ok.png
│ ├── drawable-mdpi
│ ├── cancel.png
│ ├── info.png
│ └── ok.png
│ ├── drawable-xhdpi
│ ├── cancel.png
│ ├── info.png
│ └── ok.png
│ ├── drawable-xxhdpi
│ ├── cancel.png
│ ├── info.png
│ └── ok.png
│ ├── drawable-xxxhdpi
│ ├── cancel.png
│ ├── info.png
│ └── ok.png
│ ├── drawable
│ ├── background_empty.xml
│ ├── list_border_back_blue.xml
│ ├── list_border_back_gray.xml
│ ├── list_border_back_green.xml
│ ├── list_border_back_red.xml
│ └── list_border_back_yellow.xml
│ ├── layout
│ ├── toast_error.xml
│ ├── toast_error_icon.xml
│ ├── toast_info.xml
│ ├── toast_info_icon.xml
│ ├── toast_muted.xml
│ ├── toast_muted_icon.xml
│ ├── toast_ok.xml
│ ├── toast_ok_icon.xml
│ ├── toast_warning.xml
│ └── toast_warning_icon.xml
│ └── values
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── config
└── checkstyle
│ └── checkstyle.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screentshots
├── cancel.png
├── cancel_default.png
├── info.png
├── info_default.png
├── muted.png
├── ok.png
├── ok_default.png
└── warning.png
├── settings.gradle
├── simpletoast.iml
└── travis.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | simpletoast
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
24 |
25 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.7
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
129 |
130 |
131 |
1123 |
1124 |
1125 |
1131 |
1132 |
1133 |
1420 |
1421 |
1422 |
1423 |
1424 |
1425 |
1426 |
1427 |
1428 |
1429 |
1430 |
1431 |
1432 |
1433 |
1434 |
1435 |
1436 |
1437 |
1438 |
1439 |
1440 |
1441 |
1442 |
1443 |
1444 |
1445 |
1446 |
1447 |
1448 |
1449 |
1450 |
1451 |
1452 |
1453 |
1454 |
1455 |
1456 |
1457 |
1458 |
1459 |
1460 |
1461 |
1462 |
1463 |
1464 |
1465 |
1466 |
1467 |
1468 |
1469 |
1470 |
1471 |
1472 |
1473 |
1474 |
1475 |
1476 |
1477 |
1478 |
1479 |
1480 |
1481 |
1482 |
1483 |
1484 |
1485 |
1486 |
1487 |
1488 |
1489 |
1490 |
1491 |
1492 |
1493 |
1494 |
1495 |
1496 |
1497 |
1498 |
1499 |
1500 |
1501 |
1502 |
1503 |
1504 |
1505 |
1506 |
1507 |
1508 |
1509 |
1510 |
1511 |
1512 |
1513 |
1514 |
1515 |
1516 |
1517 |
1518 |
1519 |
1520 |
1521 |
1522 |
1523 |
1524 |
1525 |
1526 |
1527 |
1528 |
1529 |
1530 |
1531 |
1532 |
1533 |
1534 |
1535 |
1536 |
1537 |
1538 |
1539 |
1540 |
1541 |
1542 |
1543 |
1544 |
1545 |
1546 |
1547 |
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1568 |
1569 |
1570 |
1571 |
1572 |
1573 |
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 |
1581 |
1582 |
1583 |
1584 |
1585 |
1586 |
1587 |
1588 |
1589 |
1590 |
1591 |
1592 |
1593 |
1594 |
1595 |
1596 |
1597 |
1598 |
1599 |
1600 |
1601 |
1602 |
1603 |
1604 |
1605 |
1606 |
1607 |
1608 |
1609 |
1610 |
1611 |
1612 |
1613 |
1614 |
1615 |
1616 |
1617 |
1618 |
1619 |
1620 |
1621 |
1622 |
1623 |
1624 |
1625 |
1626 |
1627 |
1628 |
1629 |
1630 |
1631 |
1632 |
1633 |
1634 |
1635 |
1636 |
1637 |
1638 |
1639 |
1640 |
1641 |
1642 |
1643 |
1644 |
1645 |
1646 |
1647 |
1648 |
1649 |
1650 |
1651 |
1652 |
1653 |
1654 |
1655 |
1656 |
1657 |
1658 |
1659 |
1660 |
1661 |
1662 |
1663 |
1664 |
1665 |
1666 |
1667 |
1668 |
1669 |
1670 |
1671 |
1672 |
1673 |
1674 |
1675 |
1676 |
1677 |
1678 |
1679 |
1680 |
1681 |
1682 |
1683 |
1684 |
1685 |
1686 |
1687 |
1688 |
1689 |
1690 |
1691 |
1692 |
1693 |
1694 |
1695 |
1696 |
1697 |
1698 |
1699 |
1700 |
1701 |
1702 |
1703 |
1704 |
1705 |
1706 |
1707 |
1708 |
1709 |
1710 |
1711 |
1712 |
1713 |
1714 |
1715 |
1716 |
1717 |
1718 |
1719 |
1720 |
1721 |
1722 |
1723 |
1724 |
1725 |
1726 |
1727 |
1728 |
1729 |
1730 |
1731 |
1732 |
1733 |
1734 |
1735 |
1736 |
1737 |
1738 |
1739 |
1740 |
1741 |
1742 |
1743 |
1744 |
1745 |
1746 |
1747 |
1748 |
1749 |
1750 |
1751 |
1752 | localhost
1753 | 5050
1754 |
1755 |
1756 |
1757 |
1758 |
1759 |
1760 |
1761 |
1762 |
1763 | 1445876280758
1764 |
1765 | 1445876280758
1766 |
1767 |
1768 | 1454333896836
1769 |
1770 |
1771 | 1454333896836
1772 |
1773 |
1774 |
1775 |
1776 |
1777 |
1778 |
1779 |
1780 |
1781 |
1782 |
1783 |
1784 |
1785 |
1786 |
1787 |
1788 |
1789 |
1790 |
1791 |
1792 |
1793 |
1794 |
1795 |
1796 |
1797 |
1798 |
1799 |
1800 |
1801 |
1802 |
1803 |
1804 |
1805 |
1806 |
1807 |
1808 |
1809 |
1810 |
1811 |
1812 |
1813 |
1814 |
1815 |
1816 |
1817 |
1818 |
1819 |
1820 |
1821 |
1822 |
1823 |
1824 |
1825 |
1826 |
1827 |
1828 |
1829 |
1830 |
1831 |
1832 |
1833 |
1834 |
1835 |
1836 |
1837 |
1838 |
1839 |
1840 |
1841 |
1842 |
1843 |
1844 |
1845 |
1846 |
1847 |
1848 |
1849 |
1850 |
1851 |
1852 |
1853 |
1854 |
1855 |
1856 |
1857 |
1858 |
1859 |
1860 |
1861 |
1862 |
1863 |
1864 |
1865 |
1866 |
1867 |
1868 |
1869 |
1870 |
1871 |
1872 |
1873 |
1874 |
1875 |
1876 |
1877 |
1878 |
1879 |
1880 |
1881 |
1882 |
1883 |
1884 |
1885 |
1886 |
1887 |
1888 |
1889 |
1890 |
1891 |
1892 |
1893 |
1894 |
1895 |
1896 |
1897 |
1898 |
1899 |
1900 |
1901 |
1902 |
1903 |
1904 |
1905 |
1906 |
1907 |
1908 |
1909 |
1910 |
1911 |
1912 |
1913 |
1914 |
1915 |
1916 |
1917 |
1918 |
1919 |
1920 |
1921 |
1922 |
1923 |
1924 |
1925 |
1926 |
1927 |
1928 |
1929 |
1930 |
1931 |
1932 |
1933 |
1934 |
1935 |
1936 |
1937 |
1938 |
1939 |
1940 |
1941 |
1942 |
1943 |
1944 |
1945 |
1946 |
1947 |
1948 |
1949 |
1950 |
1951 |
1952 |
1953 |
1954 |
1955 |
1956 |
1957 |
1958 |
1959 |
1960 |
1961 |
1962 |
1963 |
1964 |
1965 |
1966 |
1967 |
1968 |
1969 |
1970 |
1971 |
1972 |
1973 |
1974 |
1975 |
1976 |
1977 |
1978 |
1979 |
1980 |
1981 |
1982 |
1983 |
1984 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | SimpleToast
2 | ===========
3 |
4 | [](https://android-arsenal.com/details/1/1031)
5 | 
6 |
7 | Notifications for Android (like a Toast)
8 |
9 | Current version: v1.9
10 |
11 | Example
12 | ===========
13 | ### Default icons
14 | 
15 | 
16 | 
17 | ### Font awesome
18 |
19 | 
20 | 
21 | 
22 | 
23 | 
24 |
25 |
26 | Gradle
27 | ===========
28 |
29 | This library uses android-iconify:1.0.9.
30 |
31 | Into your build.gradle:
32 |
33 | repositories {
34 | maven { url "https://jitpack.io" }
35 | }
36 |
37 | dependencies {
38 | compile 'com.github.Pierry:SimpleToast:v1.7'
39 | }
40 |
41 | Ref. https://jitpack.io/#Pierry/SimpleToast/v1.7
42 |
43 | Usage
44 | =============
45 |
46 | The API is kept as simple as the Toast API:
47 |
48 | Create a SimpleToast for any CharSequence with default icon:
49 |
50 | SimpleToast.ok(Context, CharSequence);
51 | SimpleToast.error(Context, CharSequence);
52 | SimpleToast.info(Context, CharSequence);
53 | SimpleToast.muted(Context, CharSequence);
54 | SimpleToast.warning(Context, CharSequence);
55 |
56 | Using [Font Awesome](http://fortawesome.github.io/Font-Awesome/icons/):
57 |
58 | SimpleToast.ok(Context, CharSequence, "{fa-home}");
59 | SimpleToast.error(Context, CharSequence, "{fa-user}");
60 | SimpleToast.info(Context, CharSequence, "{fa-check-square}");
61 | SimpleToast.muted(Context, CharSequence, "{fa-github}");
62 | SimpleToast.warning(Context, CharSequence, "{fa-exclamation-circle}");
63 |
64 | Use this link for icons:
65 | http://fortawesome.github.io/Font-Awesome/icons/
66 |
67 | Questions
68 | ==========
69 | Questions regarding SimpleToast can be asked on [StackOverflow, using the simpletoast tag](http://stackoverflow.com/questions/tagged/simpletoast).
70 |
71 | Credits
72 | ==========
73 | [Joan Zapata](https://github.com/JoanZapata) creator of [Android-Iconify](https://github.com/JoanZapata/android-iconify)
74 |
75 | [Dave Gandy](https://github.com/davegandy) creator of [Font-Awesome](https://github.com/FortAwesome/Font-Awesome)
76 |
77 | Developed By
78 | ==========
79 | Pierry Borges - http://pierry.github.io - pieerry@gmail.com
80 |
81 | License
82 | ==========
83 |
84 | [Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
85 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'checkstyle'
3 |
4 | dependencies {
5 | compile 'com.android.support:appcompat-v7:22.1.0'
6 | compile 'com.joanzapata.android:android-iconify:1.0.9'
7 | }
8 |
9 | android {
10 | compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)
11 | buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
12 |
13 | defaultConfig {
14 | versionCode Integer.parseInt(project.VERSION_CODE)
15 | versionName project.VERSION_NAME
16 | minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK)
17 | targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
18 | }
19 |
20 | sourceSets {
21 | main {
22 | manifest.srcFile 'src/main/AndroidManifest.xml'
23 | java.srcDirs = ['src/main/java']
24 | res.srcDirs = ['src/main/res']
25 | }
26 | }
27 | lintOptions {
28 | abortOnError false
29 | }
30 | }
31 |
32 | task checkstyle(type: Checkstyle) {
33 | configFile file('../config/checkstyle/checkstyle.xml')
34 | source 'src/main/java'
35 | include '**/*.java'
36 | exclude '**/gen/**'
37 | classpath = files()
38 | }
--------------------------------------------------------------------------------
/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 C:\Users\Pierry\AppData\Local\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/com/github/pierry/simpletoast/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.github.pierry.simpletoast;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/pierry/simpletoast/SimpleToast.java:
--------------------------------------------------------------------------------
1 | package com.github.pierry.simpletoast;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.os.Build;
6 | import android.os.Handler;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.IconTextView;
11 | import android.widget.Toast;
12 |
13 | /*
14 | * Copyright (C) 2015 Pierry Borges
15 | *
16 | * Licensed under the Apache License, Version 2.0 (the "License");
17 | * you may not use this file except in compliance with the License.
18 | * You may obtain a copy of the License at
19 | *
20 | * http://www.apache.org/licenses/LICENSE-2.0
21 | *
22 | * Unless required by applicable law or agreed to in writing, software
23 | * distributed under the License is distributed on an "AS IS" BASIS,
24 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 | * See the License for the specific language governing permissions and
26 | * limitations under the License.
27 | */
28 | public class SimpleToast {
29 |
30 | private static LayoutInflater mInflater;
31 | private static Toast mToast;
32 | private static View mView;
33 |
34 | public static void ok(Context context, String msg){
35 | ok(context,msg,Toast.LENGTH_SHORT);
36 | }
37 |
38 | public static void ok(Context context, String msg, int duration) {
39 | mInflater = LayoutInflater.from(context);
40 | mView = mInflater.inflate(R.layout.toast_ok, null);
41 | initSetButtonMsg(msg);
42 | mToast = new Toast(context);
43 | mToast.setView(mView);
44 | mToast.setDuration(duration);
45 | mToast.show();
46 | }
47 |
48 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
49 | public static void ok(Context context, String msg,
50 | String icon) {
51 | mInflater = LayoutInflater.from(context);
52 | mView = mInflater.inflate(R.layout.toast_ok_icon, null);
53 | initSetButtonMsg(msg);
54 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
55 | img.setText(icon);
56 | img.setTextSize(20);
57 | mToast = new Toast(context);
58 | mToast.setView(mView);
59 | mToast.setDuration(Toast.LENGTH_SHORT);
60 | mToast.show();
61 | }
62 |
63 | public static void ok(Context context, String msg, String icon, int time){
64 | mInflater = LayoutInflater.from(context);
65 | if (!icon.equals("")) {
66 | mView = mInflater.inflate(R.layout.toast_ok_icon, null);
67 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
68 | img.setText(icon);
69 | img.setTextSize(20);
70 | } else {
71 | mView = mInflater.inflate(R.layout.toast_ok, null);
72 | }
73 | initSetButtonMsg(msg);
74 | mToast = new Toast(context);
75 | mToast.setView(mView);
76 | mToast.setDuration(Toast.LENGTH_LONG);
77 | mToast.show();
78 | if (time != 0) {
79 | Handler handler = new Handler();
80 | handler.postDelayed(new Runnable() {
81 | @Override public void run() {
82 | mToast.cancel();
83 | }
84 | }, time);
85 | }
86 | }
87 |
88 | public static void error(Context context, String msg) {
89 | error(context,msg,Toast.LENGTH_SHORT);
90 | }
91 |
92 |
93 | public static void error(Context context, String msg, int duration) {
94 | mInflater = LayoutInflater.from(context);
95 | mView = mInflater.inflate(R.layout.toast_error, null);
96 | initSetButtonMsg(msg);
97 | mToast = new Toast(context);
98 | mToast.setView(mView);
99 | mToast.setDuration(duration);
100 | mToast.show();
101 | }
102 |
103 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void error(Context context, String msg, String icon){
104 | mInflater = LayoutInflater.from(context);
105 | if (!icon.equals("")) {
106 | mView = mInflater.inflate(R.layout.toast_error_icon, null);
107 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
108 | img.setText(icon);
109 | img.setTextSize(20);
110 | } else {
111 | mView = mInflater.inflate(R.layout.toast_error, null);
112 | }
113 | initSetButtonMsg(msg);
114 | mToast = new Toast(context);
115 | mToast.setView(mView);
116 | mToast.setDuration(Toast.LENGTH_SHORT);
117 | mToast.show();
118 | }
119 |
120 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void error(Context context, String msg, String icon, int time){
121 | mInflater = LayoutInflater.from(context);
122 | if (!icon.equals("")) {
123 | mView = mInflater.inflate(R.layout.toast_error_icon, null);
124 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
125 | img.setText(icon);
126 | img.setTextSize(20);
127 | } else {
128 | mView = mInflater.inflate(R.layout.toast_error, null);
129 | }
130 | initSetButtonMsg(msg);
131 | mToast = new Toast(context);
132 | mToast.setView(mView);
133 | mToast.setDuration(Toast.LENGTH_LONG);
134 | mToast.show();
135 | if (time != 0) {
136 | Handler handler = new Handler();
137 | handler.postDelayed(new Runnable() {
138 | @Override public void run() {
139 | mToast.cancel();
140 | }
141 | }, time);
142 | }
143 | }
144 |
145 | public static void info(Context context, String msg) {
146 | info(context,msg,Toast.LENGTH_SHORT);
147 | }
148 |
149 | public static void info(Context context, String msg, int duration) {
150 | mInflater = LayoutInflater.from(context);
151 | mView = mInflater.inflate(R.layout.toast_info, null);
152 | initSetButtonMsg(msg);
153 | mToast = new Toast(context);
154 | mToast.setView(mView);
155 | mToast.setDuration(duration);
156 | mToast.show();
157 | }
158 |
159 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void info(Context context, String msg, String icon){
160 | mInflater = LayoutInflater.from(context);
161 | if (!icon.equals("")) {
162 | mView = mInflater.inflate(R.layout.toast_info_icon, null);
163 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
164 | img.setText(icon);
165 | img.setTextSize(20);
166 | } else {
167 | mView = mInflater.inflate(R.layout.toast_info, null);
168 | }
169 | initSetButtonMsg(msg);
170 | mToast = new Toast(context);
171 | mToast.setView(mView);
172 | mToast.setDuration(Toast.LENGTH_SHORT);
173 | mToast.show();
174 | }
175 |
176 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void info(Context context, String msg, String icon, int time){
177 | mInflater = LayoutInflater.from(context);
178 | if (!icon.equals("")) {
179 | mView = mInflater.inflate(R.layout.toast_info_icon, null);
180 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
181 | img.setText(icon);
182 | img.setTextSize(20);
183 | } else {
184 | mView = mInflater.inflate(R.layout.toast_info, null);
185 | }
186 | initSetButtonMsg(msg);
187 | mToast = new Toast(context);
188 | mToast.setView(mView);
189 | mToast.setDuration(Toast.LENGTH_LONG);
190 | mToast.show();
191 | if (time != 0) {
192 | Handler handler = new Handler();
193 | handler.postDelayed(new Runnable() {
194 | @Override public void run() {
195 | mToast.cancel();
196 | }
197 | }, time);
198 | }
199 | }
200 |
201 | public static void muted(Context context, String msg) {
202 | muted(context,msg,Toast.LENGTH_SHORT);
203 | }
204 |
205 | public static void muted(Context context, String msg, int duration) {
206 | mInflater = LayoutInflater.from(context);
207 | mView = mInflater.inflate(R.layout.toast_muted, null);
208 | initSetButtonMsg(msg);
209 | mToast = new Toast(context);
210 | mToast.setView(mView);
211 | mToast.setDuration(duration);
212 | mToast.show();
213 | }
214 |
215 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void muted(Context context, String msg, String icon){
216 | mInflater = LayoutInflater.from(context);
217 | if (!icon.equals("")) {
218 | mView = mInflater.inflate(R.layout.toast_muted_icon, null);
219 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
220 | img.setText(icon);
221 | img.setTextSize(20);
222 | } else {
223 | mView = mInflater.inflate(R.layout.toast_muted, null);
224 | }
225 | initSetButtonMsg(msg);
226 | mToast = new Toast(context);
227 | mToast.setView(mView);
228 | mToast.setDuration(Toast.LENGTH_SHORT);
229 | mToast.show();
230 | }
231 |
232 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void muted(Context context, String msg, String icon, int time){
233 | mInflater = LayoutInflater.from(context);
234 | if (!icon.equals("")) {
235 | mView = mInflater.inflate(R.layout.toast_muted_icon, null);
236 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
237 | img.setText(icon);
238 | img.setTextSize(20);
239 | } else {
240 | mView = mInflater.inflate(R.layout.toast_muted, null);
241 | }
242 | initSetButtonMsg(msg);
243 | mToast = new Toast(context);
244 | mToast.setView(mView);
245 | mToast.setDuration(Toast.LENGTH_LONG);
246 | mToast.show();
247 | if (time != 0) {
248 | Handler handler = new Handler();
249 | handler.postDelayed(new Runnable() {
250 | @Override public void run() {
251 | mToast.cancel();
252 | }
253 | }, time);
254 | }
255 | }
256 |
257 | public static void warning(Context context, String msg) {
258 | warning(context,msg,Toast.LENGTH_SHORT);
259 | }
260 |
261 | public static void warning(Context context, String msg, int duration) {
262 | mInflater = LayoutInflater.from(context);
263 | mView = mInflater.inflate(R.layout.toast_warning, null);
264 | initSetButtonMsg(msg);
265 | mToast = new Toast(context);
266 | mToast.setView(mView);
267 | mToast.setDuration(duration);
268 | mToast.show();
269 | }
270 |
271 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void warning(Context context, String msg, String icon){
272 | mInflater = LayoutInflater.from(context);
273 | if (!icon.equals("")) {
274 | mView = mInflater.inflate(R.layout.toast_warning_icon, null);
275 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
276 | img.setText(icon);
277 | img.setTextSize(20);
278 | } else {
279 | mView = mInflater.inflate(R.layout.toast_warning, null);
280 | }
281 | initSetButtonMsg(msg);
282 | mToast = new Toast(context);
283 | mToast.setView(mView);
284 | mToast.setDuration(Toast.LENGTH_SHORT);
285 | mToast.show();
286 | }
287 |
288 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void warning(Context context, String msg, String icon, int time){
289 | mInflater = LayoutInflater.from(context);
290 | if (!icon.equals("")) {
291 | mView = mInflater.inflate(R.layout.toast_warning_icon, null);
292 | IconTextView img = (IconTextView) mView.findViewById(R.id.img);
293 | img.setText(icon);
294 | img.setTextSize(20);
295 | } else {
296 | mView = mInflater.inflate(R.layout.toast_warning, null);
297 | }
298 | initSetButtonMsg(msg);
299 | mToast = new Toast(context);
300 | mToast.setView(mView);
301 | mToast.setDuration(Toast.LENGTH_LONG);
302 | mToast.show();
303 | if (time != 0) {
304 | Handler handler = new Handler();
305 | handler.postDelayed(new Runnable() {
306 | @Override public void run() {
307 | mToast.cancel();
308 | }
309 | }, time);
310 | }
311 | }
312 |
313 | private static Button initSetButtonMsg(String msg) {
314 | Button mButton = (Button) mView.findViewById(R.id.button);
315 | mButton.setText(msg);
316 | return mButton;
317 | }
318 |
319 | public static void CancelCurrentToast(){
320 | if (mToast != null)
321 | mToast.cancel();
322 | }
323 | }
324 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-hdpi/cancel.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-hdpi/info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-hdpi/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-mdpi/cancel.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-mdpi/info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-mdpi/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xhdpi/cancel.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xhdpi/info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xhdpi/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxhdpi/cancel.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxhdpi/info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxhdpi/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxxhdpi/cancel.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxxhdpi/info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/app/src/main/res/drawable-xxxhdpi/ok.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/background_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_border_back_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_border_back_gray.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_border_back_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_border_back_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_border_back_yellow.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_error.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_error_icon.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_info.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_info_icon.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_muted.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_muted_icon.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_ok.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_ok_icon.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_warning.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_warning_icon.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
16 |
17 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | SimpleToast
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenCentral()
18 | mavenLocal()
19 | }
20 | }
21 |
22 | def isReleaseBuild() {
23 | return version.contains("SNAPSHOT") == false
24 | }
25 |
--------------------------------------------------------------------------------
/config/checkstyle/checkstyle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | VERSION_NAME=0.1
2 | VERSION_CODE=1
3 | GROUP=com.github.simpletoast
4 |
5 | POM_DESCRIPTION=
6 | POM_URL=https://github.com/Pierry/SimpleToast
7 | POM_SCM_URL=https://github.com/Pierry/SimpleToast
8 | POM_SCM_CONNECTION=scm:git@github.com:pierry/SimpleToast.git
9 | POM_SCM_DEV_CONNECTION=scm:git@github.com:pierry/SimpleToast.git
10 | POM_LICENCE_NAME=The Apache Software License, Version 2.0
11 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
12 | POM_LICENCE_DIST=repo
13 | POM_DEVELOPER_ID=pierry
14 | POM_DEVELOPER_NAME=Pierry Borges
15 |
16 | ANDROID_BUILD_TOOLS_VERSION=21.1.2
17 | ANDROID_COMPILE_SDK_VERSION=21
18 | ANDROID_TARGET_SDK_VERSION=21
19 | ANDROID_MIN_SDK=14
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Feb 01 11:10:01 BRST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screentshots/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/cancel.png
--------------------------------------------------------------------------------
/screentshots/cancel_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/cancel_default.png
--------------------------------------------------------------------------------
/screentshots/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/info.png
--------------------------------------------------------------------------------
/screentshots/info_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/info_default.png
--------------------------------------------------------------------------------
/screentshots/muted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/muted.png
--------------------------------------------------------------------------------
/screentshots/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/ok.png
--------------------------------------------------------------------------------
/screentshots/ok_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/ok_default.png
--------------------------------------------------------------------------------
/screentshots/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pierry/SimpleToast/4f2c367d9d0ce852a90db78e62bb9b44d63c845a/screentshots/warning.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/simpletoast.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/travis.yml:
--------------------------------------------------------------------------------
1 | language: android
2 |
3 | android:
4 | components:
5 | - build-tools-22.1.0
6 | - android-21
7 |
8 | script:
9 | ./gradlew checkstyle build
--------------------------------------------------------------------------------