diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/templates/MatchTemplate.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/templates/MatchTemplate.java index 14dedfed..39ec3733 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/templates/MatchTemplate.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/templates/MatchTemplate.java @@ -10,7 +10,7 @@ import android.view.View; import android.widget.BaseAdapter; import android.widget.EditText; - +import android.widget.Toast; import org.buildmlearn.toolkit.R; import org.buildmlearn.toolkit.matchtemplate.fragment.SplashFragment; @@ -61,6 +61,9 @@ private static boolean validated(Context context, EditText title, EditText first second_list_title.hasFocus(); second_list_title.setError(context.getString(R.string.match_second_list_title)); return false; + } else if (first_list_titleText.equalsIgnoreCase(second_list_titleText)){ + Toast.makeText(context, "Title of two lists cannot be same.", Toast.LENGTH_SHORT).show(); + return false; } return true; @@ -82,6 +85,9 @@ private static boolean validated(Context context, EditText first_list_title, Edi second_list_title.hasFocus(); second_list_title.setError(context.getString(R.string.match_second_list_title)); return false; + } else if (second_list_titleText.equals(first_list_titleText)){ + Toast.makeText(context, "Two options cannot be same.", Toast.LENGTH_SHORT).show(); + return false; } return true;