From 2e6623bb9dcfc7aea2098e4278e069d7d42006e5 Mon Sep 17 00:00:00 2001 From: Denis Solonenko Date: Sun, 31 Dec 2023 09:03:00 +1100 Subject: [PATCH] Minor UI fixes --- README.md | 7 ++----- lib/pages/games.dart | 4 ++-- lib/widgets/fade_image_to_video.dart | 16 ++++++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e307371..cfa73f4 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ While Titanius Launcher does have built-in scraper, it was designed with the int ## Scraper Titanius Launcher has a built-in scraper that uses [Screenscraper](https://www.screenscraper.fr) APIs for scraping ROMs metadata and media. -To use it, navigate to Settings -> Scraper and select the systems you want to scrape. +To use it, navigate to Settings -> Scraper, enter your account username & password, then select the systems you want to scrape. You can also scrape individual games by going into game settings and selecting "Scrape Game". Mind that scraper requires to calculate checksums for each ROM file, which can take a while for large files. -While it works just fine for most systems, it can take minutes per rom for CD-based systems like PS2 and GameCube, so it's recommended to scrape them on a PC and transfer the metadata to your Android device. +While it works fine for most systems, it can take minutes per rom for CD-based systems like PS2 and GameCube, so it's recommended to scrape them on a PC and transfer the metadata to your Android device. The scraper is still work in progress, some things dont work yet like folders support. @@ -71,9 +71,6 @@ Games page: Game details: ![Screenshot](assets/screenshots/03.png) -Folders support: -![Screenshot](assets/screenshots/04.png) - Collections: ![Screenshot](assets/screenshots/07.png) diff --git a/lib/pages/games.dart b/lib/pages/games.dart index 58ed780..cf058f1 100644 --- a/lib/pages/games.dart +++ b/lib/pages/games.dart @@ -120,7 +120,7 @@ class GamesPage extends HookConsumerWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( - flex: 3, + flex: 5, child: Column( children: [ Container( @@ -193,7 +193,7 @@ class GamesPage extends HookConsumerWidget { ), ), Expanded( - flex: 5, + flex: 8, child: Container( //color: Colors.black.brighten(10), padding: const EdgeInsets.all(8.0), diff --git a/lib/widgets/fade_image_to_video.dart b/lib/widgets/fade_image_to_video.dart index 79eebce..994653b 100644 --- a/lib/widgets/fade_image_to_video.dart +++ b/lib/widgets/fade_image_to_video.dart @@ -19,6 +19,7 @@ class FadeImageToVideo extends StatefulWidget { class FadeImageToVideoState extends State { late VideoPlayerController _controller; bool _playVideo = false; + bool _inFocus = true; @override void initState() { @@ -32,7 +33,7 @@ class FadeImageToVideoState extends State { if (widget.settings.fadeToVideo) { _controller.initialize(); Future.delayed(const Duration(seconds: 2), () async { - if (mounted && _controller.value.isInitialized) { + if (_inFocus && mounted && _controller.value.isInitialized) { setState(() { _playVideo = true; }); @@ -44,10 +45,12 @@ class FadeImageToVideoState extends State { _controller.initialize().then((value) { if (mounted) { // force aspect ratio - setState(() { - _playVideo = true; - }); - _controller.play(); + if (_inFocus) { + setState(() { + _playVideo = true; + }); + _controller.play(); + } } }); } @@ -67,6 +70,7 @@ class FadeImageToVideoState extends State { if (mounted) { _controller.dispose(); setState(() { + _inFocus = false; _playVideo = false; }); } @@ -76,7 +80,7 @@ class FadeImageToVideoState extends State { } Widget _buildVideoPlayer() { - if (_playVideo) { + if (_playVideo && _inFocus) { return AspectRatio( aspectRatio: _controller.value.aspectRatio, child: VideoPlayer(_controller),