mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 01:17:05 +05:30
feat(scripts): add a quick way to refresh the README graphic
This commit is contained in:
parent
0a1913e056
commit
9fdd72220f
5 changed files with 25 additions and 7 deletions
BIN
.github/readme_feature.webp
vendored
BIN
.github/readme_feature.webp
vendored
Binary file not shown.
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 154 KiB |
|
@ -12,7 +12,7 @@ Unofficial Android app for read-only access to [lobste.rs](https://lobste.rs), b
|
||||||
|
|
||||||
<img src="https://github.com/msfjarvis/compose-lobsters/blob/main/.github/readme_feature.webp"
|
<img src="https://github.com/msfjarvis/compose-lobsters/blob/main/.github/readme_feature.webp"
|
||||||
alt="Side by side screenshots of the app's main page in dark and light UI modes"
|
alt="Side by side screenshots of the app's main page in dark and light UI modes"
|
||||||
height="550" />
|
height="540" />
|
||||||
|
|
||||||
## Dependency Diagram
|
## Dependency Diagram
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.semantics.Role
|
import androidx.compose.ui.semantics.Role
|
||||||
import androidx.compose.ui.text.AnnotatedString
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
@ -173,7 +174,7 @@ private fun SaveButton(
|
||||||
imageVector = if (saved) Icons.Filled.Favorite else Icons.Outlined.FavoriteBorder,
|
imageVector = if (saved) Icons.Filled.Favorite else Icons.Outlined.FavoriteBorder,
|
||||||
tint = MaterialTheme.colorScheme.secondary,
|
tint = MaterialTheme.colorScheme.secondary,
|
||||||
contentDescription = if (saved) "Remove from saved posts" else "Add to saved posts",
|
contentDescription = if (saved) "Remove from saved posts" else "Add to saved posts",
|
||||||
modifier = Modifier.align(Alignment.Center),
|
modifier = Modifier.align(Alignment.Center).testTag("save_button"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,15 @@ appId: dev.msfjarvis.claw.android
|
||||||
---
|
---
|
||||||
- launchApp
|
- launchApp
|
||||||
- tapOn:
|
- tapOn:
|
||||||
text: "Add to saved posts"
|
id: "save_button"
|
||||||
index: 0
|
index: 0
|
||||||
- tapOn:
|
- tapOn:
|
||||||
text: "Add to saved posts"
|
id: "save_button"
|
||||||
index: 1
|
index: 1
|
||||||
- takeScreenshot: "HottestPosts"
|
- takeScreenshot: "HottestPosts"
|
||||||
- tapOn: "Saved"
|
- tapOn: "Saved"
|
||||||
- takeScreenshot: "SavedPosts"
|
- takeScreenshot: "SavedPosts"
|
||||||
- tapOn: "Hottest"
|
- tapOn: "Hottest"
|
||||||
- tapOn:
|
- tapOn: "Open comments"
|
||||||
text: "Open comments"
|
|
||||||
index: 0
|
|
||||||
- waitForAnimationToEnd
|
- waitForAnimationToEnd
|
||||||
- takeScreenshot: "CommentsPage"
|
- takeScreenshot: "CommentsPage"
|
||||||
|
|
19
scripts/refresh-feature-graphic.sh
Executable file
19
scripts/refresh-feature-graphic.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Get the absolute path to the script file
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||||
|
SCREENSHOT_DIR="${SCRIPT_DIR}"/../screenshots
|
||||||
|
|
||||||
|
# Run the Maestro flow to generate the screenshots
|
||||||
|
source "${SCRIPT_DIR}"/run-maestro-flows.sh
|
||||||
|
|
||||||
|
# Use imagemagick to stitch the screenshots horizontally
|
||||||
|
nix-shell -p imagemagick --run "convert +append ${SCREENSHOT_DIR}/HottestPosts.png ${SCREENSHOT_DIR}/CommentsPage.png ${SCREENSHOT_DIR}/SavedPosts.png ${SCRIPT_DIR}/../.github/readme_feature.png"
|
||||||
|
|
||||||
|
# Convert the resulting PNG to WebP
|
||||||
|
nix-shell -p libwebp --run "cwebp .github/readme_feature.png -o .github/readme_feature.webp"
|
||||||
|
|
||||||
|
# Remove the now-useless PNG
|
||||||
|
rm ".github/readme_feature.png"
|
Loading…
Add table
Add a link
Reference in a new issue