Fix tracker build

This commit is contained in:
max-klaus 2020-03-28 11:19:01 +03:00
parent 61353d2805
commit 9cc959a4f7
6 changed files with 11 additions and 13 deletions

View file

@ -24,6 +24,7 @@ android {
applicationId "net.osmand.telegram" applicationId "net.osmand.telegram"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 28 targetSdkVersion 28
multiDexEnabled true
versionCode 1 versionCode 1
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
versionName "1.0" versionName "1.0"
@ -139,12 +140,10 @@ dependencies {
implementation project(path: ':OsmAnd-java', configuration: 'android') implementation project(path: ':OsmAnd-java', configuration: 'android')
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation( "org.jetbrains.kotlin:kotlin-stdlib:1.2.71") { implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.11'
exclude group: 'org.jetbrains', module: 'annotations'
}
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.annotation:annotation:1.1.0'
implementation 'commons-logging:commons-logging-api:1.1' implementation 'commons-logging:commons-logging-api:1.1'
@ -153,5 +152,4 @@ dependencies {
implementation("com.github.HITGIF:TextFieldBoxes:1.4.5") { implementation("com.github.HITGIF:TextFieldBoxes:1.4.5") {
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
implementation 'org.jetbrains:annotations-java5:15.0'
} }

View file

@ -193,7 +193,7 @@ class LoginDialogFragment : BaseDialogFragment() {
} }
} }
override fun onDismiss(dialog: DialogInterface?) { override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog) super.onDismiss(dialog)
if (!dismissedManually) { if (!dismissedManually) {
getMainActivity()?.closeTelegram() getMainActivity()?.closeTelegram()
@ -300,7 +300,7 @@ class LoginDialogFragment : BaseDialogFragment() {
view.findViewById<ImageView>(R.id.no_telegram_button)?.setImageResource(R.drawable.ic_arrow_forward) view.findViewById<ImageView>(R.id.no_telegram_button)?.setImageResource(R.drawable.ic_arrow_forward)
noTelegramViewContainer?.setOnClickListener { noTelegramViewContainer?.setOnClickListener {
val focusedView = dialog.currentFocus val focusedView = dialog?.currentFocus
val mainActivity = activity val mainActivity = activity
if (focusedView != null && mainActivity != null) { if (focusedView != null && mainActivity != null) {
AndroidUtils.hideSoftKeyboard(mainActivity, focusedView) AndroidUtils.hideSoftKeyboard(mainActivity, focusedView)
@ -479,7 +479,7 @@ class LoginDialogFragment : BaseDialogFragment() {
when (loginDialogActiveType) { when (loginDialogActiveType) {
LoginDialogType.ENTER_PHONE_NUMBER -> { LoginDialogType.ENTER_PHONE_NUMBER -> {
showWelcomeDialog = true showWelcomeDialog = true
val focusedView = dialog.currentFocus val focusedView = dialog?.currentFocus
val mainActivity = activity val mainActivity = activity
if (focusedView != null && mainActivity != null) { if (focusedView != null && mainActivity != null) {
AndroidUtils.hideSoftKeyboard(mainActivity, focusedView) AndroidUtils.hideSoftKeyboard(mainActivity, focusedView)

View file

@ -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) { if (fragment is TelegramListener) {
listeners.add(WeakReference(fragment)) listeners.add(WeakReference(fragment))
} }

View file

@ -34,7 +34,7 @@ class ProxySettingsDialogFragment : BaseDialogFragment() {
): View { ): View {
mainView = inflater.inflate(R.layout.fragment_proxy_settings_dialog, parent) mainView = inflater.inflate(R.layout.fragment_proxy_settings_dialog, parent)
val window = dialog.window val window = dialog?.window
if (window != null) { if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
if (Build.VERSION.SDK_INT >= 21) { if (Build.VERSION.SDK_INT >= 21) {

View file

@ -70,7 +70,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back) navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back)
setNavigationOnClickListener { dismiss() } setNavigationOnClickListener { dismiss() }
} }
val window = dialog.window val window = dialog?.window
if (window != null && Build.VERSION.SDK_INT >= 21) { if (window != null && Build.VERSION.SDK_INT >= 21) {
window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light) window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light)
} }

View file

@ -43,7 +43,7 @@ class SettingsDialogFragment : BaseDialogFragment() {
navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back) navigationIcon = uiUtils.getThemedIcon(R.drawable.ic_arrow_back)
setNavigationOnClickListener { dismiss() } setNavigationOnClickListener { dismiss() }
} }
val window = dialog.window val window = dialog?.window
if (window != null && Build.VERSION.SDK_INT >= 21) { if (window != null && Build.VERSION.SDK_INT >= 21) {
window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light) window.statusBarColor = ContextCompat.getColor(app, R.color.card_bg_light)
} }