Skip to content

Commit

Permalink
added cef download info
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Nov 11, 2023
1 parent cd5cd69 commit 73e5ca0
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,26 @@ compose {
jvmArgs("--add-opens", "java.desktop/sun.awt.X11=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.awt.wl=ALL-UNNAMED")
}
Host.MAC -> {
jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
}
else -> { }
}
jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")

nativeDistributions {
packageName = "Burning-Series"
packageVersion = appVersion
outputBaseDir.set(rootProject.buildDir.resolve("release"))
outputBaseDir.set(rootProject.layout.buildDirectory.asFile.get().resolve("release"))
description = "Watch any series from Burning-Series using this (unofficial) app."
copyright = "© 2020 Jeff Retz (DatLag). All rights reserved."
licenseFile.set(rootProject.file("LICENSE"))

outputBaseDir.set(rootProject.layout.buildDirectory.asFile.get().resolve("release"))
appResourcesRootDir.set(project.layout.projectDirectory.dir("resources"))

when (getHost()) {
Host.Linux -> targetFormats(
TargetFormat.AppImage, TargetFormat.Deb, TargetFormat.Rpm
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.datlag.burningseries.ui.screen.initial.home.component

import androidx.compose.foundation.lazy.grid.LazyGridScope

actual fun LazyGridScope.DeviceContent() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import dev.datlag.burningseries.ui.custom.VerticalScrollbar
import dev.datlag.burningseries.ui.custom.rememberScrollbarAdapter
import dev.datlag.burningseries.ui.custom.state.ErrorState
import dev.datlag.burningseries.ui.custom.state.LoadingState
import dev.datlag.burningseries.ui.screen.initial.home.component.DeviceContent
import dev.datlag.burningseries.ui.screen.initial.home.component.EpisodeItem
import dev.datlag.burningseries.ui.screen.initial.home.component.SeriesItem
import dev.icerock.moko.resources.compose.painterResource
Expand Down Expand Up @@ -107,6 +108,7 @@ private fun MainView(home: Home, component: HomeComponent, modifier: Modifier =
horizontalArrangement = Arrangement.spacedBy(8.dp),
state = state
) {
DeviceContent()
header {
Text(
modifier = Modifier.padding(top = 16.dp),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.datlag.burningseries.ui.screen.initial.home.component

import androidx.compose.foundation.lazy.grid.LazyGridScope

expect fun LazyGridScope.DeviceContent()
5 changes: 5 additions & 0 deletions app/shared/src/commonMain/resources/MR/base/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
<string name="error_loading_series">Error while loading series information</string>
<string name="season_placeholder">Season %s</string>
<string name="back">Back</string>
<string name="restart_required_title">Restart required</string>
<string name="restart_required_text">The application needs to be restarted to function properly.</string>
<string name="restart">Restart</string>
<string name="downloading">Downloading</string>
<string name="downloading_text">Downloading required packages for your platform, please wait</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package dev.datlag.burningseries.ui.screen.initial.home.component

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.RestartAlt
import androidx.compose.material3.*
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import dev.datlag.burningseries.common.LocalRestartRequired
import dev.datlag.burningseries.common.header
import dev.datlag.burningseries.other.CEFState
import dev.datlag.burningseries.other.LocalCEFInitialization
import dev.datlag.burningseries.shared.SharedRes
import dev.datlag.burningseries.window.ApplicationDisposer
import dev.icerock.moko.resources.compose.stringResource

actual fun LazyGridScope.DeviceContent() {
header {
val cefInitState by LocalCEFInitialization.current
val restartRequired = LocalRestartRequired.current

if (restartRequired) {
val disposer = ApplicationDisposer.current

Row(
modifier = Modifier.padding(top = 16.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
Text(
text = stringResource(SharedRes.strings.restart_required_title),
style = MaterialTheme.typography.headlineMedium
)
Text(
text = stringResource(SharedRes.strings.restart_required_text)
)
}
Spacer(modifier = Modifier.weight(1F))
Button(
onClick = {
disposer.restart()
}
) {
Icon(
modifier = Modifier.size(ButtonDefaults.IconSize),
imageVector = Icons.Default.RestartAlt,
contentDescription = stringResource(SharedRes.strings.restart)
)
Spacer(modifier = Modifier.size(ButtonDefaults.IconSpacing))
Text(text = stringResource(SharedRes.strings.restart))
}
}
} else {
when (val current = cefInitState) {
is CEFState.Downloading -> {
Column(
modifier = Modifier.padding(top = 16.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
Text(
text = stringResource(SharedRes.strings.downloading),
style = MaterialTheme.typography.headlineMedium
)

Text(
text = stringResource(SharedRes.strings.downloading_text)
)

LinearProgressIndicator(
modifier = Modifier.fillMaxWidth().clip(CircleShape),
progress = current.progress / 100F
)
}
}
else -> { }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.datlag.burningseries.ui.screen.initial.home.component

import androidx.compose.foundation.lazy.grid.LazyGridScope

actual fun LazyGridScope.DeviceContent() {
}

0 comments on commit 73e5ca0

Please sign in to comment.