aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ActivityConstructionTest.kt24
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt15
2 files changed, 32 insertions, 7 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ActivityConstructionTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ActivityConstructionTest.kt
new file mode 100644
index 00000000..bad484ef
--- /dev/null
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ActivityConstructionTest.kt
@@ -0,0 +1,24 @@
+package com.pitchedapps.frost.activities
+
+import android.app.Activity
+import android.os.Bundle
+import androidx.test.core.app.ActivityScenario
+import dagger.hilt.android.testing.HiltAndroidRule
+import dagger.hilt.android.testing.HiltAndroidTest
+import org.junit.Rule
+import org.junit.Test
+
+@HiltAndroidTest
+class ActivityConstructionTest {
+
+ @get:Rule
+ val hiltRule = HiltAndroidRule(this)
+
+ @Test
+ fun imageActivity() {
+ launch<ImageActivity>()
+ }
+
+ private inline fun <reified A : Activity> launch(activityOptions: Bundle? = null) =
+ ActivityScenario.launch(A::class.java, activityOptions)
+} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
index c5b8bdaa..e3b607a3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
@@ -137,8 +137,9 @@ class ImageActivity : KauBaseActivity() {
lateinit var binding: ActivityImageBinding
private var bottomBehavior: BottomSheetBehavior<View>? = null
- private val baseBackgroundColor = if (prefs.blackMediaBg) Color.BLACK
- else themeProvider.bgColor.withMinAlpha(235)
+ private val baseBackgroundColor: Int
+ get() = if (prefs.blackMediaBg) Color.BLACK
+ else themeProvider.bgColor.withMinAlpha(235)
private fun loadError(e: Throwable) {
if (e.message?.contains("<!DOCTYPE html>") == true) {
@@ -226,11 +227,11 @@ class ImageActivity : KauBaseActivity() {
setState(FabStates.SHARE)
}
imagePhoto.setOnImageEventListener(object :
- SubsamplingScaleImageView.DefaultOnImageEventListener() {
- override fun onImageLoadError(e: Exception) {
- loadError(e)
- }
- })
+ SubsamplingScaleImageView.DefaultOnImageEventListener() {
+ override fun onImageLoadError(e: Exception) {
+ loadError(e)
+ }
+ })
activityThemer.setFrostColors {
themeWindow = false
}