diff --git a/Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt b/Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt index d22325f..e1db94e 100644 --- a/Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt +++ b/Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt @@ -58,7 +58,7 @@ class ToastGenerate constructor(private val context: Context) { addSource(listen) { value = it to value?.second } addSource(toastShown) { value = value?.first to it } }.observe(context as LifecycleOwner) { pair -> - Log.d("Debug", pair.first.toString()+ " " + pair.second) + Log.d("DebugSSSS", pair.first!!.size.toString() + " " + pair.second) if(pair.second!=null && !pair.second!!) { if (pair.first != null) { diff --git a/Toast/src/main/java/com/collegedunia/toast/ToastModel.kt b/Toast/src/main/java/com/collegedunia/toast/ToastModel.kt index cb145ea..fe97cb0 100644 --- a/Toast/src/main/java/com/collegedunia/toast/ToastModel.kt +++ b/Toast/src/main/java/com/collegedunia/toast/ToastModel.kt @@ -1,5 +1,18 @@ package com.collegedunia.toast import android.graphics.drawable.Drawable +import java.util.* -data class ToastModel(val type: ToastType, val title: String?, val message: String?, val leftImage: Drawable?, val length: ToastLength? = ToastLength.SHORT) +data class ToastModel(val type: ToastType, val title: String?, val message: String?, val leftImage: Drawable?, val length: ToastLength? = ToastLength.SHORT) { + override fun equals(other: Any?): Boolean{ + return when (other) { + is ToastModel -> { + this.type == other.type && + this.title == other.title && + this.message == other.message + } + else -> false + } + } + +} diff --git a/app/src/main/res/drawable/ic_warning.xml b/app/src/main/res/drawable/ic_warning.xml new file mode 100644 index 0000000..2e20821 --- /dev/null +++ b/app/src/main/res/drawable/ic_warning.xml @@ -0,0 +1,9 @@ + + +