Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.7.0] - 2025-11-24
### Added
- Option to always enter "Now Playing" when tapping notification ([#179])

## [1.6.0] - 2025-11-09
### Changed
- Player now respects play/pause state when seeking ([#97])
Expand Down Expand Up @@ -90,6 +94,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#47]: https://github.com/FossifyOrg/Music-Player/issues/47
[#65]: https://github.com/FossifyOrg/Music-Player/issues/65
[#97]: https://github.com/FossifyOrg/Music-Player/issues/97
[#179]: https://github.com/FossifyOrg/Music-Player/issues/179
[#206]: https://github.com/FossifyOrg/Music-Player/issues/206
[#209]: https://github.com/FossifyOrg/Music-Player/issues/209
[#228]: https://github.com/FossifyOrg/Music-Player/issues/228
Expand All @@ -98,7 +103,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#269]: https://github.com/FossifyOrg/Music-Player/issues/269
[#298]: https://github.com/FossifyOrg/Music-Player/issues/298

[Unreleased]: https://github.com/FossifyOrg/Music-Player/compare/1.6.0...HEAD
[Unreleased]: https://github.com/FossifyOrg/Music-Player/compare/1.7.0...HEAD
[1.7.0]: https://github.com/FossifyOrg/Music-Player/compare/1.6.0...1.7.0
[1.6.0]: https://github.com/FossifyOrg/Music-Player/compare/1.5.1...1.6.0
[1.5.1]: https://github.com/FossifyOrg/Music-Player/compare/1.5.0...1.5.1
[1.5.0]: https://github.com/FossifyOrg/Music-Player/compare/1.4.0...1.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.os.Bundle
import android.widget.Toast
import androidx.viewpager.widget.ViewPager
import me.grantland.widget.AutofitHelper
import me.grantland.widget.BuildConfig
import org.fossify.commons.databinding.BottomTablayoutItemBinding
import org.fossify.commons.dialogs.FilePickerDialog
import org.fossify.commons.dialogs.RadioGroupDialog
Expand All @@ -18,7 +19,6 @@ import org.fossify.commons.helpers.*
import org.fossify.commons.models.FAQItem
import org.fossify.commons.models.RadioItem
import org.fossify.commons.models.Release
import org.fossify.musicplayer.BuildConfig
import org.fossify.musicplayer.R
import org.fossify.musicplayer.adapters.ViewPagerAdapter
import org.fossify.musicplayer.databinding.ActivityMainBinding
Expand Down Expand Up @@ -80,12 +80,14 @@ class MainActivity : SimpleMusicActivity() {

override fun onResume() {
super.onResume()
handleNotificationIntent(intent)
if (storedShowTabs != config.showTabs) {
config.lastUsedViewPagerPage = 0
System.exit(0)
return
}


updateMenuColors()
updateTextColors(binding.mainHolder)
setupTabColors()
Expand All @@ -105,6 +107,13 @@ class MainActivity : SimpleMusicActivity() {
}
}

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
handleNotificationIntent(intent)
}


override fun onPause() {
super.onPause()
storeStateVariables()
Expand Down Expand Up @@ -549,4 +558,15 @@ class MainActivity : SimpleMusicActivity() {
checkWhatsNew(this, BuildConfig.VERSION_CODE)
}
}

private fun handleNotificationIntent(intent: Intent) {
val shouldOpenPlayer = intent.getBooleanExtra("OPEN_PLAYER", false)

if (shouldOpenPlayer) {
intent.removeExtra("OPEN_PLAYER")
Intent(this, TrackActivity::class.java).apply {
startActivity(this)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,17 @@ private fun PlaybackService.initializePlayer(
}

private fun Context.getSessionActivityIntent(): PendingIntent {
//add openplayer
val intent = Intent(this, MainActivity::class.java).apply {
putExtra("OPEN_PLAYER", true)
// Questi flag aiutano a gestire il comportamento se l'app è già aperta
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
}

return PendingIntent.getActivity(
this,
0,
Intent(this, MainActivity::class.java),
intent,
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
}
Expand Down
Loading