diff options
author | Allan Wang <me@allanwang.ca> | 2021-04-17 17:49:18 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-04-17 17:49:18 -0700 |
commit | d96d1d06a7c1581b97c042f2a74e7cd5b1c2546e (patch) | |
tree | 60ad049189d448132d1b99ea041a8f80a83ffe22 /app/src/main/kotlin/com/pitchedapps/frost/views | |
parent | cb2adc75d8e105adfdf0d5646c1a9b6d39c292f8 (diff) | |
download | frost-d96d1d06a7c1581b97c042f2a74e7cd5b1c2546e.tar.gz frost-d96d1d06a7c1581b97c042f2a74e7cd5b1c2546e.tar.bz2 frost-d96d1d06a7c1581b97c042f2a74e7cd5b1c2546e.zip |
Update theme providers and readd koin modules
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views')
4 files changed, 23 insertions, 15 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/BadgedIcon.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/BadgedIcon.kt index 78af4edf..61be271f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/BadgedIcon.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/BadgedIcon.kt @@ -31,20 +31,25 @@ import com.mikepenz.iconics.typeface.IIcon import com.pitchedapps.frost.databinding.ViewBadgedIconBinding import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.prefs.Prefs -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject +import dagger.hilt.android.AndroidEntryPoint +import javax.inject.Inject /** * Created by Allan Wang on 2017-06-19. */ +@AndroidEntryPoint class BadgedIcon @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), KoinComponent { +) : ConstraintLayout(context, attrs, defStyleAttr) { + + @Inject + lateinit var prefs: Prefs + + @Inject + lateinit var themeProvider: ThemeProvider - private val prefs: Prefs by inject() - private val themeProvider: ThemeProvider by inject() private val binding: ViewBadgedIconBinding = ViewBadgedIconBinding.inflate(LayoutInflater.from(context), this, true) @@ -54,7 +59,8 @@ class BadgedIcon @JvmOverloads constructor( private fun ViewBadgedIconBinding.init() { val badgeColor = - prefs.mainActivityLayout.backgroundColor(themeProvider).withAlpha(255).colorToForeground(0.2f) + prefs.mainActivityLayout.backgroundColor(themeProvider).withAlpha(255) + .colorToForeground(0.2f) val badgeBackground = GradientDrawable( GradientDrawable.Orientation.BOTTOM_TOP, diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt index 177b8862..5700b54b 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt @@ -77,7 +77,8 @@ abstract class FrostContentView<out T> @JvmOverloads constructor( defStyleAttr: Int = 0, defStyleRes: Int = 0 ) : FrameLayout(context, attrs, defStyleAttr, defStyleRes), - FrostContentParent, KoinComponent where T : View, T : FrostContentCore { + FrostContentParent, + KoinComponent where T : View, T : FrostContentCore { private val prefs: Prefs by inject() private val themeProvider: ThemeProvider by inject() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostRecyclerView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostRecyclerView.kt index 847874f4..2ab00916 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostRecyclerView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostRecyclerView.kt @@ -29,9 +29,9 @@ import com.pitchedapps.frost.contracts.FrostContentParent import com.pitchedapps.frost.fragments.RecyclerContentContract import com.pitchedapps.frost.prefs.Prefs import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.launch +import javax.inject.Inject /** * Created by Allan Wang on 2017-05-29. diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt index a76aeea0..ca57732c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt @@ -192,12 +192,12 @@ class FrostVideoViewer @JvmOverloads constructor( fun updateLocation() { with(binding) { viewTreeObserver.addOnGlobalLayoutListener(object : - ViewTreeObserver.OnGlobalLayoutListener { - override fun onGlobalLayout() { - video.updateLocation() - viewTreeObserver.removeOnGlobalLayoutListener(this) - } - }) + ViewTreeObserver.OnGlobalLayoutListener { + override fun onGlobalLayout() { + video.updateLocation() + viewTreeObserver.removeOnGlobalLayoutListener(this) + } + }) } } @@ -206,7 +206,8 @@ class FrostVideoViewer @JvmOverloads constructor( if (video.isExpanded) videoToolbar.fadeIn( duration = CONTROL_ANIMATION_DURATION, - onStart = { videoToolbar.visible() }) + onStart = { videoToolbar.visible() } + ) } } |