Update some dependencies and adapt where necessary

housekeeping/remove-warnings
Ryan Harg 2021-07-01 11:25:09 +00:00
rodzic 6bdc7f09ff
commit 4a1630032d
6 zmienionych plików z 109 dodań i 79 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
import org.jetbrains.kotlin.konan.properties.hasProperty import org.jetbrains.kotlin.konan.properties.hasProperty
import java.io.FileInputStream import java.io.FileInputStream
import java.util.* import java.util.Properties
plugins { plugins {
id("com.android.application") id("com.android.application")
@ -113,15 +114,15 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
implementation("androidx.appcompat:appcompat:1.2.0") implementation("androidx.appcompat:appcompat:1.3.0")
implementation("androidx.core:core-ktx:1.5.0-alpha02") implementation("androidx.core:core-ktx:1.6.0-rc01")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha07") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02")
implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0") implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
implementation("androidx.preference:preference:1.1.1") implementation("androidx.preference:preference-ktx:1.1.1")
implementation("androidx.recyclerview:recyclerview:1.1.0") implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("com.google.android.material:material:1.3.0-alpha02") implementation("com.google.android.material:material:1.4.0-rc01")
implementation("com.android.support.constraint:constraint-layout:2.0.1") implementation("com.android.support.constraint:constraint-layout:2.0.4")
implementation("com.google.android.exoplayer:exoplayer-core:2.11.5") implementation("com.google.android.exoplayer:exoplayer-core:2.11.5")
implementation("com.google.android.exoplayer:exoplayer-ui:2.11.5") implementation("com.google.android.exoplayer:exoplayer-ui:2.11.5")
@ -133,12 +134,12 @@ dependencies {
isTransitive = false isTransitive = false
} }
implementation("com.aliassadi:power-preference-lib:1.4.1") implementation("com.aliassadi:power-preference-lib:2.0.0")
implementation("com.github.kittinunf.fuel:fuel:2.1.0") implementation("com.github.kittinunf.fuel:fuel:2.1.0")
implementation("com.github.kittinunf.fuel:fuel-coroutines:2.1.0") implementation("com.github.kittinunf.fuel:fuel-coroutines:2.1.0")
implementation("com.github.kittinunf.fuel:fuel-android:2.1.0") implementation("com.github.kittinunf.fuel:fuel-android:2.1.0")
implementation("com.github.kittinunf.fuel:fuel-gson:2.1.0") implementation("com.github.kittinunf.fuel:fuel-gson:2.1.0")
implementation("com.google.code.gson:gson:2.8.6") implementation("com.google.code.gson:gson:2.8.6")
implementation("com.squareup.picasso:picasso:2.71828") implementation("com.squareup.picasso:picasso:2.71828")
implementation("jp.wasabeef:picasso-transformations:2.2.1") implementation("jp.wasabeef:picasso-transformations:2.4.0")
} }

Wyświetl plik

@ -122,7 +122,8 @@ class MainActivity : AppCompatActivity() {
CommandBus.send(Command.ToggleState) CommandBus.send(Command.ToggleState)
} }
now_playing_details_progress.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { now_playing_details_progress.setOnSeekBarChangeListener(object :
SeekBar.OnSeekBarChangeListener {
override fun onStopTrackingTouch(view: SeekBar?) {} override fun onStopTrackingTouch(view: SeekBar?) {}
override fun onStartTrackingTouch(view: SeekBar?) {} override fun onStartTrackingTouch(view: SeekBar?) {}
@ -135,7 +136,8 @@ class MainActivity : AppCompatActivity() {
}) })
landscape_queue?.let { landscape_queue?.let {
supportFragmentManager.beginTransaction().replace(R.id.landscape_queue, LandscapeQueueFragment()).commit() supportFragmentManager.beginTransaction()
.replace(R.id.landscape_queue, LandscapeQueueFragment()).commit()
} }
} }
@ -205,8 +207,7 @@ class MainActivity : AppCompatActivity() {
menu.findItem(R.id.nav_all_music).isEnabled = false menu.findItem(R.id.nav_all_music).isEnabled = false
menu.findItem(R.id.nav_my_music).isChecked = false menu.findItem(R.id.nav_my_music).isChecked = false
menu.findItem(R.id.nav_followed).isChecked = false menu.findItem(R.id.nav_followed).isChecked = false
PowerPreference.getDefaultFile().setString("scope", "all")
PowerPreference.getDefaultFile().set("scope", "all")
EventBus.send(Event.ListingsChanged) EventBus.send(Event.ListingsChanged)
return false return false
@ -234,7 +235,7 @@ class MainActivity : AppCompatActivity() {
scopes.add("all") scopes.add("all")
} }
PowerPreference.getDefaultFile().set("scope", scopes.joinToString(",")) PowerPreference.getDefaultFile().setString("scope", scopes.joinToString(","))
EventBus.send(Event.ListingsChanged) EventBus.send(Event.ListingsChanged)
return false return false
@ -254,7 +255,8 @@ class MainActivity : AppCompatActivity() {
Intent(this, LoginActivity::class.java).apply { Intent(this, LoginActivity::class.java).apply {
Otter.get().deleteAllData() Otter.get().deleteAllData()
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP flags =
Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
stopService(Intent(this@MainActivity, PlayerService::class.java)) stopService(Intent(this@MainActivity, PlayerService::class.java))
startActivity(this) startActivity(this)
@ -382,8 +384,8 @@ class MainActivity : AppCompatActivity() {
is Command.RefreshTrack -> refreshCurrentTrack(command.track) is Command.RefreshTrack -> refreshCurrentTrack(command.track)
is Command.AddToPlaylist -> if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) { is Command.AddToPlaylist -> if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
AddToPlaylistDialog.show(this@MainActivity, lifecycleScope, command.tracks) AddToPlaylistDialog.show(this@MainActivity, lifecycleScope, command.tracks)
} }
} }
} }
} }
@ -484,14 +486,25 @@ class MainActivity : AppCompatActivity() {
now_playing_details_info?.let { now_playing_details_info -> now_playing_details_info?.let { now_playing_details_info ->
now_playing_details_info.setOnClickListener { now_playing_details_info.setOnClickListener {
PopupMenu(this@MainActivity, now_playing_details_info, Gravity.START, R.attr.actionOverflowMenuStyle, 0).apply { PopupMenu(
this@MainActivity,
now_playing_details_info,
Gravity.START,
R.attr.actionOverflowMenuStyle,
0
).apply {
inflate(R.menu.track_info) inflate(R.menu.track_info)
setOnMenuItemClickListener { setOnMenuItemClickListener {
when (it.itemId) { when (it.itemId) {
R.id.track_info_artist -> ArtistsFragment.openAlbums(this@MainActivity, track.artist, art = track.album?.cover()) R.id.track_info_artist -> ArtistsFragment.openAlbums(
this@MainActivity,
track.artist,
art = track.album?.cover()
)
R.id.track_info_album -> AlbumsFragment.openTracks(this@MainActivity, track.album) R.id.track_info_album -> AlbumsFragment.openTracks(this@MainActivity, track.album)
R.id.track_info_details -> TrackInfoDetailsFragment.new(track).show(supportFragmentManager, "dialog") R.id.track_info_details -> TrackInfoDetailsFragment.new(track)
.show(supportFragmentManager, "dialog")
} }
now_playing.close() now_playing.close()
@ -548,7 +561,12 @@ class MainActivity : AppCompatActivity() {
Cache.set(this@MainActivity, "repeat", "0".toByteArray()) Cache.set(this@MainActivity, "repeat", "0".toByteArray())
now_playing_details_repeat?.setImageResource(R.drawable.repeat) now_playing_details_repeat?.setImageResource(R.drawable.repeat)
now_playing_details_repeat?.setColorFilter(ContextCompat.getColor(this, R.color.controlForeground)) now_playing_details_repeat?.setColorFilter(
ContextCompat.getColor(
this,
R.color.controlForeground
)
)
now_playing_details_repeat?.alpha = 0.2f now_playing_details_repeat?.alpha = 0.2f
CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_OFF)) CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_OFF))
@ -559,7 +577,12 @@ class MainActivity : AppCompatActivity() {
Cache.set(this@MainActivity, "repeat", "1".toByteArray()) Cache.set(this@MainActivity, "repeat", "1".toByteArray())
now_playing_details_repeat?.setImageResource(R.drawable.repeat) now_playing_details_repeat?.setImageResource(R.drawable.repeat)
now_playing_details_repeat?.setColorFilter(ContextCompat.getColor(this, R.color.controlForeground)) now_playing_details_repeat?.setColorFilter(
ContextCompat.getColor(
this,
R.color.controlForeground
)
)
now_playing_details_repeat?.alpha = 1.0f now_playing_details_repeat?.alpha = 1.0f
CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_ALL)) CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_ALL))
@ -569,7 +592,12 @@ class MainActivity : AppCompatActivity() {
2 -> { 2 -> {
Cache.set(this@MainActivity, "repeat", "2".toByteArray()) Cache.set(this@MainActivity, "repeat", "2".toByteArray())
now_playing_details_repeat?.setImageResource(R.drawable.repeat_one) now_playing_details_repeat?.setImageResource(R.drawable.repeat_one)
now_playing_details_repeat?.setColorFilter(ContextCompat.getColor(this, R.color.controlForeground)) now_playing_details_repeat?.setColorFilter(
ContextCompat.getColor(
this,
R.color.controlForeground
)
)
now_playing_details_repeat?.alpha = 1.0f now_playing_details_repeat?.alpha = 1.0f
CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_ONE)) CommandBus.send(Command.SetRepeatMode(Player.REPEAT_MODE_ONE))

Wyświetl plik

@ -156,7 +156,7 @@
android:layout_margin="8dp" android:layout_margin="8dp"
android:contentDescription="@string/alt_track_info" android:contentDescription="@string/alt_track_info"
android:src="@drawable/more" android:src="@drawable/more"
android:tint="@color/controlForeground" /> app:tint="@color/controlForeground" />
</LinearLayout> </LinearLayout>
@ -245,4 +245,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

Wyświetl plik

@ -130,7 +130,7 @@
android:background="@drawable/circle" android:background="@drawable/circle"
android:contentDescription="@string/alt_track_info" android:contentDescription="@string/alt_track_info"
android:src="@drawable/more" android:src="@drawable/more"
android:tint="@color/controlForeground" /> app:tint="@color/controlForeground" />
</FrameLayout> </FrameLayout>
@ -277,4 +277,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

Wyświetl plik

@ -1,60 +1,61 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:background="?android:attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingTop="6dp"
android:paddingEnd="16dp"
android:paddingBottom="6dp"
tools:showIn="@layout/activity_downloads">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"> android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingTop="6dp"
android:paddingEnd="16dp"
android:paddingBottom="6dp"
tools:showIn="@layout/activity_downloads">
<TextView <LinearLayout
android:id="@+id/title" android:layout_width="0dp"
style="@style/AppTheme.ItemTitle" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_weight="1"
android:layout_height="wrap_content" android:orientation="vertical">
tools:text="Track title" />
<TextView <TextView
android:id="@+id/artist" android:id="@+id/title"
android:layout_width="match_parent" style="@style/AppTheme.ItemTitle"
android:layout_height="wrap_content" android:layout_width="match_parent"
tools:text="Artist name" /> android:layout_height="wrap_content"
tools:text="Track title" />
<ProgressBar <TextView
android:id="@+id/progress" android:id="@+id/artist"
style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> tools:text="Artist name" />
</LinearLayout> <ProgressBar
android:id="@+id/progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageButton </LinearLayout>
android:id="@+id/toggle"
style="@style/IconButton"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="8dp"
android:src="@drawable/pause" />
<ImageButton <ImageButton
android:id="@+id/delete" android:id="@+id/toggle"
style="@style/IconButton" style="@style/IconButton"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:src="@drawable/delete" android:src="@drawable/pause" />
android:tint="@color/colorAccent" />
</LinearLayout> <ImageButton
android:id="@+id/delete"
style="@style/IconButton"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="8dp"
android:src="@drawable/delete"
app:tint="@color/colorAccent" />
</LinearLayout>

Wyświetl plik

@ -75,4 +75,4 @@
android:contentDescription="@string/alt_more_options" android:contentDescription="@string/alt_more_options"
android:src="@drawable/more" /> android:src="@drawable/more" />
</LinearLayout> </LinearLayout>