Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
import java.lang.annotation.RetentionPolicy;

public class FancyToast extends Toast {

@Retention(RetentionPolicy.SOURCE)
@IntDef({SUCCESS, WARNING, ERROR, INFO, DEFAULT, CONFUSING})
public @interface LayoutType {}
public @interface LayoutType {
}

public static final int SUCCESS = 1;
public static final int WARNING = 2;
public static final int ERROR = 3;
Expand All @@ -30,9 +32,11 @@ public class FancyToast extends Toast {
public static final int CONFUSING = 6;


@IntDef({ LENGTH_SHORT, LENGTH_LONG })
@IntDef({LENGTH_SHORT, LENGTH_LONG})
@Retention(RetentionPolicy.SOURCE)
public @interface Duration {}
public @interface Duration {
}

public static final int LENGTH_SHORT = Toast.LENGTH_SHORT;
public static final int LENGTH_LONG = Toast.LENGTH_LONG;

Expand All @@ -42,7 +46,7 @@ public class FancyToast extends Toast {
* <p>
*
* @param context The context to use. Usually your {@link Application}
* or {@link Activity} object.
* or {@link Activity} object.
*/
public FancyToast(@NonNull Context context) {
super(context);
Expand Down Expand Up @@ -117,14 +121,10 @@ public static Toast makeText(@NonNull Context context, CharSequence message, @Du
case INFO:
linearLayout.setBackgroundResource(R.drawable.info_shape);
break;
case DEFAULT: {
linearLayout.setBackgroundResource(R.drawable.default_shape);
img.setVisibility(View.GONE);
break;
}
case CONFUSING:
linearLayout.setBackgroundResource(R.drawable.confusing_shape);
break;
case DEFAULT:
default:
linearLayout.setBackgroundResource(R.drawable.default_shape);
img.setVisibility(View.GONE);
Expand Down