Skip to content

Commit

Permalink
Merge pull request #11 from niilopoutanen/Develop
Browse files Browse the repository at this point in the history
Space hotfix
  • Loading branch information
osaama05 authored Sep 20, 2022
2 parents 8ad105b + 52b4299 commit a28064c
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions TODO-app/TODO-app/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private void CloseCreateView(object sender, EventArgs e)
DateTime dueDate;
if (mainHeader.Visibility == ViewStates.Gone)
{
if (IsNull(taskname))
if (string.IsNullOrWhiteSpace((taskname)))
{
OpenPopup(GetString(Resource.String.invalidName), GetString(Resource.String.invalidNameDesc), "OK");
return;
Expand All @@ -355,7 +355,7 @@ private void CloseCreateView(object sender, EventArgs e)
}
}

if (!IsNull(dayInput.Text) && !IsNull(monthInput.Text) && !IsNull(yearInput.Text))
if (!string.IsNullOrWhiteSpace(dayInput.Text) && !string.IsNullOrWhiteSpace(monthInput.Text) && !string.IsNullOrWhiteSpace(yearInput.Text))
{
try
{
Expand Down Expand Up @@ -1053,22 +1053,7 @@ private void DeleteTaskItem(string name)

}

/// <summary>
/// Returns true if given string is null or empty
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
private bool IsNull(string s)
{
if (s == "" || s == null || s == " ")
{
return true;
}
else
{
return false;
}
}

/// <summary>
/// Checks if the given date is in the given month
/// Returns true if the day is in the month
Expand Down

0 comments on commit a28064c

Please sign in to comment.