Skip to content

Commit

Permalink
Merge pull request BuildmLearn#304 from free4murad/match-bug
Browse files Browse the repository at this point in the history
Match template input validation BuildmLearn#303
  • Loading branch information
opticod authored Dec 22, 2016
2 parents 1161827 + 2780304 commit 8b20518
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 8b20518

Please sign in to comment.