Skip to content

Commit 7cb0ee9

Browse files
committedDec 2, 2020
Dependency update
Bug fixes
1 parent d2ecd2c commit 7cb0ee9

File tree

12 files changed

+55
-126
lines changed

12 files changed

+55
-126
lines changed
 

‎app/build.gradle

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: "com.android.application"
22
apply plugin: "kotlin-android"
3-
apply plugin: "kotlin-android-extensions"
3+
apply plugin: "kotlin-parcelize"
44
apply plugin: "com.google.gms.google-services"
55
apply plugin: "com.google.firebase.crashlytics"
66

@@ -12,8 +12,8 @@ android {
1212
applicationId = "info.dvkr.screenstream"
1313
minSdkVersion(21)
1414
targetSdkVersion(30)
15-
versionCode = 30501
16-
versionName = "3.5.1"
15+
versionCode = 30502
16+
versionName = "3.5.2"
1717
resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "cat")
1818

1919
vectorDrawables.useSupportLibrary = true
@@ -70,15 +70,14 @@ android {
7070

7171
kotlinOptions {
7272
jvmTarget = JavaVersion.VERSION_1_8.toString()
73-
// freeCompilerArgs += ["-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"]
7473
}
7574
}
7675

7776
dependencies {
7877
implementation(project(":data"))
7978

80-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1")
81-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1")
79+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
80+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2")
8281

8382
implementation("com.google.android.material:material:1.2.1")
8483
implementation("androidx.appcompat:appcompat:1.2.0")
@@ -99,16 +98,16 @@ dependencies {
9998
implementation(fileTree("libs/bottomsheets-release.aar"))
10099
// implementation("com.afollestad.material-dialogs:bottomsheets:3.3.0")
101100

102-
implementation("org.koin:koin-android:2.1.6")
101+
implementation("org.koin:koin-android:2.2.1")
103102
implementation("com.github.iamironz:binaryprefs:1.0.1")
104-
implementation("com.elvishew:xlog:1.7.0")
103+
implementation('com.elvishew:xlog:1.7.2')
105104

106-
firebaseImplementation("com.google.android.play:core:1.8.3")
105+
firebaseImplementation('com.google.android.play:core:1.9.0')
107106
firebaseImplementation("com.google.android.play:core-ktx:1.8.1") {
108107
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
109108
}
110109
firebaseReleaseImplementation("com.google.firebase:firebase-analytics:18.0.0")
111-
firebaseReleaseImplementation("com.google.firebase:firebase-crashlytics:17.2.2")
110+
firebaseReleaseImplementation('com.google.firebase:firebase-crashlytics:17.3.0')
112111

113112
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.5")
114113
}

‎app/proguard-rules.pro

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
-repackageclasses
2525

2626
-keepnames class info.dvkr.screenstream.** { *; }
27-
27+
-keep class **.R$* {
28+
<fields>;
29+
}
2830
#Crashlytics
2931
-keepattributes *Annotation*
3032
-keepattributes SourceFile,LineNumberTable

‎app/src/main/kotlin/info/dvkr/screenstream/receiver/BootReceiver.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import com.elvishew.xlog.XLog
88
import info.dvkr.screenstream.data.other.getLog
99
import info.dvkr.screenstream.data.settings.SettingsReadOnly
1010
import info.dvkr.screenstream.service.helper.IntentAction
11-
import org.koin.core.KoinComponent
12-
import org.koin.core.inject
11+
import org.koin.core.component.KoinComponent
12+
import org.koin.core.component.inject
1313

1414
class BootReceiver : BroadcastReceiver(), KoinComponent {
1515

‎app/src/main/kotlin/info/dvkr/screenstream/service/AppService.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ class AppService : Service() {
3535
companion object {
3636
var isRunning: Boolean = false
3737

38-
fun getAppServiceIntent(context: Context): Intent =
39-
Intent(context.applicationContext, AppService::class.java)
38+
fun getAppServiceIntent(context: Context): Intent = Intent(context.applicationContext, AppService::class.java)
4039

41-
fun startForeground(context: Context, intent: Intent = getAppServiceIntent(context)) =
42-
ContextCompat.startForegroundService(context, intent)
40+
fun startForeground(context: Context, intent: Intent) = context.startService(intent)
4341
}
4442

4543
inner class AppServiceBinder : Binder() {

‎app/src/main/kotlin/info/dvkr/screenstream/service/helper/IntentAction.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.elvishew.xlog.XLog
77
import info.dvkr.screenstream.data.other.getLog
88
import info.dvkr.screenstream.service.AppService
99
import info.dvkr.screenstream.ui.activity.AppActivity
10-
import kotlinx.android.parcel.Parcelize
10+
import kotlinx.parcelize.Parcelize
1111

1212
sealed class IntentAction : Parcelable {
1313
internal companion object {
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package info.dvkr.screenstream.ui.fragment
22

3-
import android.content.ActivityNotFoundException
43
import android.content.Intent
54
import android.net.Uri
65
import android.os.Bundle
76
import android.view.View
87
import android.widget.Toast
98
import androidx.fragment.app.Fragment
10-
import com.afollestad.materialdialogs.MaterialDialog
11-
import com.afollestad.materialdialogs.lifecycle.lifecycleOwner
129
import com.elvishew.xlog.XLog
1310
import info.dvkr.screenstream.R
1411
import info.dvkr.screenstream.data.other.getLog
@@ -28,99 +25,48 @@ class AboutFragment : Fragment(R.layout.fragment_about) {
2825
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
2926
super.onViewCreated(view, savedInstanceState)
3027

31-
with(requireActivity()) {
32-
try {
33-
version = packageManager.getPackageInfo(packageName, 0).versionName
34-
binding.tvFragmentAboutVersion.text = getString(R.string.about_fragment_app_version, version)
35-
} catch (t: Throwable) {
36-
XLog.e(getLog("onViewCreated", "getPackageInfo"), t)
37-
}
28+
val packageName = requireContext().packageName
3829

39-
binding.tvFragmentAboutVersion.setOnClickListener {
40-
settingsLoggingVisibleCounter++
41-
if (settingsLoggingVisibleCounter >= 5) {
42-
settings.loggingVisible = true
43-
Toast.makeText(requireContext().applicationContext, "Logging option enabled", Toast.LENGTH_LONG)
44-
.show()
45-
}
46-
}
30+
runCatching {
31+
version = requireContext().packageManager.getPackageInfo(packageName, 0).versionName
32+
binding.tvFragmentAboutVersion.text = getString(R.string.about_fragment_app_version, version)
33+
}.onFailure {
34+
XLog.e(getLog("onViewCreated", "getPackageInfo"), it)
35+
}
4736

48-
binding.bFragmentAboutRate.setOnClickListener {
49-
try {
50-
startActivity(
51-
Intent(
52-
Intent.ACTION_VIEW,
53-
Uri.parse("market://details?id=$packageName")
54-
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
55-
)
56-
} catch (ignore: ActivityNotFoundException) {
57-
startActivity(
58-
Intent(
59-
Intent.ACTION_VIEW,
60-
Uri.parse("https://play.google.com/store/apps/details?id=$packageName")
61-
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
62-
)
63-
}
37+
binding.tvFragmentAboutVersion.setOnClickListener {
38+
settingsLoggingVisibleCounter++
39+
if (settingsLoggingVisibleCounter >= 5) {
40+
settings.loggingVisible = true
41+
Toast.makeText(requireContext(), "Logging option enabled", Toast.LENGTH_LONG).show()
6442
}
6543
}
6644

67-
binding.bFragmentAboutDeveloperEmail.setOnClickListener {
68-
MaterialDialog(requireActivity()).show {
69-
lifecycleOwner(viewLifecycleOwner)
70-
title(R.string.about_fragment_write_email_dialog)
71-
icon(R.drawable.ic_about_feedback_24dp)
72-
positiveButton(android.R.string.cancel)
73-
negativeButton(android.R.string.yes) {
74-
val emailIntent = Intent(Intent.ACTION_SENDTO)
75-
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
76-
.setData(Uri.Builder().scheme("mailto").build())
77-
.putExtra(Intent.EXTRA_EMAIL, arrayOf("Dmitriy Krivoruchko <dkrivoruchko@gmail.com>"))
78-
.putExtra(Intent.EXTRA_SUBJECT, "Screen Stream Feedback ($version)")
79-
startActivity(
80-
Intent.createChooser(emailIntent, getString(R.string.about_fragment_email_chooser_header))
81-
)
82-
}
45+
binding.bFragmentAboutRate.setOnClickListener {
46+
openStringUrl("market://details?id=$packageName") {
47+
openStringUrl("https://play.google.com/store/apps/details?id=$packageName")
8348
}
8449
}
8550

8651
binding.bFragmentAboutSources.setOnClickListener {
87-
try {
88-
startActivity(
89-
Intent(
90-
Intent.ACTION_VIEW,
91-
Uri.parse("https://github.com/dkrivoruchko/ScreenStream")
92-
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
93-
)
94-
95-
} catch (ignore: ActivityNotFoundException) {
96-
}
52+
openStringUrl("https://github.com/dkrivoruchko/ScreenStream")
9753
}
9854

9955
binding.bFragmentPrivacyPolicy.setOnClickListener {
100-
try {
101-
startActivity(
102-
Intent(
103-
Intent.ACTION_VIEW,
104-
Uri.parse("https://github.com/dkrivoruchko/ScreenStream/blob/master/PrivacyPolicy.md")
105-
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
106-
)
107-
108-
} catch (ignore: ActivityNotFoundException) {
109-
}
56+
openStringUrl("https://github.com/dkrivoruchko/ScreenStream/blob/master/PrivacyPolicy.md")
11057
}
11158

11259
binding.bFragmentLicense.setOnClickListener {
113-
try {
114-
startActivity(
115-
Intent(
116-
Intent.ACTION_VIEW,
117-
Uri.parse("https://github.com/dkrivoruchko/ScreenStream/blob/master/LICENSE")
118-
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
119-
)
120-
121-
} catch (ignore: ActivityNotFoundException) {
122-
}
60+
openStringUrl("https://github.com/dkrivoruchko/ScreenStream/blob/master/LICENSE")
12361
}
12462

12563
}
64+
65+
private fun openStringUrl(url: String, onFailure: () -> Unit = {}) {
66+
runCatching {
67+
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
68+
}.onFailure {
69+
runCatching { onFailure.invoke() }
70+
}
71+
}
12672
}

‎app/src/main/res/layout/fragment_about.xml

+1-15
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,6 @@
6464
app:layout_constraintStart_toStartOf="parent"
6565
app:layout_constraintTop_toBottomOf="@+id/tv_fragment_about_developer" />
6666

67-
<com.google.android.material.button.MaterialButton
68-
android:id="@+id/b_fragment_about_developer_email"
69-
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Icon"
70-
android:layout_width="wrap_content"
71-
android:layout_height="wrap_content"
72-
android:paddingStart="16dp"
73-
android:paddingEnd="16dp"
74-
android:text="@string/about_fragment_write_email"
75-
app:icon="@drawable/ic_about_feedback_24dp"
76-
app:iconPadding="8dp"
77-
app:layout_constraintEnd_toEndOf="parent"
78-
app:layout_constraintStart_toStartOf="parent"
79-
app:layout_constraintTop_toBottomOf="@+id/b_fragment_about_rate" />
80-
8167
<com.google.android.material.button.MaterialButton
8268
android:id="@+id/b_fragment_about_sources"
8369
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Icon"
@@ -90,7 +76,7 @@
9076
app:iconPadding="8dp"
9177
app:layout_constraintEnd_toEndOf="parent"
9278
app:layout_constraintStart_toStartOf="parent"
93-
app:layout_constraintTop_toBottomOf="@+id/b_fragment_about_developer_email" />
79+
app:layout_constraintTop_toBottomOf="@+id/b_fragment_about_rate" />
9480

9581
<com.google.android.material.button.MaterialButton
9682
android:id="@+id/b_fragment_privacy_policy"

‎app/src/main/res/values-zh/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<string name="pref_fps_summary">设置最大帧率</string>
111111
<string name="pref_fps_dialog">设置最大同步率\n值: 1–60 (默认: 30)</string>
112112
<string name="pref_jpeg_quality">JPEG 压缩质量</string>
113-
<string name="pref_jpeg_quality_summary">设置 JPEG 压缩画质</string>
113+
<string name="pref_jpeg_quality_summary">设置JPEG压缩画质</string>
114114
<string name="pref_jpeg_quality_dialog">顺时针旋转方向.\n值: 10–100 (默认: 80)</string>
115115
<string name="pref_settings_security">安全</string>
116116
<string name="pref_enable_pin">启用 pin 码</string>

‎build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath("com.android.tools.build:gradle:4.0.1")
9-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
8+
classpath("com.android.tools.build:gradle:4.1.1")
9+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20")
1010
classpath("com.google.gms:google-services:4.3.4")
11-
classpath("com.google.firebase:firebase-crashlytics-gradle:2.3.0")
11+
classpath("com.google.firebase:firebase-crashlytics-gradle:2.4.1")
1212
}
1313
}
1414

‎data/build.gradle

+6-8
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion(21)
1010
targetSdkVersion(30)
11-
versionCode = 30501
12-
versionName = "3.5.1"
11+
versionCode = 30502
12+
versionName = "3.5.2"
1313
}
1414

1515
compileOptions {
@@ -23,13 +23,11 @@ android {
2323

2424
kotlinOptions {
2525
jvmTarget = JavaVersion.VERSION_1_8.toString()
26-
// freeCompilerArgs += ["-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"]
2726
}
2827
}
2928

3029
dependencies {
31-
implementation("org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.4.10")
32-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1")
30+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
3331

3432
implementation("androidx.core:core-ktx:1.3.2")
3533
implementation("androidx.arch.core:core-common:2.1.0")
@@ -40,12 +38,12 @@ dependencies {
4038
implementation("io.reactivex:rxjava:1.3.8")
4139
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
4240

43-
implementation("io.netty:netty-codec-http:4.1.34.Final")
44-
implementation("io.netty:netty-handler:4.1.34.Final")
41+
implementation("io.netty:netty-codec-http:4.1.54.Final")
42+
implementation("io.netty:netty-handler:4.1.54.Final")
4543
implementation("io.reactivex:rxnetty-common:0.5.3")
4644
implementation("io.reactivex:rxnetty-http:0.5.3")
4745

4846
implementation("com.google.zxing:core:3.3.3")
4947
implementation("com.github.iamironz:binaryprefs:1.0.1")
50-
implementation("com.elvishew:xlog:1.7.0")
48+
implementation('com.elvishew:xlog:1.7.2')
5149
}

‎gradle/wrapper/gradle-wrapper.jar

4.26 KB
Binary file not shown.

‎gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip

0 commit comments

Comments
 (0)
Failed to load comments.