From 9cc959a4f71f5e56c4498308854b5f85bc4bf11c Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sat, 28 Mar 2020 11:19:01 +0300 Subject: [PATCH] Fix tracker build --- OsmAnd-telegram/build.gradle | 10 ++++------ .../src/net/osmand/telegram/ui/LoginDialogFragment.kt | 6 +++--- .../src/net/osmand/telegram/ui/MainActivity.kt | 2 +- .../osmand/telegram/ui/ProxySettingsDialogFragment.kt | 2 +- .../src/net/osmand/telegram/ui/SearchDialogFragment.kt | 2 +- .../net/osmand/telegram/ui/SettingsDialogFragment.kt | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/OsmAnd-telegram/build.gradle b/OsmAnd-telegram/build.gradle index 7c21c59948..6897d1767c 100644 --- a/OsmAnd-telegram/build.gradle +++ b/OsmAnd-telegram/build.gradle @@ -24,6 +24,7 @@ android { applicationId "net.osmand.telegram" minSdkVersion 15 targetSdkVersion 28 + multiDexEnabled true versionCode 1 versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode versionName "1.0" @@ -139,12 +140,10 @@ dependencies { implementation project(path: ':OsmAnd-java', configuration: 'android') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation( "org.jetbrains.kotlin:kotlin-stdlib:1.2.71") { - exclude group: 'org.jetbrains', module: 'annotations' - } + implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.11' implementation 'androidx.multidex:multidex:2.0.1' - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.annotation:annotation:1.1.0' implementation 'commons-logging:commons-logging-api:1.1' @@ -153,5 +152,4 @@ dependencies { implementation("com.github.HITGIF:TextFieldBoxes:1.4.5") { exclude group: 'com.android.support' } - implementation 'org.jetbrains:annotations-java5:15.0' } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/LoginDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/LoginDialogFragment.kt index cbd88d9ce7..627a3cd000 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/LoginDialogFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/LoginDialogFragment.kt @@ -193,7 +193,7 @@ class LoginDialogFragment : BaseDialogFragment() { } } - override fun onDismiss(dialog: DialogInterface?) { + override fun onDismiss(dialog: DialogInterface) { super.onDismiss(dialog) if (!dismissedManually) { getMainActivity()?.closeTelegram() @@ -300,7 +300,7 @@ class LoginDialogFragment : BaseDialogFragment() { view.findViewById(R.id.no_telegram_button)?.setImageResource(R.drawable.ic_arrow_forward) noTelegramViewContainer?.setOnClickListener { - val focusedView = dialog.currentFocus + val focusedView = dialog?.currentFocus val mainActivity = activity if (focusedView != null && mainActivity != null) { AndroidUtils.hideSoftKeyboard(mainActivity, focusedView) @@ -479,7 +479,7 @@ class LoginDialogFragment : BaseDialogFragment() { when (loginDialogActiveType) { LoginDialogType.ENTER_PHONE_NUMBER -> { showWelcomeDialog = true - val focusedView = dialog.currentFocus + val focusedView = dialog?.currentFocus val mainActivity = activity if (focusedView != null && mainActivity != null) { AndroidUtils.hideSoftKeyboard(mainActivity, focusedView) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt index 38d48d6f13..38535ad886 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/MainActivity.kt @@ -157,7 +157,7 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene } } - override fun onAttachFragment(fragment: androidx.fragment.app.Fragment?) { + override fun onAttachFragment(fragment: androidx.fragment.app.Fragment) { if (fragment is TelegramListener) { listeners.add(WeakReference(fragment)) } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/ProxySettingsDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/ProxySettingsDialogFragment.kt index 496901cd75..b747468e28 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/ProxySettingsDialogFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/ProxySettingsDialogFragment.kt @@ -34,7 +34,7 @@ class ProxySettingsDialogFragment : BaseDialogFragment() { ): View { mainView = inflater.inflate(R.layout.fragment_proxy_settings_dialog, parent) - val window = dialog.window + val window = dialog?.window if (window != null) { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) if (Build.VERSION.SDK_INT >= 21) { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/SearchDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/SearchDialogFragment.kt index 8568065cd1..97a105a208 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/SearchDialogFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/SearchDialogFragment.kt @@ -70,7 +70,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back) setNavigationOnClickListener { dismiss() } } - val window = dialog.window + val window = dialog?.window if (window != null && Build.VERSION.SDK_INT >= 21) { window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light) } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt index 8bc539ee20..a5bf5993e9 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/SettingsDialogFragment.kt @@ -43,7 +43,7 @@ class SettingsDialogFragment : BaseDialogFragment() { navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back) setNavigationOnClickListener { dismiss() } } - val window = dialog.window + val window = dialog?.window if (window != null && Build.VERSION.SDK_INT >= 21) { window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light) }