Skip to content

Commit

Permalink
Merge pull request #444 from FossifyOrg/fix_mark_complete_button_color
Browse files Browse the repository at this point in the history
Apply proper color to "Mark completed" button background
  • Loading branch information
naveensingh authored Jan 24, 2025
2 parents f97b3ca + ecefefe commit 035e116
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.fossify.calendar.activities
import android.app.DatePickerDialog
import android.app.TimePickerDialog
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.WindowManager
import androidx.core.content.ContextCompat
Expand Down Expand Up @@ -648,18 +647,18 @@ class TaskActivity : SimpleActivity() {
}

private fun updateTaskCompletedButton() {
val primaryColor = getProperPrimaryColor()
if (mTaskCompleted) {
binding.toggleMarkComplete.background = ContextCompat.getDrawable(this, org.fossify.commons.R.drawable.button_background_stroke)
binding.toggleMarkComplete.background = ContextCompat.getDrawable(
this, org.fossify.commons.R.drawable.button_background_stroke
)
binding.toggleMarkComplete.setText(R.string.mark_incomplete)
binding.toggleMarkComplete.setTextColor(getProperTextColor())
} else {
val markCompleteBgColor = if (isWhiteTheme()) {
Color.WHITE
} else {
getProperPrimaryColor()
}
binding.toggleMarkComplete.setTextColor(markCompleteBgColor.getContrastColor())
binding.toggleMarkComplete.setTextColor(primaryColor.getContrastColor())
}

binding.toggleMarkComplete.background.applyColorFilter(primaryColor)
}

private fun toggleCompletion() {
Expand Down

0 comments on commit 035e116

Please sign in to comment.