Skip to content

Commit

Permalink
Dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrivoruchko committed Jun 3, 2021
1 parent 8cb3876 commit 00b0d8a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "info.dvkr.screenstream"
minSdkVersion(21)
targetSdkVersion(30)
versionCode = 30603
versionName = "3.6.3"
versionCode = 30604
versionName = "3.6.4"
resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "ca")

vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -81,12 +81,12 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")

implementation("androidx.core:core-ktx:1.5.0-rc02")
implementation("androidx.core:core-ktx:1.5.0")
implementation("androidx.activity:activity-ktx:1.2.3")
implementation("androidx.fragment:fragment-ktx:1.3.3")
implementation("androidx.appcompat:appcompat:1.3.0-rc01")
implementation("androidx.fragment:fragment-ktx:1.3.4")
implementation("androidx.appcompat:appcompat:1.3.0")
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
implementation("androidx.recyclerview:recyclerview:1.2.0")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("com.google.android.material:material:1.3.0")

implementation("androidx.navigation:navigation-fragment-ktx:2.3.5")
Expand All @@ -102,7 +102,7 @@ dependencies {
implementation(fileTree("libs/bottomsheets-release.aar"))
// implementation("com.afollestad.material-dialogs:bottomsheets:3.3.0")

implementation("io.insert-koin:koin-android:3.0.1")
implementation("io.insert-koin:koin-android:3.0.2")
implementation("com.github.iamironz:binaryprefs:1.0.1")
implementation("com.elvishew:xlog:1.9.0")

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {

dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
classpath("com.google.gms:google-services:4.3.8")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.6.1")
}
Expand Down
10 changes: 5 additions & 5 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
versionCode = 30603
versionName = "3.6.3"
versionCode = 30604
versionName = "3.6.4"
}

compileOptions {
Expand All @@ -28,11 +28,11 @@ android {

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.0")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.10")

implementation("androidx.core:core:1.5.0-rc02")
implementation("androidx.core:core:1.5.0")

implementation("io.ktor:ktor-server-cio:1.5.4")
implementation("io.ktor:ktor-server-cio:1.6.0")

implementation("com.github.iamironz:binaryprefs:1.0.1")
implementation("com.elvishew:xlog:1.9.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import info.dvkr.screenstream.data.state.helper.MediaProjectionHelper
import info.dvkr.screenstream.data.state.helper.NetworkHelper
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import java.util.concurrent.LinkedBlockingDeque

class AppStateMachineImpl(
context: Context,
Expand Down Expand Up @@ -91,8 +92,10 @@ class AppStateMachineImpl(
XLog.d(getLog("sendEvent", "Event: $event"))

try {
_eventDeque.addLast(event)
_eventSharedFlow.tryEmit(event) || throw IllegalStateException("_eventSharedFlow IsFull")
} catch (th: Throwable) {
XLog.e(getLog("sendEvent", _eventDeque.toString()))
XLog.e(getLog("sendEvent"), th)
coroutineScope.launch(NonCancellable) {
onEffect(
Expand All @@ -106,6 +109,7 @@ class AppStateMachineImpl(
private var streamState = StreamState()
private var previousStreamState = StreamState()
private val _eventSharedFlow = MutableSharedFlow<AppStateMachine.Event>(extraBufferCapacity = 32)
private val _eventDeque = LinkedBlockingDeque<AppStateMachine.Event>()

init {
XLog.d(getLog("init"))
Expand All @@ -118,7 +122,7 @@ class AppStateMachineImpl(
streamState = when (event) {
is InternalEvent.DiscoverAddress -> discoverAddress(streamState)
is InternalEvent.StartServer -> startServer(streamState)
is InternalEvent.ComponentError -> componentError(streamState, event.appError)
is InternalEvent.ComponentError -> componentError(streamState, event.appError, false)
is InternalEvent.StartStopFromWebPage -> startStopFromWebPage(streamState)
is InternalEvent.RestartServer -> restartServer(streamState, event.reason)
is InternalEvent.ScreenOff -> screenOff(streamState)
Expand All @@ -135,12 +139,13 @@ class AppStateMachineImpl(

if (streamState.isPublicStatePublishRequired(previousStreamState)) onEffect(streamState.toPublicState())

_eventDeque.pollFirst()
XLog.i(this@AppStateMachineImpl.getLog("eventSharedFlow.onEach", "New state:${streamState.state}"))
}
}
.catch { cause ->
XLog.e(this@AppStateMachineImpl.getLog("eventSharedFlow.catch"), cause)
streamState = componentError(streamState, FatalError.CoroutineException)
streamState = componentError(streamState, FatalError.CoroutineException, true)
onEffect(streamState.toPublicState())
}
.collect()
Expand Down Expand Up @@ -349,8 +354,9 @@ class AppStateMachineImpl(
)
}

private fun componentError(streamState: StreamState, appError: AppError): StreamState {
private fun componentError(streamState: StreamState, appError: AppError, report: Boolean): StreamState {
XLog.d(getLog("componentError"))
if (report) XLog.e(getLog("componentError"), appError)

return stopProjection(streamState).copy(state = StreamState.State.ERROR, appError = appError)
}
Expand Down

0 comments on commit 00b0d8a

Please sign in to comment.