Skip to content

Commit

Permalink
fixed play button paused after activity resumed
Browse files Browse the repository at this point in the history
  • Loading branch information
icefields committed Apr 19, 2024
1 parent 16811cd commit 1d0f75d
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 21 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,26 @@ F-Droid releases can not upgrade to other releases and it is compiled, signed an
You can select a demo instance from the login screen or login into your own server.

## Translations coming soon

## Contributing

- Fork the repository.
- Make your changes in a separate branch.
- Open a pull request.

## Contributors

<a href="https://github.com/asheeeshh/lyrist/graphs/contributors">
<img src="https://stg.contrib.rocks/image?repo=asheeeshh/lyrist" />
</a>

## Ending Note
- Consider giving the repo a ⭐ if you liked the project!
- Checkout my other projects!
- Consider sponsoring me to help me build more projects like this.

<p align="center">
<a rel="noopener noreferrer" target="_blank" href="https://vercel.com/?utm_source=asheeeshh&utm_campaign=oss">
<img height="34px" src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg" alt="Powered by vercel">
</a>
</p>
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 21 additions & 4 deletions app/FDroid/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@
"type": "APK",
"kind": "Directory"
},
"applicationId": "luci.sixsixsix.powerampache2",
"applicationId": "luci.sixsixsix.powerampache2.fdroid",
"variantName": "FDroidRelease",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 42,
"versionName": "0.42-rc1",
"versionCode": 49,
"versionName": "0.49-rc1-fdroid",
"outputFile": "app-FDroid-release.apk"
}
],
"elementType": "File"
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-FDroid-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-FDroid-release.dm"
]
}
],
"minSdkVersionForDexing": 28
}
Binary file not shown.
Binary file modified app/Github/release/baselineProfiles/0/app-Github-release.dm
Binary file not shown.
Binary file modified app/Github/release/baselineProfiles/1/app-Github-release.dm
Binary file not shown.
4 changes: 2 additions & 2 deletions app/Github/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 48,
"versionName": "0.48-rc1",
"versionCode": 49,
"versionName": "0.49-rc1",
"outputFile": "app-Github-release.apk"
}
],
Expand Down
21 changes: 10 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ val retrofit2Version = "2.9.0"
val coroutinesVersion = "1.7.3"
val exoplayerVersion = "2.19.1"
val composeNavVersion = "1.8.42-beta"
val media3Version = "1.3.0"
val media3Version = "1.3.1"
val hiltVersion = "1.2.0"

val localProperties = Properties()
Expand All @@ -40,15 +40,15 @@ android {
val errorReportEmail = properties.getProperty("ERROR_REPORT_EMAIL")
val pastebinApiKey = properties.getProperty("PASTEBIN_API_KEY")

val providerStr = mutableListOf("luci.sixsixsix.powerampache2.provider")
var providerStr = "luci.sixsixsix.powerampache2.provider"

defaultConfig {
applicationId = "luci.sixsixsix.powerampache2"
minSdk = 28
targetSdk = 34
versionCode = 49
versionName = "0.49-rc1"
val versionQuote = "This version is powered by REVOLUTION! Revolution everywhere! -- DB Experiments"
versionCode = 50
versionName = "0.50-rc1"
val versionQuote = "This version is powered by happy endings and ugly restarts - play fix"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -68,7 +68,7 @@ android {
debug {
applicationIdSuffix = ".debug"
versionNameSuffix = ".debug"
providerStr.add("debug")
providerStr = "$providerStr.debug"

// FLAGS
buildConfigField("boolean", "MRLOG_ON", "true")
Expand All @@ -92,9 +92,8 @@ android {
buildConfigField("String", "LOCAL_DEV_PASSWORD", localDevPass)

resValue("string", "build_type", "Debug")
resValue("color", "launcherBgColour", "#d7afff")
resValue("color", "launcherBgColour", "#006660")

// <color name="launcherBgColour"></color>
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
Expand Down Expand Up @@ -149,7 +148,7 @@ android {
buildConfigField("String", "URL_ERROR_LOG", "\"https://pastebin.com/api/\"")
buildConfigField("String", "PASTEBIN_API_KEY", pastebinApiKey)

resValue("string", "sharing_provider_authority", "${providerStr.joinToString(".")}.$flavourGithub")
resValue("string", "sharing_provider_authority", providerStr)
}
create(flavourFDroid) {
dimension = "ampache"
Expand All @@ -159,7 +158,7 @@ android {
buildConfigField("boolean", "SHOW_LOGIN_SERVER_VERSION_WARNING", "true")
buildConfigField("String", "URL_ERROR_LOG", "\"https://pastebin.com/api/\"")
buildConfigField("String", "PASTEBIN_API_KEY", pastebinApiKey)
resValue("string", "sharing_provider_authority", "${providerStr.joinToString(".")}.$flavourFDroid")
resValue("string", "sharing_provider_authority", "${providerStr}.$flavourFDroid")
}
create(flavourPlayStore) {
dimension = "ampache"
Expand All @@ -169,7 +168,7 @@ android {
buildConfigField("boolean", "SHOW_LOGIN_SERVER_VERSION_WARNING", "true")
buildConfigField("String", "URL_ERROR_LOG", errorLogUrl)
buildConfigField("String", "PASTEBIN_API_KEY", pastebinApiKey)
resValue("string", "sharing_provider_authority", "${providerStr.joinToString(".")}.$flavourPlayStore")
resValue("string", "sharing_provider_authority", "${providerStr}.$flavourPlayStore")

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ interface AmpacheModel {
return resultList
}

fun listsEqual(list1: List<AmpacheModel>, list2: List<AmpacheModel>): Boolean {
fun listsEqual(list1: List<AmpacheModel>,
list2: List<AmpacheModel>,
notEqualOnEmpty: Boolean = false
): Boolean {
if (notEqualOnEmpty && list1.isEmpty() && list2.isEmpty()) return false
if (list1.size != list2.size) return false
list1.forEachIndexed { index, ampacheModel ->
if(ampacheModel.id != list2[index].id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ fun PlayButton(
contentAlignment = Alignment.Center
) {
if (!showLoadingWhileBuffering || !isBuffering) {
// if showLoadingWhileBuffering is false always go in this block
Icon(
tint = iconTint,
modifier = Modifier
.aspectRatio(1f / 1f)
.padding(13.dp),
imageVector = if ((!isPlaying && !isBuffering)
imageVector = if ((!isPlaying/* && !isBuffering*/)
// if not enable always show play icon
|| !enabled) {
Icons.Filled.PlayArrow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class HomeScreenViewModel @Inject constructor(
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(), false)

val playlistsStateFlow = playlistsRepository.playlistsFlow.distinctUntilChanged()
.filter { !AmpacheModel.listsEqual(it, currentPlaylists) }
.filter {
!AmpacheModel.listsEqual(it, currentPlaylists, true)
}
.map { playlists ->
currentPlaylists.clear()
currentPlaylists.addAll(playlists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fun AboutScreenContent(
subtitleTextSize = fontDimensionResource(id = R.dimen.about_item_fontSize)
)
21 -> TextWithOverline(
title = R.string.about_flavour,
title = R.string.sharing_provider_authority,
subtitle = BuildConfig.FLAVOR,
subtitleTextSize = fontDimensionResource(id = R.dimen.about_item_fontSize)
)
Expand Down

0 comments on commit 1d0f75d

Please sign in to comment.