updating commons

This commit is contained in:
tibbi 2023-07-17 14:45:15 +02:00
parent 21550b0553
commit dce4b33b63
5 changed files with 17 additions and 11 deletions

View file

@ -70,7 +70,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:4c83ec8740'
implementation 'com.github.SimpleMobileTools:Simple-Commons:42733f39a4'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View file

@ -86,7 +86,7 @@ class AlbumsActivity : SimpleActivity() {
}
}
} else {
PermissionRequiredDialog(this, R.string.allow_notifications_music_player)
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
}
}
}
@ -108,7 +108,7 @@ class AlbumsActivity : SimpleActivity() {
startActivity(this)
}
} else {
PermissionRequiredDialog(this, R.string.allow_notifications_music_player)
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
}
}
}

View file

@ -200,7 +200,7 @@ class MainActivity : SimpleActivity() {
startActivity(this)
}
} else {
PermissionRequiredDialog(this, R.string.allow_notifications_music_player)
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
}
}
}

View file

@ -3,7 +3,6 @@ package com.simplemobiletools.musicplayer.activities
import android.app.Activity
import android.app.SearchManager
import android.content.ActivityNotFoundException
import android.content.ContentUris
import android.content.Context
import android.content.Intent
import android.os.Bundle
@ -32,7 +31,7 @@ import com.simplemobiletools.musicplayer.helpers.M3uExporter.ExportResult
import com.simplemobiletools.musicplayer.models.*
import com.simplemobiletools.musicplayer.services.MusicService
import kotlinx.android.synthetic.main.activity_tracks.*
import kotlinx.android.synthetic.main.view_current_track_bar.*
import kotlinx.android.synthetic.main.view_current_track_bar.current_track_bar
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@ -86,7 +85,7 @@ class TracksActivity : SimpleActivity() {
startActivity(this)
}
} else {
PermissionRequiredDialog(this, R.string.allow_notifications_music_player)
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
}
}
}
@ -218,6 +217,7 @@ class TracksActivity : SimpleActivity() {
tracks.addAll(playlistTracks)
listItems.addAll(tracks)
}
TYPE_ALBUM -> {
val albumTracks = tracksDAO.getTracksFromAlbum(album.id).distinctBy { "${it.path}/${it.mediaStoreId}" } as ArrayList<Track>
albumTracks.sortWith(compareBy({ it.trackId }, { it.title.lowercase() }))
@ -227,6 +227,7 @@ class TracksActivity : SimpleActivity() {
listItems.add(header)
listItems.addAll(tracks)
}
else -> {
val folderTracks = tracksDAO.getTracksFromFolder(folder ?: "")
.distinctBy { "${it.path}/${it.mediaStoreId}" }
@ -403,7 +404,7 @@ class TracksActivity : SimpleActivity() {
}
} else {
PermissionRequiredDialog(this, R.string.allow_notifications_music_player)
PermissionRequiredDialog(this, R.string.allow_notifications_music_player, { openNotificationSettings() })
}
}
}

View file

@ -15,12 +15,17 @@ import com.simplemobiletools.musicplayer.activities.SimpleActivity
import com.simplemobiletools.musicplayer.activities.TrackActivity
import com.simplemobiletools.musicplayer.adapters.TracksAdapter
import com.simplemobiletools.musicplayer.dialogs.ChangeSortingDialog
import com.simplemobiletools.musicplayer.extensions.*
import com.simplemobiletools.musicplayer.extensions.config
import com.simplemobiletools.musicplayer.extensions.mediaScanner
import com.simplemobiletools.musicplayer.extensions.resetQueueItems
import com.simplemobiletools.musicplayer.extensions.tracksDAO
import com.simplemobiletools.musicplayer.helpers.RESTART_PLAYER
import com.simplemobiletools.musicplayer.helpers.TAB_TRACKS
import com.simplemobiletools.musicplayer.helpers.TRACK
import com.simplemobiletools.musicplayer.models.Track
import kotlinx.android.synthetic.main.fragment_tracks.view.*
import kotlinx.android.synthetic.main.fragment_tracks.view.tracks_fastscroller
import kotlinx.android.synthetic.main.fragment_tracks.view.tracks_list
import kotlinx.android.synthetic.main.fragment_tracks.view.tracks_placeholder
// Artists -> Albums -> Tracks
class TracksFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
@ -62,7 +67,7 @@ class TracksFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
}
} else {
if (context is Activity) {
PermissionRequiredDialog(activity, R.string.allow_notifications_music_player)
PermissionRequiredDialog(activity, R.string.allow_notifications_music_player, { activity.openNotificationSettings() })
}
}
}