-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: screenshot by vlc video player in desktop (#620)
* feat: add button for screenshot. * feat: add screenshot methods for PlayerState * style: adjust rhs bar in VideoScaffold * feat: vlc player screenshot * optimize: save screenshot file logic * optimize: 抽取截图逻辑到vm层 * feat: add exo player screenshot methods. * style: 调整截屏按钮只在Desktop显示 * optimize: 去掉截图文件名的当前时间戳 * optimize: 文件名的当前时间转换成时分秒毫秒字符串 * fix: build issue in VideoScaffold.android.kt * optimize: adjust code * optimize: adjust code * optimize: adjust code * optimize: adjust code * optimize: adjust code
- Loading branch information
ChiveHao
authored
Jul 27, 2024
1 parent
acea6c6
commit 65d0738
Showing
9 changed files
with
120 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/shared/video-player/common/ui/guesture/PlayerFloatingButtonBox.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package me.him188.ani.app.videoplayer.ui.guesture | ||
|
||
import androidx.compose.foundation.BorderStroke | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import me.him188.ani.app.ui.foundation.theme.aniDarkColorTheme | ||
import me.him188.ani.app.ui.foundation.theme.aniLightColorTheme | ||
import me.him188.ani.app.ui.foundation.theme.slightlyWeaken | ||
|
||
@Composable | ||
fun PlayerFloatingButtonBox( | ||
modifier: Modifier = Modifier, | ||
content: @Composable () -> Unit, | ||
) { | ||
Surface( | ||
modifier, | ||
shape = RoundedCornerShape(16.dp), | ||
color = aniDarkColorTheme().background.copy(0.05f), | ||
contentColor = Color.White, | ||
border = BorderStroke(0.5.dp, aniLightColorTheme().outline.slightlyWeaken()), | ||
) { | ||
content() | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
app/shared/video-player/common/ui/guesture/ScreenshotButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package me.him188.ani.app.videoplayer.ui.guesture | ||
|
||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.rounded.PhotoCamera | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.LocalContentColor | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
|
||
@Composable | ||
fun ScreenshotButton( | ||
onClick: () -> Unit, | ||
modifier: Modifier = Modifier | ||
) { | ||
PlayerFloatingButtonBox( | ||
modifier = modifier, | ||
content = { | ||
IconButton(onClick) { | ||
val color = Color.White | ||
CompositionLocalProvider(LocalContentColor provides color) { | ||
Icon(Icons.Rounded.PhotoCamera, contentDescription = "Lock screen") | ||
} | ||
} | ||
}, | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters