Upgrade android sdk to 30 (#966)

This commit is contained in:
Rafał Borcz 2020-10-03 01:08:57 +02:00 committed by GitHub
parent b91973aec3
commit 40fc6ec2e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 32 deletions

View File

@ -3,8 +3,8 @@ jdk: oraclejdk8
env: env:
global: global:
- ANDROID_API_LEVEL=29 - ANDROID_API_LEVEL=30
- ANDROID_BUILD_TOOLS_VERSION=29.0.3 - ANDROID_BUILD_TOOLS_VERSION=30.0.2
cache: cache:
directories: directories:
@ -28,22 +28,26 @@ android:
- build-tools-$ANDROID_BUILD_TOOLS_VERSION - build-tools-$ANDROID_BUILD_TOOLS_VERSION
# The SDK version used to compile your project # The SDK version used to compile your project
- android-$ANDROID_API_LEVEL - android-$ANDROID_API_LEVEL
# Additional components # Additional components
- extra-google-google_play_services - extra-google-google_play_services
- extra-google-m2repository - extra-google-m2repository
- extra-android-m2repository - extra-android-m2repository
- addon-google_apis-google-$ANDROID_API_LEVEL - addon-google_apis-google-$ANDROID_API_LEVEL
# Android emulator # Android emulator
- android-22 - android-22
- sys-img-armeabi-v7a-android-22 - sys-img-armeabi-v7a-android-22
before_install:
- yes | sdkmanager "platforms;android-30"
- yes | sdkmanager "build-tools;30.0.2"
before_script: before_script:
# Launch emulator before the execution # Launch emulator before the execution
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window & - emulator -avd test -no-audio -no-window &
- android-wait-for-emulator - android-wait-for-emulator
- adb shell input keyevent 82 & - adb shell input keyevent 82 &
- "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash" - "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash"
script: script:
- ./gradlew dependencies --stacktrace --daemon - ./gradlew dependencies --stacktrace --daemon

View File

@ -10,14 +10,14 @@ apply from: 'sonarqube.gradle'
apply from: 'hooks.gradle' apply from: 'hooks.gradle'
android { android {
compileSdkVersion 29 compileSdkVersion 30
buildToolsVersion '29.0.3' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
applicationId "io.github.wulkanowy" applicationId "io.github.wulkanowy"
testApplicationId "io.github.tests.wulkanowy" testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 17 minSdkVersion 17
targetSdkVersion 29 targetSdkVersion 30
versionCode 72 versionCode 72
versionName "0.21.2" versionName "0.21.2"
multiDexEnabled true multiDexEnabled true

View File

@ -181,8 +181,8 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
analytics.setCurrentScreen(this, name) analytics.setCurrentScreen(this, name)
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
return if (item?.itemId == R.id.mainMenuAccount) presenter.onAccountManagerSelected() return if (item.itemId == R.id.mainMenuAccount) presenter.onAccountManagerSelected()
else false else false
} }

View File

@ -174,7 +174,7 @@ class MessagePreviewFragment :
@RequiresApi(Build.VERSION_CODES.LOLLIPOP) @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun printDocument(html: String, jobName: String) { override fun printDocument(html: String, jobName: String) {
val webView = WebView(activity) val webView = WebView(requireContext())
webView.webViewClient = object : WebViewClient() { webView.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest) = false override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest) = false

View File

@ -1,5 +1,6 @@
package io.github.wulkanowy.ui.modules.message.send package io.github.wulkanowy.ui.modules.message.send
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Rect import android.graphics.Rect
@ -74,6 +75,7 @@ class SendMessageActivity : BaseActivity<SendMessagePresenter, ActivitySendMessa
presenter.onAttachView(this, intent.getSerializableExtra(EXTRA_MESSAGE) as? Message, intent.getSerializableExtra(EXTRA_REPLY) as? Boolean) presenter.onAttachView(this, intent.getSerializableExtra(EXTRA_MESSAGE) as? Message, intent.getSerializableExtra(EXTRA_REPLY) as? Boolean)
} }
@SuppressLint("ClickableViewAccessibility")
override fun initView() { override fun initView() {
setUpExtendedHitArea() setUpExtendedHitArea()
with(binding) { with(binding) {
@ -87,8 +89,8 @@ class SendMessageActivity : BaseActivity<SendMessagePresenter, ActivitySendMessa
return true return true
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
return if (item?.itemId == R.id.sendMessageMenuSend) presenter.onSend() return if (item.itemId == R.id.sendMessageMenuSend) presenter.onSend()
else false else false
} }

View File

@ -22,32 +22,32 @@ private fun Bundle?.checkSavedState() = if (this == null) "(STATE IS NULL)" else
class ActivityLifecycleLogger : Application.ActivityLifecycleCallbacks { class ActivityLifecycleLogger : Application.ActivityLifecycleCallbacks {
override fun onActivityPaused(activity: Activity?) { override fun onActivityPaused(activity: Activity) {
activity?.let { Timber.d("${it::class.java.simpleName} PAUSED") } Timber.d("${activity::class.java.simpleName} PAUSED")
} }
override fun onActivityResumed(activity: Activity?) { override fun onActivityResumed(activity: Activity) {
activity?.let { Timber.d("${it::class.java.simpleName} RESUMED") } Timber.d("${activity::class.java.simpleName} RESUMED")
} }
override fun onActivityStarted(activity: Activity?) { override fun onActivityStarted(activity: Activity) {
activity?.let { Timber.d("${it::class.java.simpleName} STARTED") } Timber.d("${activity::class.java.simpleName} STARTED")
} }
override fun onActivityDestroyed(activity: Activity?) { override fun onActivityDestroyed(activity: Activity) {
activity?.let { Timber.d("${it::class.java.simpleName} DESTROYED") } Timber.d("${activity::class.java.simpleName} DESTROYED")
} }
override fun onActivitySaveInstanceState(activity: Activity?, outState: Bundle?) { override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
activity?.let { Timber.d("${it::class.java.simpleName} SAVED INSTANCE STATE") } Timber.d("${activity::class.java.simpleName} SAVED INSTANCE STATE")
} }
override fun onActivityStopped(activity: Activity?) { override fun onActivityStopped(activity: Activity) {
activity?.let { Timber.d("${it::class.java.simpleName} STOPPED") } Timber.d("${activity::class.java.simpleName} STOPPED")
} }
override fun onActivityCreated(activity: Activity?, savedInstanceState: Bundle?) { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
activity?.let { Timber.d("${it::class.java.simpleName} CREATED ${savedInstanceState.checkSavedState()}") } Timber.d("${activity::class.java.simpleName} CREATED ${savedInstanceState.checkSavedState()}")
} }
} }