Browse Source

Rebrand/rename packages

housekeeping/remove-warnings
Ryan Harg 3 years ago
parent
commit
3c86003e30
  1. 2
      app/build.gradle.kts
  2. 2
      app/proguard-rules.pro
  3. 4
      app/src/main/AndroidManifest.xml
  4. 20
      app/src/main/java/org/funkwhale/ffa/FFA.kt
  5. 22
      app/src/main/java/org/funkwhale/ffa/activities/DownloadsActivity.kt
  6. 6
      app/src/main/java/org/funkwhale/ffa/activities/LicencesActivity.kt
  7. 12
      app/src/main/java/org/funkwhale/ffa/activities/LoginActivity.kt
  8. 28
      app/src/main/java/org/funkwhale/ffa/activities/MainActivity.kt
  9. 18
      app/src/main/java/org/funkwhale/ffa/activities/SearchActivity.kt
  10. 18
      app/src/main/java/org/funkwhale/ffa/activities/SettingsActivity.kt
  11. 12
      app/src/main/java/org/funkwhale/ffa/activities/SplashActivity.kt
  12. 14
      app/src/main/java/org/funkwhale/ffa/adapters/AlbumsAdapter.kt
  13. 14
      app/src/main/java/org/funkwhale/ffa/adapters/AlbumsGridAdapter.kt
  14. 14
      app/src/main/java/org/funkwhale/ffa/adapters/ArtistsAdapter.kt
  15. 8
      app/src/main/java/org/funkwhale/ffa/adapters/BrowseTabsAdapter.kt
  16. 10
      app/src/main/java/org/funkwhale/ffa/adapters/DownloadsAdapter.kt
  17. 8
      app/src/main/java/org/funkwhale/ffa/adapters/FavoritesAdapter.kt
  18. 8
      app/src/main/java/org/funkwhale/ffa/adapters/PlaylistTracksAdapter.kt
  19. 12
      app/src/main/java/org/funkwhale/ffa/adapters/PlaylistsAdapter.kt
  20. 18
      app/src/main/java/org/funkwhale/ffa/adapters/RadiosAdapter.kt
  21. 6
      app/src/main/java/org/funkwhale/ffa/adapters/SearchAdapter.kt
  22. 8
      app/src/main/java/org/funkwhale/ffa/adapters/TracksAdapter.kt
  23. 12
      app/src/main/java/org/funkwhale/ffa/fragments/AddToPlaylistDialog.kt
  24. 18
      app/src/main/java/org/funkwhale/ffa/fragments/AlbumsFragment.kt
  25. 16
      app/src/main/java/org/funkwhale/ffa/fragments/AlbumsGridFragment.kt
  26. 16
      app/src/main/java/org/funkwhale/ffa/fragments/ArtistsFragment.kt
  27. 8
      app/src/main/java/org/funkwhale/ffa/fragments/BrowseFragment.kt
  28. 12
      app/src/main/java/org/funkwhale/ffa/fragments/FavoritesFragment.kt
  29. 10
      app/src/main/java/org/funkwhale/ffa/fragments/LandscapeQueueFragment.kt
  30. 6
      app/src/main/java/org/funkwhale/ffa/fragments/LoginDialog.kt
  31. 8
      app/src/main/java/org/funkwhale/ffa/fragments/OtterFragment.kt
  32. 14
      app/src/main/java/org/funkwhale/ffa/fragments/PlaylistTracksFragment.kt
  33. 16
      app/src/main/java/org/funkwhale/ffa/fragments/PlaylistsFragment.kt
  34. 12
      app/src/main/java/org/funkwhale/ffa/fragments/QueueFragment.kt
  35. 12
      app/src/main/java/org/funkwhale/ffa/fragments/RadiosFragment.kt
  36. 12
      app/src/main/java/org/funkwhale/ffa/fragments/TrackInfoDetailsFragment.kt
  37. 14
      app/src/main/java/org/funkwhale/ffa/fragments/TracksFragment.kt
  38. 16
      app/src/main/java/org/funkwhale/ffa/playback/MediaControlsManager.kt
  39. 6
      app/src/main/java/org/funkwhale/ffa/playback/MediaSession.kt
  40. 39
      app/src/main/java/org/funkwhale/ffa/playback/PinService.kt
  41. 62
      app/src/main/java/org/funkwhale/ffa/playback/PlayerService.kt
  42. 14
      app/src/main/java/org/funkwhale/ffa/playback/QueueManager.kt
  43. 12
      app/src/main/java/org/funkwhale/ffa/playback/RadioPlayer.kt
  44. 12
      app/src/main/java/org/funkwhale/ffa/repositories/AlbumsRepository.kt
  45. 12
      app/src/main/java/org/funkwhale/ffa/repositories/ArtistTracksRepository.kt
  46. 12
      app/src/main/java/org/funkwhale/ffa/repositories/ArtistsRepository.kt
  47. 8
      app/src/main/java/org/funkwhale/ffa/repositories/FavoritesRepository.kt
  48. 6
      app/src/main/java/org/funkwhale/ffa/repositories/HttpUpstream.kt
  49. 12
      app/src/main/java/org/funkwhale/ffa/repositories/PlaylistTracksRepository.kt
  50. 4
      app/src/main/java/org/funkwhale/ffa/repositories/PlaylistsRepository.kt
  51. 12
      app/src/main/java/org/funkwhale/ffa/repositories/RadiosRepository.kt
  52. 8
      app/src/main/java/org/funkwhale/ffa/repositories/Repository.kt
  53. 10
      app/src/main/java/org/funkwhale/ffa/repositories/SearchRepository.kt
  54. 12
      app/src/main/java/org/funkwhale/ffa/repositories/TracksRepository.kt
  55. 4
      app/src/main/java/org/funkwhale/ffa/utils/AppContext.kt
  56. 20
      app/src/main/java/org/funkwhale/ffa/utils/Bus.kt
  57. 6
      app/src/main/java/org/funkwhale/ffa/utils/Data.kt
  58. 8
      app/src/main/java/org/funkwhale/ffa/utils/Extensions.kt
  59. 4
      app/src/main/java/org/funkwhale/ffa/utils/Models.kt
  60. 4
      app/src/main/java/org/funkwhale/ffa/utils/Userinfo.kt
  61. 4
      app/src/main/java/org/funkwhale/ffa/utils/Util.kt
  62. 2
      app/src/main/java/org/funkwhale/ffa/views/DisableableFrameLayout.kt
  63. 6
      app/src/main/java/org/funkwhale/ffa/views/LoadingImageView.kt
  64. 4
      app/src/main/java/org/funkwhale/ffa/views/NowPlayingView.kt
  65. 4
      app/src/main/java/org/funkwhale/ffa/views/SquareImageView.kt
  66. 6
      app/src/main/res/layout-land/activity_main.xml
  67. 10
      app/src/main/res/layout-land/fragment_tracks.xml
  68. 2
      app/src/main/res/layout-land/partial_now_playing.xml
  69. 8
      app/src/main/res/layout/activity_main.xml
  70. 10
      app/src/main/res/layout/fragment_tracks.xml
  71. 4
      app/src/main/res/layout/partial_now_playing.xml
  72. 4
      app/src/main/res/layout/row_album.xml
  73. 4
      app/src/main/res/layout/row_album_grid.xml
  74. 4
      app/src/main/res/layout/row_artist.xml
  75. 10
      app/src/main/res/layout/row_playlist.xml
  76. 4
      app/src/main/res/layout/row_radio.xml
  77. 4
      app/src/main/res/layout/row_track.xml
  78. 2
      build.gradle.kts

2
app/build.gradle.kts

@ -39,7 +39,7 @@ android {
compileSdkVersion(29) compileSdkVersion(29)
defaultConfig { defaultConfig {
applicationId = "com.github.apognu.otter" applicationId = "org.funkwhale.ffa"
minSdkVersion(23) minSdkVersion(23)
targetSdkVersion(29) targetSdkVersion(29)

2
app/proguard-rules.pro vendored

@ -1 +1 @@
-keep class com.github.apognu.otter.** { *; } -keep class org.funkwhale.ffa.** { *; }

4
app/src/main/AndroidManifest.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.github.apognu.otter"> package="org.funkwhale.ffa">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
@ -9,7 +9,7 @@
<permission android:name="android.permission.MEDIA_CONTENT_CONTROL" /> <permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<application <application
android:name="com.github.apognu.otter.Otter" android:name="org.funkwhale.ffa.FFA"
android:allowBackup="false" android:allowBackup="false"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"

20
app/src/main/java/com/github/apognu/otter/Otter.kt → app/src/main/java/org/funkwhale/ffa/FFA.kt

@ -1,10 +1,7 @@
package com.github.apognu.otter package org.funkwhale.ffa
import android.app.Application import android.app.Application
import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate
import com.github.apognu.otter.playback.MediaSession
import com.github.apognu.otter.playback.QueueManager
import com.github.apognu.otter.utils.*
import com.google.android.exoplayer2.database.ExoDatabaseProvider import com.google.android.exoplayer2.database.ExoDatabaseProvider
import com.google.android.exoplayer2.offline.DefaultDownloadIndex import com.google.android.exoplayer2.offline.DefaultDownloadIndex
import com.google.android.exoplayer2.offline.DefaultDownloaderFactory import com.google.android.exoplayer2.offline.DefaultDownloaderFactory
@ -16,14 +13,17 @@ import com.google.android.exoplayer2.upstream.cache.SimpleCache
import com.preference.PowerPreference import com.preference.PowerPreference
import kotlinx.coroutines.channels.BroadcastChannel import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.ConflatedBroadcastChannel import kotlinx.coroutines.channels.ConflatedBroadcastChannel
import org.funkwhale.ffa.playback.MediaSession
import org.funkwhale.ffa.playback.QueueManager
import org.funkwhale.ffa.utils.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
class Otter : Application() { class FFA : Application() {
companion object { companion object {
private var instance: Otter = Otter() private var instance: FFA = FFA()
fun get(): Otter = instance fun get(): FFA = instance
} }
var defaultExceptionHandler: Thread.UncaughtExceptionHandler? = null var defaultExceptionHandler: Thread.UncaughtExceptionHandler? = null
@ -57,7 +57,7 @@ class Otter : Application() {
val exoDownloadManager: DownloadManager by lazy { val exoDownloadManager: DownloadManager by lazy {
DownloaderConstructorHelper(exoDownloadCache, QueueManager.factory(this)).run { DownloaderConstructorHelper(exoDownloadCache, QueueManager.factory(this)).run {
DownloadManager(this@Otter, DefaultDownloadIndex(exoDatabase), DefaultDownloaderFactory(this)) DownloadManager(this@FFA, DefaultDownloadIndex(exoDatabase), DefaultDownloaderFactory(this))
} }
} }
@ -104,11 +104,11 @@ class Otter : Application() {
builder.appendln(e.toString()) builder.appendln(e.toString())
Cache.set(this@Otter, "crashdump", builder.toString().toByteArray()) Cache.set(this@FFA, "crashdump", builder.toString().toByteArray())
} }
} }
defaultExceptionHandler?.uncaughtException(t, e) defaultExceptionHandler?.uncaughtException(t, e)
} }
} }
} }

22
app/src/main/java/com/github/apognu/otter/activities/DownloadsActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/DownloadsActivity.kt

@ -1,23 +1,23 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.github.apognu.otter.Otter
import com.github.apognu.otter.R
import com.github.apognu.otter.adapters.DownloadsAdapter
import com.github.apognu.otter.utils.Event
import com.github.apognu.otter.utils.EventBus
import com.github.apognu.otter.utils.getMetadata
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import kotlinx.android.synthetic.main.activity_downloads.* import kotlinx.android.synthetic.main.activity_downloads.downloads
import kotlinx.coroutines.Dispatchers.Default import kotlinx.coroutines.Dispatchers.Default
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.funkwhale.ffa.FFA
import org.funkwhale.ffa.R
import org.funkwhale.ffa.adapters.DownloadsAdapter
import org.funkwhale.ffa.utils.Event
import org.funkwhale.ffa.utils.EventBus
import org.funkwhale.ffa.utils.getMetadata
class DownloadsActivity : AppCompatActivity() { class DownloadsActivity : AppCompatActivity() {
lateinit var adapter: DownloadsAdapter lateinit var adapter: DownloadsAdapter
@ -60,7 +60,7 @@ class DownloadsActivity : AppCompatActivity() {
private fun refresh() { private fun refresh() {
lifecycleScope.launch(Main) { lifecycleScope.launch(Main) {
val cursor = Otter.get().exoDownloadManager.downloadIndex.getDownloads() val cursor = FFA.get().exoDownloadManager.downloadIndex.getDownloads()
adapter.downloads.clear() adapter.downloads.clear()
@ -95,7 +95,7 @@ class DownloadsActivity : AppCompatActivity() {
} }
private suspend fun refreshProgress() { private suspend fun refreshProgress() {
val cursor = Otter.get().exoDownloadManager.downloadIndex.getDownloads() val cursor = FFA.get().exoDownloadManager.downloadIndex.getDownloads()
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
val download = cursor.download val download = cursor.download
@ -122,4 +122,4 @@ class DownloadsActivity : AppCompatActivity() {
adapter.notifyDataSetChanged() adapter.notifyDataSetChanged()
} }
} }
} }

6
app/src/main/java/com/github/apognu/otter/activities/LicencesActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/LicencesActivity.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
@ -9,7 +9,7 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import kotlinx.android.synthetic.main.activity_licences.* import kotlinx.android.synthetic.main.activity_licences.*
import kotlinx.android.synthetic.main.row_licence.view.* import kotlinx.android.synthetic.main.row_licence.view.*
@ -104,4 +104,4 @@ class LicencesActivity : AppCompatActivity() {
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/activities/LoginActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/LoginActivity.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.content.Intent import android.content.Intent
import android.content.res.Configuration import android.content.res.Configuration
@ -9,10 +9,10 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.doOnLayout import androidx.core.view.doOnLayout
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.LoginDialog import org.funkwhale.ffa.fragments.LoginDialog
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Userinfo import org.funkwhale.ffa.utils.Userinfo
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
@ -203,4 +203,4 @@ class LoginActivity : AppCompatActivity() {
container.requestLayout() container.requestLayout()
} }
} }
} }

28
app/src/main/java/com/github/apognu/otter/activities/MainActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/MainActivity.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.animation.Animator import android.animation.Animator
import android.animation.AnimatorListenerAdapter import android.animation.AnimatorListenerAdapter
@ -21,17 +21,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.github.apognu.otter.Otter
import com.github.apognu.otter.R
import com.github.apognu.otter.fragments.*
import com.github.apognu.otter.playback.MediaControlsManager
import com.github.apognu.otter.playback.PinService
import com.github.apognu.otter.playback.PlayerService
import com.github.apognu.otter.repositories.FavoritedRepository
import com.github.apognu.otter.repositories.FavoritesRepository
import com.github.apognu.otter.repositories.Repository
import com.github.apognu.otter.utils.*
import com.github.apognu.otter.views.DisableableFrameLayout
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitStringResponse import com.github.kittinunf.fuel.coroutines.awaitStringResponse
import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.Player
@ -48,6 +37,17 @@ import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.funkwhale.ffa.FFA
import org.funkwhale.ffa.R
import org.funkwhale.ffa.fragments.*
import org.funkwhale.ffa.playback.MediaControlsManager
import org.funkwhale.ffa.playback.PinService
import org.funkwhale.ffa.playback.PlayerService
import org.funkwhale.ffa.repositories.FavoritedRepository
import org.funkwhale.ffa.repositories.FavoritesRepository
import org.funkwhale.ffa.repositories.Repository
import org.funkwhale.ffa.utils.*
import org.funkwhale.ffa.views.DisableableFrameLayout
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
enum class ResultCode(val code: Int) { enum class ResultCode(val code: Int) {
@ -253,7 +253,7 @@ class MainActivity : AppCompatActivity() {
if (resultCode == ResultCode.LOGOUT.code) { if (resultCode == ResultCode.LOGOUT.code) {
Intent(this, LoginActivity::class.java).apply { Intent(this, LoginActivity::class.java).apply {
Otter.get().deleteAllData() FFA.get().deleteAllData()
flags = flags =
Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
@ -292,7 +292,7 @@ class MainActivity : AppCompatActivity() {
EventBus.get().collect { message -> EventBus.get().collect { message ->
when (message) { when (message) {
is Event.LogOut -> { is Event.LogOut -> {
Otter.get().deleteAllData() FFA.get().deleteAllData()
startActivity(Intent(this@MainActivity, LoginActivity::class.java).apply { startActivity(Intent(this@MainActivity, LoginActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NO_HISTORY flags = Intent.FLAG_ACTIVITY_NO_HISTORY

18
app/src/main/java/com/github/apognu/otter/activities/SearchActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/SearchActivity.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
@ -6,13 +6,13 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.SearchAdapter import org.funkwhale.ffa.adapters.SearchAdapter
import com.github.apognu.otter.fragments.AddToPlaylistDialog import org.funkwhale.ffa.fragments.AddToPlaylistDialog
import com.github.apognu.otter.fragments.AlbumsFragment import org.funkwhale.ffa.fragments.AlbumsFragment
import com.github.apognu.otter.fragments.ArtistsFragment import org.funkwhale.ffa.fragments.ArtistsFragment
import com.github.apognu.otter.repositories.* import org.funkwhale.ffa.repositories.*
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import kotlinx.android.synthetic.main.activity_search.* import kotlinx.android.synthetic.main.activity_search.*
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -168,4 +168,4 @@ class SearchActivity : AppCompatActivity() {
} }
} }
} }
} }

18
app/src/main/java/com/github/apognu/otter/activities/SettingsActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/SettingsActivity.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.content.* import android.content.*
import android.os.Bundle import android.os.Bundle
@ -10,12 +10,12 @@ import androidx.preference.ListPreference
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SeekBarPreference import androidx.preference.SeekBarPreference
import com.github.apognu.otter.BuildConfig import org.funkwhale.ffa.BuildConfig
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.utils.Cache import org.funkwhale.ffa.utils.Cache
import com.github.apognu.otter.utils.Command import org.funkwhale.ffa.utils.Command
import com.github.apognu.otter.utils.CommandBus import org.funkwhale.ffa.utils.CommandBus
class SettingsActivity : AppCompatActivity() { class SettingsActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -82,7 +82,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
.setPositiveButton(android.R.string.yes) { _, _ -> .setPositiveButton(android.R.string.yes) { _, _ ->
CommandBus.send(Command.ClearQueue) CommandBus.send(Command.ClearQueue)
Otter.get().deleteAllData() FFA.get().deleteAllData()
activity?.setResult(MainActivity.ResultCode.LOGOUT.code) activity?.setResult(MainActivity.ResultCode.LOGOUT.code)
activity?.finish() activity?.finish()
@ -154,4 +154,4 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/activities/SplashActivity.kt → app/src/main/java/org/funkwhale/ffa/activities/SplashActivity.kt

@ -1,12 +1,12 @@
package com.github.apognu.otter.activities package org.funkwhale.ffa.activities
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Settings import org.funkwhale.ffa.utils.Settings
class SplashActivity : AppCompatActivity() { class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -21,7 +21,7 @@ class SplashActivity : AppCompatActivity() {
} }
false -> Intent(this@SplashActivity, LoginActivity::class.java).apply { false -> Intent(this@SplashActivity, LoginActivity::class.java).apply {
Otter.get().deleteAllData() FFA.get().deleteAllData()
flags = Intent.FLAG_ACTIVITY_NO_ANIMATION flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
@ -30,4 +30,4 @@ class SplashActivity : AppCompatActivity() {
} }
} }
} }
} }

14
app/src/main/java/com/github/apognu/otter/adapters/AlbumsAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/AlbumsAdapter.kt

@ -1,15 +1,15 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.Album import org.funkwhale.ffa.utils.Album
import com.github.apognu.otter.utils.maybeLoad import org.funkwhale.ffa.utils.maybeLoad
import com.github.apognu.otter.utils.maybeNormalizeUrl import org.funkwhale.ffa.utils.maybeNormalizeUrl
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_album.view.* import kotlinx.android.synthetic.main.row_album.view.*
@ -63,4 +63,4 @@ class AlbumsAdapter(val context: Context?, private val listener: OnAlbumClickLis
listener.onClick(view, data[layoutPosition]) listener.onClick(view, data[layoutPosition])
} }
} }
} }

14
app/src/main/java/com/github/apognu/otter/adapters/AlbumsGridAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/AlbumsGridAdapter.kt

@ -1,15 +1,15 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.Album import org.funkwhale.ffa.utils.Album
import com.github.apognu.otter.utils.maybeLoad import org.funkwhale.ffa.utils.maybeLoad
import com.github.apognu.otter.utils.maybeNormalizeUrl import org.funkwhale.ffa.utils.maybeNormalizeUrl
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_album_grid.view.* import kotlinx.android.synthetic.main.row_album_grid.view.*
@ -52,4 +52,4 @@ class AlbumsGridAdapter(val context: Context?, private val listener: OnAlbumClic
listener.onClick(view, data[layoutPosition]) listener.onClick(view, data[layoutPosition])
} }
} }
} }

14
app/src/main/java/com/github/apognu/otter/adapters/ArtistsAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/ArtistsAdapter.kt

@ -1,15 +1,15 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.Artist import org.funkwhale.ffa.utils.Artist
import com.github.apognu.otter.utils.maybeLoad import org.funkwhale.ffa.utils.maybeLoad
import com.github.apognu.otter.utils.maybeNormalizeUrl import org.funkwhale.ffa.utils.maybeNormalizeUrl
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_artist.view.* import kotlinx.android.synthetic.main.row_artist.view.*
@ -80,4 +80,4 @@ class ArtistsAdapter(val context: Context?, private val listener: OnArtistClickL
listener.onClick(view, active[layoutPosition]) listener.onClick(view, active[layoutPosition])
} }
} }
} }

8
app/src/main/java/com/github/apognu/otter/adapters/BrowseTabsAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/BrowseTabsAdapter.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.* import org.funkwhale.ffa.fragments.*
class BrowseTabsAdapter(val context: Fragment, manager: FragmentManager) : FragmentPagerAdapter(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { class BrowseTabsAdapter(val context: Fragment, manager: FragmentManager) : FragmentPagerAdapter(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
var tabs = mutableListOf<Fragment>() var tabs = mutableListOf<Fragment>()
@ -40,4 +40,4 @@ class BrowseTabsAdapter(val context: Fragment, manager: FragmentManager) : Fragm
else -> "" else -> ""
} }
} }
} }

10
app/src/main/java/com/github/apognu/otter/adapters/DownloadsAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/DownloadsAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.graphics.drawable.Icon import android.graphics.drawable.Icon
@ -6,9 +6,9 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.playback.PinService import org.funkwhale.ffa.playback.PinService
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.google.android.exoplayer2.offline.DownloadService import com.google.android.exoplayer2.offline.DownloadService
import kotlinx.android.synthetic.main.row_download.view.* import kotlinx.android.synthetic.main.row_download.view.*
@ -102,4 +102,4 @@ class DownloadsAdapter(private val context: Context, private val listener: OnDow
val toggle = view.toggle val toggle = view.toggle
val delete = view.delete val delete = view.delete
} }
} }

8
app/src/main/java/com/github/apognu/otter/adapters/FavoritesAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/FavoritesAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -10,9 +10,9 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_track.view.* import kotlinx.android.synthetic.main.row_track.view.*

8
app/src/main/java/com/github/apognu/otter/adapters/PlaylistTracksAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/PlaylistTracksAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -9,9 +9,9 @@ import androidx.appcompat.widget.PopupMenu
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_track.view.* import kotlinx.android.synthetic.main.row_track.view.*

12
app/src/main/java/com/github/apognu/otter/adapters/PlaylistsAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/PlaylistsAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
@ -6,10 +6,10 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.Playlist import org.funkwhale.ffa.utils.Playlist
import com.github.apognu.otter.utils.toDurationString import org.funkwhale.ffa.utils.toDurationString
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_playlist.view.* import kotlinx.android.synthetic.main.row_playlist.view.*
@ -83,4 +83,4 @@ class PlaylistsAdapter(val context: Context?, private val listener: OnPlaylistCl
listener.onClick(view, data[layoutPosition]) listener.onClick(view, data[layoutPosition])
} }
} }
} }

18
app/src/main/java/com/github/apognu/otter/adapters/RadiosAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/RadiosAdapter.kt

@ -1,17 +1,17 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Event import org.funkwhale.ffa.utils.Event
import com.github.apognu.otter.utils.EventBus import org.funkwhale.ffa.utils.EventBus
import com.github.apognu.otter.utils.Radio import org.funkwhale.ffa.utils.Radio
import com.github.apognu.otter.views.LoadingImageView import org.funkwhale.ffa.views.LoadingImageView
import com.preference.PowerPreference import com.preference.PowerPreference
import kotlinx.android.synthetic.main.row_radio.view.* import kotlinx.android.synthetic.main.row_radio.view.*
import kotlinx.android.synthetic.main.row_radio_header.view.* import kotlinx.android.synthetic.main.row_radio_header.view.*
@ -160,4 +160,4 @@ class RadiosAdapter(val context: Context?, val scope: CoroutineScope, private va
} }
} }
} }
} }

6
app/src/main/java/com/github/apognu/otter/adapters/SearchAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/SearchAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -12,8 +12,8 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_track.view.* import kotlinx.android.synthetic.main.row_track.view.*

8
app/src/main/java/com/github/apognu/otter/adapters/TracksAdapter.kt → app/src/main/java/org/funkwhale/ffa/adapters/TracksAdapter.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.adapters package org.funkwhale.ffa.adapters
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -9,9 +9,9 @@ import androidx.appcompat.widget.PopupMenu
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.OtterAdapter import org.funkwhale.ffa.fragments.OtterAdapter
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.row_track.view.* import kotlinx.android.synthetic.main.row_track.view.*

12
app/src/main/java/com/github/apognu/otter/fragments/AddToPlaylistDialog.kt → app/src/main/java/org/funkwhale/ffa/fragments/AddToPlaylistDialog.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.app.Activity import android.app.Activity
import android.app.AlertDialog import android.app.AlertDialog
@ -6,10 +6,10 @@ import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.core.widget.addTextChangedListener import androidx.core.widget.addTextChangedListener
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.PlaylistsAdapter import org.funkwhale.ffa.adapters.PlaylistsAdapter
import com.github.apognu.otter.repositories.ManagementPlaylistsRepository import org.funkwhale.ffa.repositories.ManagementPlaylistsRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.gson.Gson import com.google.gson.Gson
import kotlinx.android.synthetic.main.dialog_add_to_playlist.* import kotlinx.android.synthetic.main.dialog_add_to_playlist.*
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@ -102,4 +102,4 @@ object AddToPlaylistDialog {
} }
} }
} }
} }

18
app/src/main/java/com/github/apognu/otter/fragments/AlbumsFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/AlbumsFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
@ -13,13 +13,13 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.CircularProgressDrawable import androidx.swiperefreshlayout.widget.CircularProgressDrawable
import androidx.transition.Fade import androidx.transition.Fade
import androidx.transition.Slide import androidx.transition.Slide
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.activities.MainActivity import org.funkwhale.ffa.activities.MainActivity
import com.github.apognu.otter.adapters.AlbumsAdapter import org.funkwhale.ffa.adapters.AlbumsAdapter
import com.github.apognu.otter.repositories.AlbumsRepository import org.funkwhale.ffa.repositories.AlbumsRepository
import com.github.apognu.otter.repositories.ArtistTracksRepository import org.funkwhale.ffa.repositories.ArtistTracksRepository
import com.github.apognu.otter.repositories.Repository import org.funkwhale.ffa.repositories.Repository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.fragment_albums.* import kotlinx.android.synthetic.main.fragment_albums.*
@ -172,4 +172,4 @@ class AlbumsFragment : OtterFragment<Album, AlbumsAdapter>() {
openTracks(context, album, fragment = this@AlbumsFragment) openTracks(context, album, fragment = this@AlbumsFragment)
} }
} }
} }

16
app/src/main/java/com/github/apognu/otter/fragments/AlbumsGridFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/AlbumsGridFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
@ -7,12 +7,12 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.transition.Fade import androidx.transition.Fade
import androidx.transition.Slide import androidx.transition.Slide
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.activities.MainActivity import org.funkwhale.ffa.activities.MainActivity
import com.github.apognu.otter.adapters.AlbumsGridAdapter import org.funkwhale.ffa.adapters.AlbumsGridAdapter
import com.github.apognu.otter.repositories.AlbumsRepository import org.funkwhale.ffa.repositories.AlbumsRepository
import com.github.apognu.otter.utils.Album import org.funkwhale.ffa.utils.Album
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import kotlinx.android.synthetic.main.fragment_albums_grid.* import kotlinx.android.synthetic.main.fragment_albums_grid.*
class AlbumsGridFragment : OtterFragment<Album, AlbumsGridAdapter>() { class AlbumsGridFragment : OtterFragment<Album, AlbumsGridAdapter>() {
@ -55,4 +55,4 @@ class AlbumsGridFragment : OtterFragment<Album, AlbumsGridAdapter>() {
} }
} }
} }
} }

16
app/src/main/java/com/github/apognu/otter/fragments/ArtistsFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/ArtistsFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
@ -9,13 +9,13 @@ import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.transition.Fade import androidx.transition.Fade
import androidx.transition.Slide import androidx.transition.Slide
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.activities.MainActivity import org.funkwhale.ffa.activities.MainActivity
import com.github.apognu.otter.adapters.ArtistsAdapter import org.funkwhale.ffa.adapters.ArtistsAdapter
import com.github.apognu.otter.repositories.ArtistsRepository import org.funkwhale.ffa.repositories.ArtistsRepository
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Artist import org.funkwhale.ffa.utils.Artist
import com.github.apognu.otter.utils.onViewPager import org.funkwhale.ffa.utils.onViewPager
import kotlinx.android.synthetic.main.fragment_artists.* import kotlinx.android.synthetic.main.fragment_artists.*
class ArtistsFragment : OtterFragment<Artist, ArtistsAdapter>() { class ArtistsFragment : OtterFragment<Artist, ArtistsAdapter>() {

8
app/src/main/java/com/github/apognu/otter/fragments/BrowseFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/BrowseFragment.kt

@ -1,12 +1,12 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.BrowseTabsAdapter import org.funkwhale.ffa.adapters.BrowseTabsAdapter
import kotlinx.android.synthetic.main.fragment_browse.view.* import kotlinx.android.synthetic.main.fragment_browse.view.*
class BrowseFragment : Fragment() { class BrowseFragment : Fragment() {
@ -31,4 +31,4 @@ class BrowseFragment : Fragment() {
fun selectTabAt(position: Int) { fun selectTabAt(position: Int) {
view?.tabs?.getTabAt(position)?.select() view?.tabs?.getTabAt(position)?.select()
} }
} }

12
app/src/main/java/com/github/apognu/otter/fragments/FavoritesFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/FavoritesFragment.kt

@ -1,13 +1,13 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.FavoritesAdapter import org.funkwhale.ffa.adapters.FavoritesAdapter
import com.github.apognu.otter.repositories.FavoritesRepository import org.funkwhale.ffa.repositories.FavoritesRepository
import com.github.apognu.otter.repositories.TracksRepository import org.funkwhale.ffa.repositories.TracksRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import kotlinx.android.synthetic.main.fragment_favorites.* import kotlinx.android.synthetic.main.fragment_favorites.*
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO

10
app/src/main/java/com/github/apognu/otter/fragments/LandscapeQueueFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/LandscapeQueueFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -7,9 +7,9 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.TracksAdapter import org.funkwhale.ffa.adapters.TracksAdapter
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import kotlinx.android.synthetic.main.partial_queue.* import kotlinx.android.synthetic.main.partial_queue.*
import kotlinx.android.synthetic.main.partial_queue.view.* import kotlinx.android.synthetic.main.partial_queue.view.*
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
@ -93,4 +93,4 @@ class LandscapeQueueFragment : Fragment() {
} }
} }
} }
} }

6
app/src/main/java/com/github/apognu/otter/fragments/LoginDialog.kt → app/src/main/java/org/funkwhale/ffa/fragments/LoginDialog.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.app.AlertDialog import android.app.AlertDialog
import android.app.Dialog import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import com.github.apognu.otter.R import org.funkwhale.ffa.R
class LoginDialog : DialogFragment() { class LoginDialog : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
@ -20,4 +20,4 @@ class LoginDialog : DialogFragment() {
dialog?.setCanceledOnTouchOutside(false) dialog?.setCanceledOnTouchOutside(false)
dialog?.setCancelable(false) dialog?.setCancelable(false)
} }
} }

8
app/src/main/java/com/github/apognu/otter/fragments/OtterFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/OtterFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -9,9 +9,9 @@ import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator import androidx.recyclerview.widget.SimpleItemAnimator
import com.github.apognu.otter.repositories.HttpUpstream import org.funkwhale.ffa.repositories.HttpUpstream
import com.github.apognu.otter.repositories.Repository import org.funkwhale.ffa.repositories.Repository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.gson.Gson import com.google.gson.Gson
import kotlinx.android.synthetic.main.fragment_artists.* import kotlinx.android.synthetic.main.fragment_artists.*
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO

14
app/src/main/java/com/github/apognu/otter/fragments/PlaylistTracksFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/PlaylistTracksFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
@ -7,12 +7,12 @@ import androidx.appcompat.widget.PopupMenu
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.PlaylistTracksAdapter import org.funkwhale.ffa.adapters.PlaylistTracksAdapter
import com.github.apognu.otter.repositories.FavoritesRepository import org.funkwhale.ffa.repositories.FavoritesRepository
import com.github.apognu.otter.repositories.ManagementPlaylistsRepository import org.funkwhale.ffa.repositories.ManagementPlaylistsRepository
import com.github.apognu.otter.repositories.PlaylistTracksRepository import org.funkwhale.ffa.repositories.PlaylistTracksRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import jp.wasabeef.picasso.transformations.RoundedCornersTransformation import jp.wasabeef.picasso.transformations.RoundedCornersTransformation
import kotlinx.android.synthetic.main.fragment_tracks.* import kotlinx.android.synthetic.main.fragment_tracks.*

16
app/src/main/java/com/github/apognu/otter/fragments/PlaylistsFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/PlaylistsFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
@ -6,12 +6,12 @@ import android.view.animation.AccelerateDecelerateInterpolator
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.transition.Fade import androidx.transition.Fade
import androidx.transition.Slide import androidx.transition.Slide
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.activities.MainActivity import org.funkwhale.ffa.activities.MainActivity
import com.github.apognu.otter.adapters.PlaylistsAdapter import org.funkwhale.ffa.adapters.PlaylistsAdapter
import com.github.apognu.otter.repositories.PlaylistsRepository import org.funkwhale.ffa.repositories.PlaylistsRepository
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Playlist import org.funkwhale.ffa.utils.Playlist
import kotlinx.android.synthetic.main.fragment_playlists.* import kotlinx.android.synthetic.main.fragment_playlists.*
class PlaylistsFragment : OtterFragment<Playlist, PlaylistsAdapter>() { class PlaylistsFragment : OtterFragment<Playlist, PlaylistsAdapter>() {
@ -53,4 +53,4 @@ class PlaylistsFragment : OtterFragment<Playlist, PlaylistsAdapter>() {
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/fragments/QueueFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/QueueFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.app.Dialog import android.app.Dialog
import android.os.Bundle import android.os.Bundle
@ -8,10 +8,10 @@ import android.view.ViewGroup
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.TracksAdapter import org.funkwhale.ffa.adapters.TracksAdapter
import com.github.apognu.otter.repositories.FavoritesRepository import org.funkwhale.ffa.repositories.FavoritesRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.fragment_queue.* import kotlinx.android.synthetic.main.fragment_queue.*
@ -126,4 +126,4 @@ class QueueFragment : BottomSheetDialogFragment() {
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/fragments/RadiosFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/RadiosFragment.kt

@ -1,13 +1,13 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import androidx.core.view.forEach import androidx.core.view.forEach
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.RadiosAdapter import org.funkwhale.ffa.adapters.RadiosAdapter
import com.github.apognu.otter.repositories.RadiosRepository import org.funkwhale.ffa.repositories.RadiosRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import kotlinx.android.synthetic.main.fragment_radios.* import kotlinx.android.synthetic.main.fragment_radios.*
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
@ -50,4 +50,4 @@ class RadiosFragment : OtterFragment<Radio, RadiosAdapter>() {
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/fragments/TrackInfoDetailsFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/TrackInfoDetailsFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
@ -10,10 +10,10 @@ import android.view.ViewGroup.LayoutParams
import android.widget.TextView import android.widget.TextView
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.utils.Track import org.funkwhale.ffa.utils.Track
import com.github.apognu.otter.utils.mustNormalizeUrl import org.funkwhale.ffa.utils.mustNormalizeUrl
import com.github.apognu.otter.utils.toDurationString import org.funkwhale.ffa.utils.toDurationString
import kotlinx.android.synthetic.main.fragment_track_info_details.* import kotlinx.android.synthetic.main.fragment_track_info_details.*
class TrackInfoDetailsFragment : DialogFragment() { class TrackInfoDetailsFragment : DialogFragment() {
@ -82,4 +82,4 @@ class TrackInfoDetailsFragment : DialogFragment() {
infos.addView(valueTextView) infos.addView(valueTextView)
} }
} }
} }

14
app/src/main/java/com/github/apognu/otter/fragments/TracksFragment.kt → app/src/main/java/org/funkwhale/ffa/fragments/TracksFragment.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.fragments package org.funkwhale.ffa.fragments
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
@ -7,12 +7,12 @@ import androidx.appcompat.widget.PopupMenu
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.adapters.TracksAdapter import org.funkwhale.ffa.adapters.TracksAdapter
import com.github.apognu.otter.repositories.FavoritedRepository import org.funkwhale.ffa.repositories.FavoritedRepository
import com.github.apognu.otter.repositories.FavoritesRepository import org.funkwhale.ffa.repositories.FavoritesRepository
import com.github.apognu.otter.repositories.TracksRepository import org.funkwhale.ffa.repositories.TracksRepository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.preference.PowerPreference import com.preference.PowerPreference
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso

16
app/src/main/java/com/github/apognu/otter/playback/MediaControlsManager.kt → app/src/main/java/org/funkwhale/ffa/playback/MediaControlsManager.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.app.Notification import android.app.Notification
import android.app.PendingIntent import android.app.PendingIntent
@ -10,12 +10,12 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import androidx.media.app.NotificationCompat.MediaStyle import androidx.media.app.NotificationCompat.MediaStyle
import androidx.media.session.MediaButtonReceiver import androidx.media.session.MediaButtonReceiver
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.activities.MainActivity import org.funkwhale.ffa.activities.MainActivity
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Track import org.funkwhale.ffa.utils.Track
import com.github.apognu.otter.utils.maybeNormalizeUrl import org.funkwhale.ffa.utils.maybeNormalizeUrl
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers.Default import kotlinx.coroutines.Dispatchers.Default
@ -99,7 +99,7 @@ class MediaControlsManager(val context: Service, private val scope: CoroutineSco
} }
} }
Otter.get().mediaSession.connector.invalidateMediaSessionMetadata() FFA.get().mediaSession.connector.invalidateMediaSessionMetadata()
} }
} }
} }

6
app/src/main/java/com/github/apognu/otter/playback/MediaSession.kt → app/src/main/java/org/funkwhale/ffa/playback/MediaSession.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
@ -6,8 +6,8 @@ import android.os.Bundle
import android.os.ResultReceiver import android.os.ResultReceiver
import android.support.v4.media.session.MediaSessionCompat import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat import android.support.v4.media.session.PlaybackStateCompat
import com.github.apognu.otter.utils.Command import org.funkwhale.ffa.utils.Command
import com.github.apognu.otter.utils.CommandBus import org.funkwhale.ffa.utils.CommandBus
import com.google.android.exoplayer2.ControlDispatcher import com.google.android.exoplayer2.ControlDispatcher
import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector

39
app/src/main/java/com/github/apognu/otter/playback/PinService.kt → app/src/main/java/org/funkwhale/ffa/playback/PinService.kt

@ -1,12 +1,9 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.app.Notification import android.app.Notification
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import com.github.apognu.otter.Otter
import com.github.apognu.otter.R
import com.github.apognu.otter.utils.*
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.google.android.exoplayer2.offline.DownloadManager import com.google.android.exoplayer2.offline.DownloadManager
import com.google.android.exoplayer2.offline.DownloadRequest import com.google.android.exoplayer2.offline.DownloadRequest
@ -19,7 +16,18 @@ import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.util.* import org.funkwhale.ffa.FFA
import org.funkwhale.ffa.R
import org.funkwhale.ffa.utils.AppContext
import org.funkwhale.ffa.utils.DownloadInfo
import org.funkwhale.ffa.utils.Event
import org.funkwhale.ffa.utils.EventBus
import org.funkwhale.ffa.utils.Request
import org.funkwhale.ffa.utils.RequestBus
import org.funkwhale.ffa.utils.Response
import org.funkwhale.ffa.utils.Track
import org.funkwhale.ffa.utils.mustNormalizeUrl
import java.util.Collections
class PinService : DownloadService(AppContext.NOTIFICATION_DOWNLOADS) { class PinService : DownloadService(AppContext.NOTIFICATION_DOWNLOADS) {
private val scope: CoroutineScope = CoroutineScope(Job() + Main) private val scope: CoroutineScope = CoroutineScope(Job() + Main)
@ -38,7 +46,14 @@ class PinService : DownloadService(AppContext.NOTIFICATION_DOWNLOADS) {
) )
).toByteArray() ).toByteArray()
DownloadRequest(url, DownloadRequest.TYPE_PROGRESSIVE, Uri.parse(url), Collections.emptyList(), null, data).also { DownloadRequest(
url,
DownloadRequest.TYPE_PROGRESSIVE,
Uri.parse(url),
Collections.emptyList(),
null,
data
).also {
sendAddDownload(context, PinService::class.java, it, false) sendAddDownload(context, PinService::class.java, it, false)
} }
} }
@ -59,16 +74,20 @@ class PinService : DownloadService(AppContext.NOTIFICATION_DOWNLOADS) {
return super.onStartCommand(intent, flags, startId) return super.onStartCommand(intent, flags, startId)
} }
override fun getDownloadManager() = Otter.get().exoDownloadManager.apply { override fun getDownloadManager() = FFA.get().exoDownloadManager.apply {
addListener(DownloadListener()) addListener(DownloadListener())
} }
override fun getScheduler(): Scheduler? = null override fun getScheduler(): Scheduler? = null
override fun getForegroundNotification(downloads: MutableList<Download>): Notification { override fun getForegroundNotification(downloads: MutableList<Download>): Notification {
val description = resources.getQuantityString(R.plurals.downloads_description, downloads.size, downloads.size) val description =
resources.getQuantityString(R.plurals.downloads_description, downloads.size, downloads.size)
return DownloadNotificationHelper(this, AppContext.NOTIFICATION_CHANNEL_DOWNLOADS).buildProgressNotification(R.drawable.downloads, null, description, downloads) return DownloadNotificationHelper(
this,
AppContext.NOTIFICATION_CHANNEL_DOWNLOADS
).buildProgressNotification(R.drawable.downloads, null, description, downloads)
} }
private fun getDownloads() = downloadManager.downloadIndex.getDownloads() private fun getDownloads() = downloadManager.downloadIndex.getDownloads()
@ -80,4 +99,4 @@ class PinService : DownloadService(AppContext.NOTIFICATION_DOWNLOADS) {
EventBus.send(Event.DownloadChanged(download)) EventBus.send(Event.DownloadChanged(download))
} }
} }
} }

62
app/src/main/java/com/github/apognu/otter/playback/PlayerService.kt → app/src/main/java/org/funkwhale/ffa/playback/PlayerService.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Service import android.app.Service
@ -15,9 +15,6 @@ import android.support.v4.media.MediaMetadataCompat
import android.view.KeyEvent import android.view.KeyEvent
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import androidx.media.session.MediaButtonReceiver import androidx.media.session.MediaButtonReceiver
import com.github.apognu.otter.Otter
import com.github.apognu.otter.R
import com.github.apognu.otter.utils.*
import com.google.android.exoplayer2.C import com.google.android.exoplayer2.C
import com.google.android.exoplayer2.ExoPlaybackException import com.google.android.exoplayer2.ExoPlaybackException
import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.Player
@ -29,6 +26,9 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
import org.funkwhale.ffa.FFA
import org.funkwhale.ffa.R
import org.funkwhale.ffa.utils.*
class PlayerService : Service() { class PlayerService : Service() {
companion object { companion object {
@ -62,10 +62,13 @@ class PlayerService : Service() {
intent.extras?.getParcelable<KeyEvent>(Intent.EXTRA_KEY_EVENT)?.let { key -> intent.extras?.getParcelable<KeyEvent>(Intent.EXTRA_KEY_EVENT)?.let { key ->
when (key.keyCode) { when (key.keyCode) {
KeyEvent.KEYCODE_MEDIA_PLAY, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> { KeyEvent.KEYCODE_MEDIA_PLAY, KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE -> {
if (hasAudioFocus(true)) MediaButtonReceiver.handleIntent(Otter.get().mediaSession.session, intent) if (hasAudioFocus(true)) MediaButtonReceiver.handleIntent(
FFA.get().mediaSession.session,
intent
)
Unit Unit
} }
else -> MediaButtonReceiver.handleIntent(Otter.get().mediaSession.session, intent) else -> MediaButtonReceiver.handleIntent(FFA.get().mediaSession.session, intent)
} }
} }
} }
@ -105,7 +108,7 @@ class PlayerService : Service() {
} }
} }
mediaControlsManager = MediaControlsManager(this, scope, Otter.get().mediaSession.session) mediaControlsManager = MediaControlsManager(this, scope, FFA.get().mediaSession.session)
player = SimpleExoPlayer.Builder(this).build().apply { player = SimpleExoPlayer.Builder(this).build().apply {
playWhenReady = false playWhenReady = false
@ -115,9 +118,9 @@ class PlayerService : Service() {
} }
} }
Otter.get().mediaSession.active = true FFA.get().mediaSession.active = true
Otter.get().mediaSession.connector.apply { FFA.get().mediaSession.connector.apply {
setPlayer(player) setPlayer(player)
setMediaMetadataProvider { setMediaMetadataProvider {
@ -137,7 +140,10 @@ class PlayerService : Service() {
} }
} }
registerReceiver(headphonesUnpluggedReceiver, IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY)) registerReceiver(
headphonesUnpluggedReceiver,
IntentFilter(AudioManager.ACTION_AUDIO_BECOMING_NOISY)
)
} }
private fun watchEventBus() { private fun watchEventBus() {
@ -197,7 +203,12 @@ class PlayerService : Service() {
is Command.SetRepeatMode -> player.repeatMode = command.mode is Command.SetRepeatMode -> player.repeatMode = command.mode
is Command.PinTrack -> PinService.download(this@PlayerService, command.track) is Command.PinTrack -> PinService.download(this@PlayerService, command.track)
is Command.PinTracks -> command.tracks.forEach { PinService.download(this@PlayerService, it) } is Command.PinTracks -> command.tracks.forEach {
PinService.download(
this@PlayerService,
it
)
}
} }
} }
} }
@ -260,7 +271,7 @@ class PlayerService : Service() {
setPlaybackState(false) setPlaybackState(false)
player.release() player.release()
Otter.get().mediaSession.active = false FFA.get().mediaSession.active = false
super.onDestroy() super.onDestroy()
} }
@ -330,11 +341,17 @@ class PlayerService : Service() {
return mediaMetadataBuilder.apply { return mediaMetadataBuilder.apply {
putString(MediaMetadataCompat.METADATA_KEY_TITLE, track.title) putString(MediaMetadataCompat.METADATA_KEY_TITLE, track.title)
putString(MediaMetadataCompat.METADATA_KEY_ARTIST, track.artist.name) putString(MediaMetadataCompat.METADATA_KEY_ARTIST, track.artist.name)
putLong(MediaMetadata.METADATA_KEY_DURATION, (track.bestUpload()?.duration?.toLong() ?: 0L) * 1000) putLong(
MediaMetadata.METADATA_KEY_DURATION,
(track.bestUpload()?.duration?.toLong() ?: 0L) * 1000
)
try { try {
runBlocking(IO) { runBlocking(IO) {
this@apply.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, Picasso.get().load(coverUrl).get()) this@apply.putBitmap(
MediaMetadataCompat.METADATA_KEY_ALBUM_ART,
Picasso.get().load(coverUrl).get()
)
} }
} catch (e: Exception) { } catch (e: Exception) {
} }
@ -361,7 +378,11 @@ class PlayerService : Service() {
{ {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
audioManager.requestAudioFocus(audioFocusChangeListener, AudioAttributes.CONTENT_TYPE_MUSIC, AudioManager.AUDIOFOCUS_GAIN).let { audioManager.requestAudioFocus(
audioFocusChangeListener,
AudioAttributes.CONTENT_TYPE_MUSIC,
AudioManager.AUDIOFOCUS_GAIN
).let {
allowed = when (it) { allowed = when (it) {
AudioManager.AUDIOFOCUS_REQUEST_GRANTED -> true AudioManager.AUDIOFOCUS_REQUEST_GRANTED -> true
else -> false else -> false
@ -425,7 +446,10 @@ class PlayerService : Service() {
} }
} }
override fun onTracksChanged(trackGroups: TrackGroupArray, trackSelections: TrackSelectionArray) { override fun onTracksChanged(
trackGroups: TrackGroupArray,
trackSelections: TrackSelectionArray
) {
super.onTracksChanged(trackGroups, trackSelections) super.onTracksChanged(trackGroups, trackSelections)
if (queue.current != player.currentWindowIndex) { if (queue.current != player.currentWindowIndex) {
@ -433,7 +457,9 @@ class PlayerService : Service() {
mediaControlsManager.updateNotification(queue.current(), player.playWhenReady) mediaControlsManager.updateNotification(queue.current(), player.playWhenReady)
} }
if (queue.get().isNotEmpty() && queue.current() == queue.get().last() && radioPlayer.isActive()) { if (queue.get().isNotEmpty() && queue.current() == queue.get()
.last() && radioPlayer.isActive()
) {
scope.launch(IO) { scope.launch(IO) {
if (radioPlayer.lock.tryAcquire()) { if (radioPlayer.lock.tryAcquire()) {
radioPlayer.prepareNextTrack() radioPlayer.prepareNextTrack()
@ -495,4 +521,4 @@ class PlayerService : Service() {
} }
} }
} }
} }

14
app/src/main/java/com/github/apognu/otter/playback/QueueManager.kt → app/src/main/java/org/funkwhale/ffa/playback/QueueManager.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.content.Context import android.content.Context
import android.net.Uri import android.net.Uri
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.android.exoplayer2.source.ConcatenatingMediaSource import com.google.android.exoplayer2.source.ConcatenatingMediaSource
import com.google.android.exoplayer2.source.ProgressiveMediaSource import com.google.android.exoplayer2.source.ProgressiveMediaSource
@ -30,10 +30,10 @@ class QueueManager(val context: Context) {
} }
} }
val playbackCache = CacheDataSourceFactory(Otter.get().exoCache, http) val playbackCache = CacheDataSourceFactory(FFA.get().exoCache, http)
return CacheDataSourceFactory( return CacheDataSourceFactory(
Otter.get().exoDownloadCache, FFA.get().exoDownloadCache,
playbackCache, playbackCache,
FileDataSource.Factory(), FileDataSource.Factory(),
null, null,
@ -208,4 +208,4 @@ class QueueManager(val context: Context) {
EventBus.send(Event.QueueChanged) EventBus.send(Event.QueueChanged)
} }
} }

12
app/src/main/java/com/github/apognu/otter/playback/RadioPlayer.kt → app/src/main/java/org/funkwhale/ffa/playback/RadioPlayer.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.playback package org.funkwhale.ffa.playback
import android.content.Context import android.content.Context
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.repositories.FavoritedRepository import org.funkwhale.ffa.repositories.FavoritedRepository
import com.github.apognu.otter.repositories.Repository import org.funkwhale.ffa.repositories.Repository
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult
import com.github.kittinunf.fuel.coroutines.awaitObjectResult import com.github.kittinunf.fuel.coroutines.awaitObjectResult
@ -144,4 +144,4 @@ class RadioPlayer(val context: Context, val scope: CoroutineScope) {
} }
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/repositories/AlbumsRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/AlbumsRepository.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.Album import org.funkwhale.ffa.utils.Album
import com.github.apognu.otter.utils.AlbumsCache import org.funkwhale.ffa.utils.AlbumsCache
import com.github.apognu.otter.utils.AlbumsResponse import org.funkwhale.ffa.utils.AlbumsResponse
import com.github.apognu.otter.utils.OtterResponse import org.funkwhale.ffa.utils.OtterResponse
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import java.io.BufferedReader import java.io.BufferedReader
@ -29,4 +29,4 @@ class AlbumsRepository(override val context: Context?, artistId: Int? = null) :
override fun cache(data: List<Album>) = AlbumsCache(data) override fun cache(data: List<Album>) = AlbumsCache(data)
override fun uncache(reader: BufferedReader) = gsonDeserializerOf(AlbumsCache::class.java).deserialize(reader) override fun uncache(reader: BufferedReader) = gsonDeserializerOf(AlbumsCache::class.java).deserialize(reader)
} }

12
app/src/main/java/com/github/apognu/otter/repositories/ArtistTracksRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/ArtistTracksRepository.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.OtterResponse import org.funkwhale.ffa.utils.OtterResponse
import com.github.apognu.otter.utils.Track import org.funkwhale.ffa.utils.Track
import com.github.apognu.otter.utils.TracksCache import org.funkwhale.ffa.utils.TracksCache
import com.github.apognu.otter.utils.TracksResponse import org.funkwhale.ffa.utils.TracksResponse
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import java.io.BufferedReader import java.io.BufferedReader
@ -15,4 +15,4 @@ class ArtistTracksRepository(override val context: Context?, private val artistI
override fun cache(data: List<Track>) = TracksCache(data) override fun cache(data: List<Track>) = TracksCache(data)
override fun uncache(reader: BufferedReader) = gsonDeserializerOf(TracksCache::class.java).deserialize(reader) override fun uncache(reader: BufferedReader) = gsonDeserializerOf(TracksCache::class.java).deserialize(reader)
} }

12
app/src/main/java/com/github/apognu/otter/repositories/ArtistsRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/ArtistsRepository.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.Artist import org.funkwhale.ffa.utils.Artist
import com.github.apognu.otter.utils.ArtistsCache import org.funkwhale.ffa.utils.ArtistsCache
import com.github.apognu.otter.utils.ArtistsResponse import org.funkwhale.ffa.utils.ArtistsResponse
import com.github.apognu.otter.utils.OtterResponse import org.funkwhale.ffa.utils.OtterResponse
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import java.io.BufferedReader import java.io.BufferedReader
@ -15,4 +15,4 @@ class ArtistsRepository(override val context: Context?) : Repository<Artist, Art
override fun cache(data: List<Artist>) = ArtistsCache(data) override fun cache(data: List<Artist>) = ArtistsCache(data)
override fun uncache(reader: BufferedReader) = gsonDeserializerOf(ArtistsCache::class.java).deserialize(reader) override fun uncache(reader: BufferedReader) = gsonDeserializerOf(ArtistsCache::class.java).deserialize(reader)
} }

8
app/src/main/java/com/github/apognu/otter/repositories/FavoritesRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/FavoritesRepository.kt

@ -1,8 +1,8 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitByteArrayResponseResult import com.github.kittinunf.fuel.coroutines.awaitByteArrayResponseResult
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
@ -32,7 +32,7 @@ class FavoritesRepository(override val context: Context?) : Repository<Track, Tr
track.bestUpload()?.let { upload -> track.bestUpload()?.let { upload ->
maybeNormalizeUrl(upload.listen_url)?.let { url -> maybeNormalizeUrl(upload.listen_url)?.let { url ->
track.cached = Otter.get().exoCache.isCached(url, 0, upload.duration * 1000L) track.cached = FFA.get().exoCache.isCached(url, 0, upload.duration * 1000L)
} }
} }

6
app/src/main/java/com/github/apognu/otter/repositories/HttpUpstream.kt → app/src/main/java/org/funkwhale/ffa/repositories/HttpUpstream.kt

@ -1,7 +1,7 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.net.Uri import android.net.Uri
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.core.FuelError import com.github.kittinunf.fuel.core.FuelError
import com.github.kittinunf.fuel.core.ResponseDeserializable import com.github.kittinunf.fuel.core.ResponseDeserializable
@ -104,4 +104,4 @@ class HttpUpstream<D : Any, R : OtterResponse<D>>(val behavior: Behavior, privat
Result.error(FuelError.wrap(e)) Result.error(FuelError.wrap(e))
} }
} }
} }

12
app/src/main/java/com/github/apognu/otter/repositories/PlaylistTracksRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/PlaylistTracksRepository.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.OtterResponse import org.funkwhale.ffa.utils.OtterResponse
import com.github.apognu.otter.utils.PlaylistTrack import org.funkwhale.ffa.utils.PlaylistTrack
import com.github.apognu.otter.utils.PlaylistTracksCache import org.funkwhale.ffa.utils.PlaylistTracksCache
import com.github.apognu.otter.utils.PlaylistTracksResponse import org.funkwhale.ffa.utils.PlaylistTracksResponse
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
@ -30,4 +30,4 @@ class PlaylistTracksRepository(override val context: Context?, playlistId: Int)
track track
} }
} }
} }

4
app/src/main/java/com/github/apognu/otter/repositories/PlaylistsRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/PlaylistsRepository.kt

@ -1,7 +1,7 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitByteArrayResponseResult import com.github.kittinunf.fuel.coroutines.awaitByteArrayResponseResult
import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult

12
app/src/main/java/com/github/apognu/otter/repositories/RadiosRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/RadiosRepository.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.OtterResponse import org.funkwhale.ffa.utils.OtterResponse
import com.github.apognu.otter.utils.Radio import org.funkwhale.ffa.utils.Radio
import com.github.apognu.otter.utils.RadiosCache import org.funkwhale.ffa.utils.RadiosCache
import com.github.apognu.otter.utils.RadiosResponse import org.funkwhale.ffa.utils.RadiosResponse
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import java.io.BufferedReader import java.io.BufferedReader
@ -21,4 +21,4 @@ class RadiosRepository(override val context: Context?) : Repository<Radio, Radio
.map { radio -> radio.apply { radio_type = "custom" } } .map { radio -> radio.apply { radio_type = "custom" } }
.toMutableList() .toMutableList()
} }
} }

8
app/src/main/java/com/github/apognu/otter/repositories/Repository.kt → app/src/main/java/org/funkwhale/ffa/repositories/Repository.kt

@ -1,9 +1,9 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.utils.AppContext import org.funkwhale.ffa.utils.AppContext
import com.github.apognu.otter.utils.Cache import org.funkwhale.ffa.utils.Cache
import com.github.apognu.otter.utils.CacheItem import org.funkwhale.ffa.utils.CacheItem
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Job import kotlinx.coroutines.Job

10
app/src/main/java/com/github/apognu/otter/repositories/SearchRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/SearchRepository.kt

@ -1,8 +1,8 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
@ -33,7 +33,7 @@ class TracksSearchRepository(override val context: Context?, var query: String)
track.bestUpload()?.let { upload -> track.bestUpload()?.let { upload ->
val url = mustNormalizeUrl(upload.listen_url) val url = mustNormalizeUrl(upload.listen_url)
track.cached = Otter.get().exoCache.isCached(url, 0, upload.duration * 1000L) track.cached = FFA.get().exoCache.isCached(url, 0, upload.duration * 1000L)
} }
track track
@ -57,4 +57,4 @@ class AlbumsSearchRepository(override val context: Context?, var query: String)
override fun cache(data: List<Album>) = AlbumsCache(data) override fun cache(data: List<Album>) = AlbumsCache(data)
override fun uncache(reader: BufferedReader) = gsonDeserializerOf(AlbumsCache::class.java).deserialize(reader) override fun uncache(reader: BufferedReader) = gsonDeserializerOf(AlbumsCache::class.java).deserialize(reader)
} }

12
app/src/main/java/com/github/apognu/otter/repositories/TracksRepository.kt → app/src/main/java/org/funkwhale/ffa/repositories/TracksRepository.kt

@ -1,8 +1,8 @@
package com.github.apognu.otter.repositories package org.funkwhale.ffa.repositories
import android.content.Context import android.content.Context
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.github.apognu.otter.utils.* import org.funkwhale.ffa.utils.*
import com.github.kittinunf.fuel.gson.gsonDeserializerOf import com.github.kittinunf.fuel.gson.gsonDeserializerOf
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
@ -20,7 +20,7 @@ class TracksRepository(override val context: Context?, albumId: Int) : Repositor
companion object { companion object {
fun getDownloadedIds(): List<Int>? { fun getDownloadedIds(): List<Int>? {
val cursor = Otter.get().exoDownloadManager.downloadIndex.getDownloads() val cursor = FFA.get().exoDownloadManager.downloadIndex.getDownloads()
val ids: MutableList<Int> = mutableListOf() val ids: MutableList<Int> = mutableListOf()
while (cursor.moveToNext()) { while (cursor.moveToNext()) {
@ -52,10 +52,10 @@ class TracksRepository(override val context: Context?, albumId: Int) : Repositor
track.bestUpload()?.let { upload -> track.bestUpload()?.let { upload ->
val url = mustNormalizeUrl(upload.listen_url) val url = mustNormalizeUrl(upload.listen_url)
track.cached = Otter.get().exoCache.isCached(url, 0, upload.duration * 1000L) track.cached = FFA.get().exoCache.isCached(url, 0, upload.duration * 1000L)
} }
track track
}.sortedWith(compareBy({ it.disc_number }, { it.position })) }.sortedWith(compareBy({ it.disc_number }, { it.position }))
} }
} }

4
app/src/main/java/com/github/apognu/otter/utils/AppContext.kt → app/src/main/java/org/funkwhale/ffa/utils/AppContext.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
@ -8,7 +8,7 @@ import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.kittinunf.fuel.core.FuelManager import com.github.kittinunf.fuel.core.FuelManager
import com.github.kittinunf.fuel.core.Method import com.github.kittinunf.fuel.core.Method

20
app/src/main/java/com/github/apognu/otter/utils/Bus.kt → app/src/main/java/org/funkwhale/ffa/utils/Bus.kt

@ -1,6 +1,6 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import com.github.apognu.otter.Otter import org.funkwhale.ffa.FFA
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.google.android.exoplayer2.offline.DownloadCursor import com.google.android.exoplayer2.offline.DownloadCursor
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
@ -71,21 +71,21 @@ sealed class Response {
object EventBus { object EventBus {
fun send(event: Event) { fun send(event: Event) {
GlobalScope.launch(IO) { GlobalScope.launch(IO) {
Otter.get().eventBus.offer(event) FFA.get().eventBus.offer(event)
} }
} }
fun get() = Otter.get().eventBus.asFlow() fun get() = FFA.get().eventBus.asFlow()
} }
object CommandBus { object CommandBus {
fun send(command: Command) { fun send(command: Command) {
GlobalScope.launch(IO) { GlobalScope.launch(IO) {
Otter.get().commandBus.offer(command) FFA.get().commandBus.offer(command)
} }
} }
fun get() = Otter.get().commandBus.asFlow() fun get() = FFA.get().commandBus.asFlow()
} }
object RequestBus { object RequestBus {
@ -94,22 +94,22 @@ object RequestBus {
GlobalScope.launch(IO) { GlobalScope.launch(IO) {
request.channel = it request.channel = it
Otter.get().requestBus.offer(request) FFA.get().requestBus.offer(request)
} }
} }
} }
fun get() = Otter.get().requestBus.asFlow() fun get() = FFA.get().requestBus.asFlow()
} }
object ProgressBus { object ProgressBus {
fun send(current: Int, duration: Int, percent: Int) { fun send(current: Int, duration: Int, percent: Int) {
GlobalScope.launch(IO) { GlobalScope.launch(IO) {
Otter.get().progressBus.send(Triple(current, duration, percent)) FFA.get().progressBus.send(Triple(current, duration, percent))
} }
} }
fun get() = Otter.get().progressBus.asFlow().conflate() fun get() = FFA.get().progressBus.asFlow().conflate()
} }
suspend inline fun <reified T> Channel<Response>.wait(): T? { suspend inline fun <reified T> Channel<Response>.wait(): T? {

6
app/src/main/java/com/github/apognu/otter/utils/Data.kt → app/src/main/java/org/funkwhale/ffa/utils/Data.kt

@ -1,7 +1,7 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import android.content.Context import android.content.Context
import com.github.apognu.otter.activities.FwCredentials import org.funkwhale.ffa.activities.FwCredentials
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.core.FuelError import com.github.kittinunf.fuel.core.FuelError
import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult
@ -95,4 +95,4 @@ object Cache {
delete() delete()
} }
} }
} }

8
app/src/main/java/com/github/apognu/otter/utils/Extensions.kt → app/src/main/java/org/funkwhale/ffa/utils/Extensions.kt

@ -1,10 +1,10 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import android.os.Build import android.os.Build
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.github.apognu.otter.fragments.BrowseFragment import org.funkwhale.ffa.fragments.BrowseFragment
import com.github.apognu.otter.repositories.Repository import org.funkwhale.ffa.repositories.Repository
import com.github.kittinunf.fuel.core.Request import com.github.kittinunf.fuel.core.Request
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.google.gson.Gson import com.google.gson.Gson

4
app/src/main/java/com/github/apognu/otter/utils/Models.kt → app/src/main/java/org/funkwhale/ffa/utils/Models.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import com.google.android.exoplayer2.offline.Download import com.google.android.exoplayer2.offline.Download
import com.preference.PowerPreference import com.preference.PowerPreference
@ -176,4 +176,4 @@ data class DownloadInfo(
val title: String, val title: String,
val artist: String, val artist: String,
var download: Download? var download: Download?
) )

4
app/src/main/java/com/github/apognu/otter/utils/Userinfo.kt → app/src/main/java/org/funkwhale/ffa/utils/Userinfo.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import com.github.kittinunf.fuel.Fuel import com.github.kittinunf.fuel.Fuel
import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult import com.github.kittinunf.fuel.coroutines.awaitObjectResponseResult
@ -31,4 +31,4 @@ object Userinfo {
return null return null
} }
} }
} }

4
app/src/main/java/com/github/apognu/otter/utils/Util.kt → app/src/main/java/org/funkwhale/ffa/utils/Util.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.utils package org.funkwhale.ffa.utils
import android.content.Context import android.content.Context
import android.widget.Toast import android.widget.Toast
@ -16,7 +16,7 @@ private fun logClassName(): String {
val known = setOf( val known = setOf(
"dalvik.system.VMStack", "dalvik.system.VMStack",
"java.lang.Thread", "java.lang.Thread",
"com.github.apognu.otter.utils.UtilKt" "org.funkwhale.ffa.utils.UtilKt"
) )
Thread.currentThread().stackTrace.forEach { Thread.currentThread().stackTrace.forEach {

2
app/src/main/java/com/github/apognu/otter/views/DisableableFrameLayout.kt → app/src/main/java/org/funkwhale/ffa/views/DisableableFrameLayout.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.views package org.funkwhale.ffa.views
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet

6
app/src/main/java/com/github/apognu/otter/views/LoadingImageView.kt → app/src/main/java/org/funkwhale/ffa/views/LoadingImageView.kt

@ -1,11 +1,11 @@
package com.github.apognu.otter.views package org.funkwhale.ffa.views
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.content.Context import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import com.github.apognu.otter.R import org.funkwhale.ffa.R
object LoadingImageView { object LoadingImageView {
fun start(context: Context?, image: ImageView): ObjectAnimator? { fun start(context: Context?, image: ImageView): ObjectAnimator? {
@ -32,4 +32,4 @@ object LoadingImageView {
image.rotation = 0.0f image.rotation = 0.0f
} }
} }
} }

4
app/src/main/java/com/github/apognu/otter/views/NowPlayingView.kt → app/src/main/java/org/funkwhale/ffa/views/NowPlayingView.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.views package org.funkwhale.ffa.views
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Context import android.content.Context
@ -9,7 +9,7 @@ import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import android.view.animation.DecelerateInterpolator import android.view.animation.DecelerateInterpolator
import com.github.apognu.otter.R import org.funkwhale.ffa.R
import com.google.android.material.card.MaterialCardView import com.google.android.material.card.MaterialCardView
import kotlinx.android.synthetic.main.partial_now_playing.view.* import kotlinx.android.synthetic.main.partial_now_playing.view.*
import kotlin.math.abs import kotlin.math.abs

4
app/src/main/java/com/github/apognu/otter/views/SquareImageView.kt → app/src/main/java/org/funkwhale/ffa/views/SquareImageView.kt

@ -1,4 +1,4 @@
package com.github.apognu.otter.views package org.funkwhale.ffa.views
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
@ -14,4 +14,4 @@ class SquareImageView : AppCompatImageView {
setMeasuredDimension(measuredWidth, measuredWidth) setMeasuredDimension(measuredWidth, measuredWidth)
} }
} }

6
app/src/main/res/layout-land/activity_main.xml

@ -29,7 +29,7 @@
</LinearLayout> </LinearLayout>
<com.github.apognu.otter.views.NowPlayingView <org.funkwhale.ffa.views.NowPlayingView
android:id="@+id/now_playing" android:id="@+id/now_playing"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
@ -45,7 +45,7 @@
<include layout="@layout/partial_now_playing" /> <include layout="@layout/partial_now_playing" />
</com.github.apognu.otter.views.NowPlayingView> </org.funkwhale.ffa.views.NowPlayingView>
<com.google.android.material.bottomappbar.BottomAppBar <com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/appbar" android:id="@+id/appbar"
@ -58,4 +58,4 @@
app:navigationIcon="@drawable/funkwhaleshape" app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar" /> tools:menu="@menu/toolbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

10
app/src/main/res/layout-land/fragment_tracks.xml

@ -79,7 +79,7 @@
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintGuide_percent=".50" /> app:layout_constraintGuide_percent=".50" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_left" android:id="@+id/cover_top_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -91,7 +91,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_right" android:id="@+id/cover_top_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -103,7 +103,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_left" android:id="@+id/cover_bottom_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -115,7 +115,7 @@
app:layout_constraintTop_toTopOf="@id/vertical" app:layout_constraintTop_toTopOf="@id/vertical"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_right" android:id="@+id/cover_bottom_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -209,4 +209,4 @@
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

2
app/src/main/res/layout-land/partial_now_playing.xml

@ -35,7 +35,7 @@
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:layout_marginEnd="16dp"> android:layout_marginEnd="16dp">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/now_playing_cover" android:id="@+id/now_playing_cover"
android:layout_width="?attr/actionBarSize" android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"

8
app/src/main/res/layout/activity_main.xml

@ -5,14 +5,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.github.apognu.otter.views.DisableableFrameLayout <org.funkwhale.ffa.views.DisableableFrameLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="?attr/actionBarSize" android:layout_marginBottom="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.github.apognu.otter.views.NowPlayingView <org.funkwhale.ffa.views.NowPlayingView
android:id="@+id/now_playing" android:id="@+id/now_playing"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
@ -28,7 +28,7 @@
<include layout="@layout/partial_now_playing" /> <include layout="@layout/partial_now_playing" />
</com.github.apognu.otter.views.NowPlayingView> </org.funkwhale.ffa.views.NowPlayingView>
<com.google.android.material.bottomappbar.BottomAppBar <com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/appbar" android:id="@+id/appbar"
@ -41,4 +41,4 @@
app:navigationIcon="@drawable/funkwhaleshape" app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar" /> tools:menu="@menu/toolbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

10
app/src/main/res/layout/fragment_tracks.xml

@ -81,7 +81,7 @@
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintGuide_percent=".50" /> app:layout_constraintGuide_percent=".50" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_left" android:id="@+id/cover_top_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -93,7 +93,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_right" android:id="@+id/cover_top_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -105,7 +105,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_left" android:id="@+id/cover_bottom_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -117,7 +117,7 @@
app:layout_constraintTop_toTopOf="@id/vertical" app:layout_constraintTop_toTopOf="@id/vertical"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_right" android:id="@+id/cover_bottom_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -211,4 +211,4 @@
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

4
app/src/main/res/layout/partial_now_playing.xml

@ -35,7 +35,7 @@
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:layout_marginEnd="16dp"> android:layout_marginEnd="16dp">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/now_playing_cover" android:id="@+id/now_playing_cover"
android:layout_width="?attr/actionBarSize" android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
@ -111,7 +111,7 @@
android:layout_weight="1" android:layout_weight="1"
android:padding="8dp"> android:padding="8dp">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/now_playing_details_cover" android:id="@+id/now_playing_details_cover"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

4
app/src/main/res/layout/row_album.xml

@ -12,7 +12,7 @@
android:transitionGroup="true" android:transitionGroup="true"
tools:showIn="@layout/fragment_albums"> tools:showIn="@layout/fragment_albums">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/art" android:id="@+id/art"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -53,4 +53,4 @@
android:layout_weight="0" android:layout_weight="0"
android:background="@drawable/pill" /> android:background="@drawable/pill" />
</LinearLayout> </LinearLayout>

4
app/src/main/res/layout/row_album_grid.xml

@ -9,7 +9,7 @@
android:transitionGroup="true" android:transitionGroup="true"
tools:showIn="@layout/fragment_albums_grid"> tools:showIn="@layout/fragment_albums_grid">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover" android:id="@+id/cover"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -25,4 +25,4 @@
android:textAlignment="center" android:textAlignment="center"
tools:text="Black holes and revelations" /> tools:text="Black holes and revelations" />
</LinearLayout> </LinearLayout>

4
app/src/main/res/layout/row_artist.xml

@ -12,7 +12,7 @@
android:transitionGroup="true" android:transitionGroup="true"
tools:showIn="@layout/fragment_artists"> tools:showIn="@layout/fragment_artists">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/art" android:id="@+id/art"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -45,4 +45,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

10
app/src/main/res/layout/row_playlist.xml

@ -35,7 +35,7 @@
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintGuide_percent=".50" /> app:layout_constraintGuide_percent=".50" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_left" android:id="@+id/cover_top_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -47,7 +47,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_top_right" android:id="@+id/cover_top_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -59,7 +59,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_left" android:id="@+id/cover_bottom_left"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -71,7 +71,7 @@
app:layout_constraintTop_toTopOf="@id/vertical" app:layout_constraintTop_toTopOf="@id/vertical"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover_bottom_right" android:id="@+id/cover_bottom_right"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -112,4 +112,4 @@
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

4
app/src/main/res/layout/row_radio.xml

@ -12,7 +12,7 @@
android:transitionGroup="true" android:transitionGroup="true"
tools:showIn="@layout/fragment_radios"> tools:showIn="@layout/fragment_radios">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/art" android:id="@+id/art"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -47,4 +47,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

4
app/src/main/res/layout/row_track.xml

@ -12,7 +12,7 @@
android:transitionGroup="true" android:transitionGroup="true"
tools:showIn="@layout/fragment_tracks"> tools:showIn="@layout/fragment_tracks">
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/handle" android:id="@+id/handle"
android:layout_width="18dp" android:layout_width="18dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -22,7 +22,7 @@
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
<com.github.apognu.otter.views.SquareImageView <org.funkwhale.ffa.views.SquareImageView
android:id="@+id/cover" android:id="@+id/cover"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"

2
build.gradle.kts

@ -5,7 +5,7 @@ buildscript {
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:4.2.1") classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20")
} }
} }

Loading…
Cancel
Save