summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2026-07-03 13:27:25 +0200
committercyberta <cyberta@riseup.net>2026-07-03 17:49:31 +0200
commit9fa2997ad21cc97b3c73dfb7712df907b68c2ee2 (patch)
tree388341837b520180b03887008ea29a5f5cac4626
parentfa002e6fa65fc7e938beef9e36283f7d5c03fdcd (diff)
impove fastfile and screenshot framing, ensure that framed screenshots can be viewed in screenshots.html overview page. We will enforce the useage of an GooglePixel 5 emulator as one of the most 'modern' phones available in fastlane frameit
-rw-r--r--fastlane/Fastfile58
-rw-r--r--fastlane/Screengrabfile10
2 files changed, 48 insertions, 20 deletions
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index 6e6ff88d..b4ff1787 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -55,16 +55,52 @@ platform :android do
)
end
+ desc "Create framed screenshots"
+ lane :create_framed_screenshots do |options|
+ flavor = options[:flavor] || "normal"
+ metadata_path = File.expand_path("../../src/#{flavor}ProductionFat/fastlane/metadata", __FILE__)
+ Dir.chdir(metadata_path) do
+ frameit(
+ white: true,
+ force_device_type: "Google Pixel 5",
+ path: "."
+ )
+ # rename screenshots, replacing unframed pendants
+ sh(
+ "find . -path '*/images/phoneScreenshots/*_framed.png' -print0 2>/dev/null | " \
+ "xargs -0 -I{} sh -c 'f=\"{}\"; " \
+ "nf=\"${f%_framed.png}.png\"; " \
+ "mv \"$f\" \"$nf\"'"
+ )
+ end
+ puts "Created framed screenshots"
+ end
+
+ desc "set device animations"
+ lane :set_animations do |options|
+ animated = options[:animated]
+ system("adb shell settings put global window_animation_scale #{animated}")
+ system("adb shell settings put global transition_animation_scale #{animated}")
+ system("adb shell settings put global animator_duration_scale #{animated}")
+ puts "set device animations to #{animated}"
+ end
+
lane :bitmask_screenshots do
# Prepare builds for Automatic UI Tests
build_bitmask_for_screengrab
- capture_android_screenshots
- Dir.chdir("../src/normalProductionFat/fastlane/metadata") do
- frameit(
- white: true,
- path: "."
- )
- end
+
+ # disable animations
+ set_animations(animated: 0)
+
+ verbose_screenshots = ENV["VERBOSE_SCREENSHOTS"] || "false"
+ capture_android_screenshots(
+ launch_arguments: ["verbose_screenshots #{verbose_screenshots}"]
+ )
+
+ # Re-enable animations
+ set_animations(animated: 1)
+
+ create_framed_screenshots(flavor: "normal")
# deliver
end
@@ -72,13 +108,7 @@ platform :android do
# Prepare builds for Automatic UI Tests
build_custom_for_screengrab
capture_android_screenshots
- Dir.chdir("../src/customProductionFat/fastlane/metadata") do
- frameit(
- white: true,
- path: "."
- )
- end
-
+ create_framed_screenshots(flavor: "custom")
# deliver
end
diff --git a/fastlane/Screengrabfile b/fastlane/Screengrabfile
index 634bddb5..353bacb6 100644
--- a/fastlane/Screengrabfile
+++ b/fastlane/Screengrabfile
@@ -5,15 +5,13 @@ use_timestamp_suffix(false)
# all locales
# locales(['ar', 'az', 'bg', 'bn', 'br', 'ca', 'cs', 'de', 'el', 'es', 'es-AR', 'et', 'eu', 'fa-IR', 'fi', 'fr', 'gl', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'my', 'nl', 'no', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'tr', 'ug', 'uk', 'vi', 'zh-CN', 'zh-TW'])
-# prioritized locales
-# locales(['ar', 'bn', 'de', 'es', 'fa-IR', 'fr', 'he', 'hu', 'id', 'it', 'ja', 'my', 'nl', 'pt-BR', 'pt-PT', 'ru', 'tr', 'ug', 'uk', 'zh-CN', 'zh-TW'])
+
# development locales
+# locales(['de', 'en'])
+# locales currently available in the language picker
# check how much is translated. When 'connect' isn't translated, don't bother!
-
-#locales(['ar', 'az', 'bg', 'bn', 'br', 'ca', 'cs', 'de', 'el', 'es', 'es-AR', 'et', 'eu', 'fa-IR', 'fi', 'fr', 'gl', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'my', 'nl', 'no', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'tr', 'ug', 'uk', 'vi', 'zh-CN', 'zh-TW'])
-
-locales(['ar', 'de', 'el', 'es_AR', 'es-CU', 'fa-IR', 'fi', 'fr', 'he', 'hu', 'ja', 'lt', 'nl', 'pt-BR', 'ru', 'tr', 'uk', 'zh-CN', 'zh-TW'])
+locales(['ar', 'cs', 'en', 'de', 'el', 'es', 'es-AR', 'es-CU', 'fa-IR', 'fi', 'fr', 'he', 'hu', 'ja', 'lt', 'nl', 'pt-BR', 'ru', 'tr', 'uk', 'vi', 'zh', 'zh-TW'])
# clear all previously generated screenshots in your local output directory before creating new ones
clear_previous_screenshots(true)