Skip to content

Commit

Permalink
Merge pull request #20 from djkovrik/release/1.3.0
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
djkovrik committed Jul 23, 2023
2 parents 0d7a0c5 + cf9529e commit 9dce1da
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId = "com.sedsoftware.blinktracker"
minSdk = 26
targetSdk = 33
versionCode = 100200
versionName = "1.2.0"
versionCode = 100300
versionName = "1.3.0"
setProperty("archivesBaseName", applicationId)

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/sedsoftware/blinktracker/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.sedsoftware.blinktracker.database.StatisticsRepositoryReal
import com.sedsoftware.blinktracker.root.BlinkRoot
import com.sedsoftware.blinktracker.root.integration.BlinkRootComponent
import com.sedsoftware.blinktracker.settings.AppSettings
import com.sedsoftware.blinktracker.settings.ObservableOpacityProvider
import com.sedsoftware.blinktracker.settings.Settings
import com.sedsoftware.blinktracker.tools.AppErrorHandler
import com.sedsoftware.blinktracker.tools.AppNotificationsManager
import com.sedsoftware.blinktracker.ui.BlinkRootContent
Expand Down Expand Up @@ -60,7 +60,7 @@ class MainActivity : ComponentActivity(), PictureInPictureLauncher {
}

private var currentWindowAlpha: Float = 1f
private var opacityProvider: ObservableOpacityProvider? = null
private var settings: Settings? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -75,14 +75,14 @@ class MainActivity : ComponentActivity(), PictureInPictureLauncher {
.build()

_imageProcessor = FaceDetectorProcessor(faceDetectorOptions)
opacityProvider = ObservableOpacityProvider(applicationContext)
settings = AppSettings(applicationContext)

_root = BlinkRootComponent(
componentContext = defaultComponentContext(),
storeFactory = DefaultStoreFactory(),
errorHandler = errorHandler,
notificationsManager = AppNotificationsManager(this),
settings = AppSettings(applicationContext),
settings = settings!!,
repo = StatisticsRepositoryReal(applicationContext),
pipLauncher = this,
)
Expand All @@ -91,7 +91,7 @@ class MainActivity : ComponentActivity(), PictureInPictureLauncher {
.onEach { root.onFaceDataChanged(it) }
.launchIn(lifecycleScope)

opacityProvider?.opacity
settings?.observableOpacity
?.onEach { currentWindowAlpha = it }
?.launchIn(lifecycleScope)

Expand Down Expand Up @@ -123,6 +123,7 @@ class MainActivity : ComponentActivity(), PictureInPictureLauncher {
_root = null
_imageProcessor?.run { this.stop() }
_imageProcessor = null
settings = null
enableKeepScreenOn(false)
}

Expand Down
2 changes: 1 addition & 1 deletion distribution/changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* Additional statistic filters
* Added new option to control minimized window opacity (#19)
2 changes: 1 addition & 1 deletion distribution/whatsnew/whatsnew-en-US
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Additional statistic filters
Added new option to control minimized window opacity
2 changes: 1 addition & 1 deletion distribution/whatsnew/whatsnew-ru-RU
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Дополнительные фильтры для статистики
Добавлена дополнительная опция для управления непрозрачностью свернутого окна
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class AppSettings(
private val launchMinimizedEnabledKey: Preferences.Key<Boolean> = booleanPreferencesKey(PreferenceKey.LAUNCH_MINIMIZED)
private val minimizedOpacityKey: Preferences.Key<Float> = floatPreferencesKey(PreferenceKey.OPACITY)

override val observableOpacity: Flow<Float> =
Store.get(context).data.map { preferences ->
preferences[minimizedOpacityKey] ?: 1f
}

override suspend fun getPerMinuteThreshold(): Flow<Float> =
getPrefsValue(perMinuteThresholdKey, PER_MINUTE_THRESHOLD_DEFAULT)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.sedsoftware.blinktracker.settings
import kotlinx.coroutines.flow.Flow

interface Settings {
val observableOpacity: Flow<Float>

suspend fun getPerMinuteThreshold(): Flow<Float>
suspend fun getNotifySoundEnabled(): Flow<Boolean>
suspend fun getNotifyVibrationEnabled(): Flow<Boolean>
Expand Down

0 comments on commit 9dce1da

Please sign in to comment.