Update dependencies

New version of ExoPlayer has the statistics turned off by default.

The app now works with Kotlin 1.7.0. Some changes were necessary in
order to start using that Kotlin version. The rest of dependencies are
routine.
This commit is contained in:
Adolfo Santiago 2022-07-06 17:33:31 +02:00
parent b85335e8d4
commit 2dd06c82a1
No known key found for this signature in database
GPG key ID: 244D6F9A317B4A65
8 changed files with 24 additions and 19 deletions

View file

@ -346,6 +346,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
.setAction(R.string.action_retry) { viewModel.refresh() }
.show()
}
else -> {}
}
}
viewModel.relationshipData.observe(this) {

View file

@ -164,6 +164,7 @@ class EditProfileActivity : BaseActivity(), Injectable {
snackbar.show()
}
else -> {}
}
}
@ -186,6 +187,7 @@ class EditProfileActivity : BaseActivity(), Injectable {
}
}
}
else -> {}
}
}

View file

@ -178,13 +178,14 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
return false
}
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
menu?.findItem(R.id.action_share_media)?.isEnabled = !isCreating
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
menu.findItem(R.id.action_share_media)?.isEnabled = !isCreating
if(attachments != null) {
val isStatus = attachments!!.any { it.statusId != null && it.statusUrl != null }
menu?.findItem(R.id.action_open_status)?.isVisible = isStatus
menu.findItem(R.id.action_open_status)?.isVisible = isStatus
}
return true
}

View file

@ -105,7 +105,7 @@ class StickerAdapter(
Glide.with(holder.itemView)
.load(( url ?: "" ) + stickers[position])
.thumbnail()
.into(holder.itemView)
.into(holder.itemView as AppCompatImageButton)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SingleViewHolder {
@ -114,4 +114,4 @@ class StickerAdapter(
return SingleViewHolder(view)
}
}
}
}

View file

@ -402,12 +402,12 @@ class PreferencesFragment : PreferenceFragmentCompat(), Injectable {
private fun updateHttpProxySummary() {
val sharedPreferences = preferenceManager.sharedPreferences
val httpProxyEnabled = sharedPreferences.getBoolean(PrefKeys.HTTP_PROXY_ENABLED, false)
val httpServer = sharedPreferences.getNonNullString(PrefKeys.HTTP_PROXY_SERVER, "")
val httpProxyEnabled = sharedPreferences?.getBoolean(PrefKeys.HTTP_PROXY_ENABLED, false) ?: false
val httpServer = sharedPreferences?.getNonNullString(PrefKeys.HTTP_PROXY_SERVER, "") ?: ""
try {
val httpPort = sharedPreferences.getNonNullString(PrefKeys.HTTP_PROXY_PORT, "-1")
.toInt()
val httpPort = sharedPreferences?.getNonNullString(PrefKeys.HTTP_PROXY_PORT, "-1")
?.toInt() ?: -1
if(httpProxyEnabled && httpServer.isNotBlank() && httpPort > 0 && httpPort < 65535) {
httpProxyPref?.summary = "$httpServer:$httpPort"

View file

@ -159,7 +159,7 @@ class ChatsFragment : BaseFragment(), Injectable, RefreshableFragment, Reselecta
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val preferences = PreferenceManager.getDefaultSharedPreferences(activity)
val preferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
val statusDisplayOptions = StatusDisplayOptions(
animateAvatars = preferences.getBoolean(PrefKeys.ANIMATE_GIF_AVATARS, false),
@ -325,7 +325,7 @@ class ChatsFragment : BaseFragment(), Injectable, RefreshableFragment, Reselecta
* guaranteed to be set until then. */
/* Use a modified scroll listener that both loads more statuses as it goes, and hides
* the follow button on down-scroll. */
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
val preferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
hideFab = preferences.getBoolean("fabHide", false)
scrollListener = object : EndlessOnScrollListener(layoutManager) {
override fun onScrolled(view: RecyclerView, dx: Int, dy: Int) {
@ -393,7 +393,7 @@ class ChatsFragment : BaseFragment(), Injectable, RefreshableFragment, Reselecta
*/
private fun onPreferenceChanged(key: String) {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
when (key) {
"fabHide" -> {
hideFab = sharedPreferences.getBoolean("fabHide", false)
@ -722,7 +722,7 @@ class ChatsFragment : BaseFragment(), Injectable, RefreshableFragment, Reselecta
* Auto dispose observable on pause
*/
private fun startUpdateTimestamp() {
val preferences = PreferenceManager.getDefaultSharedPreferences(activity)
val preferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
val useAbsoluteTime = preferences.getBoolean("absoluteTimeView", false)
if (!useAbsoluteTime) {
Observable.interval(1, TimeUnit.MINUTES)
@ -778,4 +778,4 @@ class ChatsFragment : BaseFragment(), Injectable, RefreshableFragment, Reselecta
bottomSheetActivity.openChat(it)
}
}
}
}

View file

@ -125,6 +125,7 @@ class ViewVideoFragment : ViewMediaFragment() {
}
exoPlayer = ExoPlayer.Builder(requireActivity())
.setUsePlatformDiagnostics(false)
.setTrackSelector(trackSelector)
.build()
.also { player ->

View file

@ -1,5 +1,5 @@
// Kotlin version
ext.kotlin_version = "1.6.21"
ext.kotlin_version = "1.7.0"
// Dependencies versions
def versions = [:]
@ -22,22 +22,22 @@ versions.coreKtx = "1.8.0"
versions.dagger = "2.42"
versions.emoji = "1.1.0"
versions.exifInterface = "1.3.3"
versions.exoplayer = "2.17.1"
versions.exoplayer = "2.18.0"
versions.filemojiCompat = "1.0.17"
versions.flexbox = "2.0.1"
versions.fragmentKtx = "1.4.1"
versions.fragmentKtx = "1.5.0"
versions.fragmentviewbindingdelegateKt = "1.0.0"
versions.glide = "4.13.2"
versions.glideImage = "1.8.1"
versions.glidePluginAnimation = "2.23.0"
versions.kotlinx = "1.6.3"
versions.lifecycle = "2.4.1"
versions.lifecycle = "2.5.0"
versions.markdownEdit = "1.0.0"
versions.materialDesign = "1.6.1"
versions.materialDrawer = "8.4.5"
versions.materialDrawerTypeface = "3.0.1.4.original-kotlin@aar"
versions.pagingRuntimeKtx = "2.1.2"
versions.preferenceKtx = "1.1.1"
versions.preferenceKtx = "1.2.0"
versions.okhttpVersion = "4.10.0"
versions.recyclerView = "1.2.1"
versions.retrofit = "2.9.0"