Skip to content

Commit

Permalink
Merge pull request #929 from d4rken-org/acs_mascot_refac
Browse files Browse the repository at this point in the history
UI: Fix click action on mascot in acs controlview
  • Loading branch information
d4rken authored Jan 17, 2024
2 parents b1a9a51 + 075a96c commit 8d28e60
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package eu.darken.sdmse.automation.ui

import android.content.Context
import android.util.AttributeSet
import android.view.animation.AnimationUtils
import androidx.annotation.AttrRes
import androidx.annotation.StyleRes
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isGone
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import eu.darken.sdmse.R
import eu.darken.sdmse.common.ca.CaString
import eu.darken.sdmse.common.debug.logging.Logging.Priority.VERBOSE
import eu.darken.sdmse.common.debug.logging.log
Expand All @@ -26,9 +24,6 @@ class AutomationControlView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {

private val ui = AutomationControlViewBinding.inflate(layoutInflator, this)
private val wiggleAnim = AnimationUtils.loadAnimation(context, R.anim.anim_wiggle)

private var clickCount = 0

fun setProgress(data: Progress.Data?) {
log(VERBOSE) { "setProgress($data)" }
Expand Down Expand Up @@ -96,11 +91,5 @@ class AutomationControlView @JvmOverloads constructor(

fun setCancelListener(listener: OnClickListener?) {
ui.cancelAction.setOnClickListener(listener)
ui.clickScreenMascotContainer.apply {
setOnClickListener {
clickCount++
if (clickCount % 5 == 0) startAnimation(wiggleAnim)
}
}
}
}

0 comments on commit 8d28e60

Please sign in to comment.