Skip to content

Commit

Permalink
Bug fix, dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrivoruchko committed Nov 18, 2021
1 parent e0ef742 commit f22b115
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 19 deletions.
16 changes: 9 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ android {
applicationId = "info.dvkr.screenstream"
minSdkVersion(21)
targetSdkVersion(31)
versionCode = 30803
versionName = "3.8.3"
versionCode = 30804
versionName = "3.8.4"
resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "ca", "uk", "nl")

vectorDrawables.useSupportLibrary = true
}

buildTypes {
getByName("debug") {
applicationIdSuffix ".dev"
minifyEnabled = false
shrinkResources = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
Expand Down Expand Up @@ -81,6 +82,7 @@ android {

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}

Expand All @@ -94,15 +96,15 @@ dependencies {

implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.activity:activity-ktx:1.4.0")
implementation("androidx.fragment:fragment-ktx:1.4.0-beta01")
implementation("androidx.fragment:fragment-ktx:1.4.0")
implementation("androidx.appcompat:appcompat:1.4.0-rc01")
implementation("androidx.constraintlayout:constraintlayout:2.1.1")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.window:window:1.0.0-beta03")
implementation("androidx.window:window:1.0.0-beta04")

implementation("androidx.navigation:navigation-fragment-ktx:2.4.0-beta01")
implementation("androidx.navigation:navigation-ui-ktx:2.4.0-beta01")
implementation("androidx.navigation:navigation-fragment-ktx:2.4.0-beta02")
implementation("androidx.navigation:navigation-ui-ktx:2.4.0-beta02")
implementation("androidx.lifecycle:lifecycle-livedata:2.4.0")
implementation("androidx.lifecycle:lifecycle-common:2.4.0")

Expand All @@ -128,7 +130,7 @@ dependencies {
firebaseImplementation("com.google.firebase:firebase-analytics:20.0.0")
firebaseImplementation("com.google.firebase:firebase-crashlytics:18.2.4")
firebaseImplementation("com.google.android.gms:play-services-ads:20.4.0")
firebaseImplementation("androidx.work:work-runtime:2.7.0") // Temp fix for AdMob Android 12
firebaseImplementation("androidx.work:work-runtime:2.7.1") // Temp fix for AdMob Android 12

debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package info.dvkr.screenstream

import android.os.StrictMode
import androidx.fragment.app.strictmode.FragmentStrictMode
import com.elvishew.xlog.LogConfiguration
import com.elvishew.xlog.XLog
import com.elvishew.xlog.printer.AndroidPrinter
Expand All @@ -26,6 +27,16 @@ class ScreenStreamApp : BaseApp() {
.build()
)

FragmentStrictMode.defaultPolicy =
FragmentStrictMode.Policy.Builder()
.detectFragmentReuse()
.detectFragmentTagUsage()
.detectRetainInstanceUsage()
.detectSetUserVisibleHint()
.detectTargetFragmentUsage()
.detectWrongFragmentContainer()
.build()

val logConfiguration = LogConfiguration.Builder().tag("SSApp").build()
XLog.init(logConfiguration, AndroidPrinter(), filePrinter)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package info.dvkr.screenstream

import android.os.StrictMode
import androidx.fragment.app.strictmode.FragmentStrictMode
import com.elvishew.xlog.LogConfiguration
import com.elvishew.xlog.XLog
import com.elvishew.xlog.printer.AndroidPrinter
Expand All @@ -25,6 +26,16 @@ class ScreenStreamApp : BaseApp() {
.build()
)

FragmentStrictMode.defaultPolicy =
FragmentStrictMode.Policy.Builder()
.detectFragmentReuse()
.detectFragmentTagUsage()
.detectRetainInstanceUsage()
.detectSetUserVisibleHint()
.detectTargetFragmentUsage()
.detectWrongFragmentContainer()
.build()

val logConfiguration = LogConfiguration.Builder().tag("SSApp").build()
XLog.init(logConfiguration, AndroidPrinter(), filePrinter)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class AppService : Service() {
override fun onDestroy() {
XLog.d(getLog("onDestroy"))
isRunning = false
runBlocking(coroutineScope.coroutineContext) { appStateMachine?.destroy() }
runBlocking(coroutineScope.coroutineContext) { withTimeout(2000) { appStateMachine?.destroy() } }
appStateMachine = null
coroutineScope.cancel(CancellationException("AppService.destroy"))
stopForeground(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class SettingsImageFragment : Fragment(R.layout.fragment_settings_image) {

with(tietDialogSettingsResize) {
addTextChangedListener(SimpleTextWatcher { text ->
val isValid = text.length in 2..3 && text.toString().toInt() in 10..150
val isValid = text.length in 2..3 && text.toString().toIntOrNull() ?: -1 in 10..150
this@Dialog.setActionButtonEnabled(WhichButton.POSITIVE, isValid)
val newResizeFactor =
(if (isValid) text.toString().toInt() else settings.resizeFactor) / 100f
Expand Down Expand Up @@ -303,10 +303,10 @@ class SettingsImageFragment : Fragment(R.layout.fragment_settings_image) {
dialog: MaterialDialog,
topView: EditText, bottomView: EditText, leftView: EditText, rightView: EditText, errorView: TextView
) {
val topCrop = topView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toInt() }
val bottomCrop = bottomView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toInt() }
val leftCrop = leftView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toInt() }
val rightCrop = rightView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toInt() }
val topCrop = topView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toIntOrNull() ?: -1 }
val bottomCrop = bottomView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toIntOrNull() ?: -1 }
val leftCrop = leftView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toIntOrNull() ?: -1 }
val rightCrop = rightView.text.let { if (it.isNullOrBlank()) -1 else it.toString().toIntOrNull() ?: -1 }

if (topCrop >= 0 && bottomCrop >= 0 && leftCrop >= 0 && rightCrop >= 0) {
dialog.setActionButtonEnabled(WhichButton.POSITIVE, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ class StreamFragment : AdFragment(R.layout.fragment_stream) {
clipboard?.setPrimaryClip(
ClipData.newPlainText(tvItemDeviceAddress.text, tvItemDeviceAddress.text)
)
Toast.makeText(
requireContext().applicationContext, R.string.stream_fragment_copied, Toast.LENGTH_LONG
).show()
Toast.makeText(requireContext(), R.string.stream_fragment_copied, Toast.LENGTH_LONG).show()
}
ivItemDeviceAddressShare.setOnClickListener { shareAddress(fullAddress) }
ivItemDeviceAddressQr.setOnClickListener { showQrCode(fullAddress) }
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:7.0.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0")
classpath("com.google.gms:google-services:4.3.10")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.8.0")
}
Expand Down
5 changes: 3 additions & 2 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ android {

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.31")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.0")

implementation("androidx.core:core:1.7.0")
implementation("androidx.window:window:1.0.0-beta03")
implementation("androidx.window:window:1.0.0-beta04")

implementation("io.ktor:ktor-server-cio:1.6.5")

Expand Down

0 comments on commit f22b115

Please sign in to comment.