Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
mars885 committed Sep 27, 2024
1 parent 7247af4 commit cf5f41d
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ package com.paulrybitskyi.gamedge.feature.info.presentation.widgets.header

import android.content.Context
import android.content.res.ColorStateList
import android.graphics.drawable.Animatable
import android.util.Log
import android.widget.ImageView
import androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat
import androidx.compose.animation.graphics.res.animatedVectorResource
import androidx.compose.animation.graphics.res.rememberAnimatedVectorPainter
import androidx.compose.animation.graphics.vector.AnimatedImageVector
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -70,8 +63,6 @@ import androidx.constraintlayout.compose.Dimension
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.paulrybitskyi.commons.ktx.getCompatDrawable
import com.paulrybitskyi.commons.ktx.onClick
import com.paulrybitskyi.commons.ktx.postAction
import com.paulrybitskyi.commons.ktx.postActionDelayed
import com.paulrybitskyi.gamedge.common.ui.clickable
import com.paulrybitskyi.gamedge.common.ui.theme.GamedgeTheme
import com.paulrybitskyi.gamedge.common.ui.theme.lightScrim
Expand Down Expand Up @@ -329,7 +320,9 @@ private class LikeButton(context: Context) : FloatingActionButton(context) {
}

var isLiked: Boolean
set(value) { setImageState(intArrayOf(if(value) STATE_CHECKED_ON else STATE_CHECKED_OFF), true) }
set(value) {
setImageState(intArrayOf(if (value) STATE_CHECKED_ON else STATE_CHECKED_OFF), true)
}
get() = drawableState.contains(STATE_CHECKED_ON)

override fun onAttachedToWindow() {
Expand All @@ -340,7 +333,7 @@ private class LikeButton(context: Context) : FloatingActionButton(context) {
// and comes back, then the like button resets its icon from a filled heart to an empty
// heart. To fix it, when this view gets reattached to the window, we are asking the button
// to reset its state and then go to the liked state again.
if(isLiked) {
if (isLiked) {
isLiked = false
isLiked = true
}
Expand Down

0 comments on commit cf5f41d

Please sign in to comment.