From 213c6e444b8c45aa0c0de0aab1f943cedae4d8c1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 26 Feb 2022 21:13:09 +0100 Subject: [PATCH] do not show the Mark in/complete task button at duplicating task --- .../calendar/pro/activities/TaskActivity.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/TaskActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/TaskActivity.kt index b9a5be91e..dbc1a5b9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/TaskActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/TaskActivity.kt @@ -119,14 +119,15 @@ class TaskActivity : SimpleActivity() { if (task != null) { mTask = task - if (savedInstanceState == null) { - setupEditTask() - } if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) { mTask.id = null updateActionBarTitle(getString(R.string.new_task)) } + + if (savedInstanceState == null) { + setupEditTask() + } } else { mTask = Event(null) if (savedInstanceState == null) { @@ -275,7 +276,7 @@ class TaskActivity : SimpleActivity() { private fun setupMarkCompleteButton() { toggle_mark_complete.setOnClickListener { toggleCompletion() } - toggle_mark_complete.beVisible() + toggle_mark_complete.beVisibleIf(mTask.id != null) if (mTask.isTaskCompleted()) { toggle_mark_complete.background = ContextCompat.getDrawable(this, R.drawable.button_background_stroke) toggle_mark_complete.setText(R.string.mark_incomplete)