1
0
Fork 0
mirror of https://github.com/MatomoCamp/matomocamp-companion-android.git synced 2024-09-19 16:13:46 +02:00

bump minSdkVersion to 19 and remove deprecated code

This commit is contained in:
Christophe Beyls 2022-01-01 18:03:15 +01:00
parent 5440860340
commit fb58598937
7 changed files with 5 additions and 31 deletions

View file

@ -12,7 +12,7 @@ android {
defaultConfig {
applicationId "be.digitalia.fosdem"
minSdkVersion 18
minSdkVersion 19
targetSdkVersion 31
multiDexEnabled = true
versionCode 1700205

View file

@ -7,7 +7,6 @@ import android.content.SharedPreferences
import android.graphics.drawable.Animatable
import android.net.Uri
import android.nfc.NdefRecord
import android.os.Build
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
@ -245,11 +244,6 @@ class MainActivity : AppCompatActivity(R.layout.main), CreateNfcAppDataCallback
}
override fun onStart() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
if (delegate.applyDayNight()) {
recreate()
}
}
super.onStart()
// Scheduled database update

View file

@ -12,7 +12,6 @@ import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat
import androidx.core.text.set
import androidx.core.view.isGone
import androidx.core.widget.TextViewCompat
import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.RecyclerView
import be.digitalia.fosdem.R
@ -97,7 +96,7 @@ class EventsAdapter constructor(context: Context, private val showDay: Boolean =
title.text = event.title
val bookmarkDrawable = if (isBookmarked) AppCompatResources.getDrawable(context, R.drawable.ic_bookmark_white_24dp) else null
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(title, null, null, bookmarkDrawable, null)
title.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, bookmarkDrawable, null)
title.contentDescription = if (isBookmarked) {
context.getString(R.string.in_bookmarks_content_description, event.title.orEmpty())
} else null

View file

@ -11,7 +11,6 @@ import androidx.annotation.DrawableRes
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
import androidx.core.widget.TextViewCompat
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import be.digitalia.fosdem.R
@ -131,7 +130,7 @@ class TrackScheduleAdapter(context: Context, private val listener: EventClickLis
time.text = event.startTime?.atZone(DateUtils.conferenceZoneId)?.format(timeFormatter)
title.text = event.title
val bookmarkDrawable = if (isBookmarked) AppCompatResources.getDrawable(context, R.drawable.ic_bookmark_white_24dp) else null
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(title, null, null, bookmarkDrawable, null)
title.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, bookmarkDrawable, null)
title.contentDescription = if (isBookmarked) {
context.getString(R.string.in_bookmarks_content_description, event.title.orEmpty())
} else null

View file

@ -189,7 +189,7 @@ class EventDetailsFragment : Fragment(R.layout.fragment_event_details) {
private fun createShareChooserIntent(): Intent {
val title = event.title.orEmpty()
val url = event.url.orEmpty()
return ShareCompat.IntentBuilder(requireActivity())
return ShareCompat.IntentBuilder(requireContext())
.setSubject("$title ($CONFERENCE_NAME)")
.setType("text/plain")
.setText("$title $url $CONFERENCE_HASHTAG")

View file

@ -1,17 +0,0 @@
package be.digitalia.fosdem.utils
import android.app.Activity
import android.content.ContextWrapper
import android.view.View
fun View.findActivity(): Activity {
var context = this.context
while (context !is Activity) {
context = if (context is ContextWrapper) {
context.baseContext
} else {
throw IllegalStateException("Context is not an Activity")
}
}
return context
}

View file

@ -2,7 +2,6 @@ package be.digitalia.fosdem.widgets
import android.os.SystemClock
import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
/**
@ -46,7 +45,7 @@ class ContentLoadingViewMediator(private val view: View) {
return
}
field = value
if (ViewCompat.isAttachedToWindow(view)) {
if (view.isAttachedToWindow) {
view.removeCallbacks(delayedAction)
if (value && startTime == -1L) {