Skip to content

Commit

Permalink
fix: insert gap for android 3 button navigation, dont overwrite chart…
Browse files Browse the repository at this point in the history
…s peak with search, reduce desktop padding (#1120)

* fix: insert gap for android 3 button navigation, dont overwrite charts peak with search, reduce desktop padding

* 3.27.2
  • Loading branch information
Feichtmeier authored Jan 19, 2025
1 parent 1ee795d commit 5d68b82
Show file tree
Hide file tree
Showing 26 changed files with 769 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

env:
FLUTTER_VERSION: '3.27.1'
FLUTTER_VERSION: '3.27.2'

jobs:
analyze:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: '3.27.1'
FLUTTER_VERSION: '3.27.2'

jobs:
release_with_macos_dmg:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
FLUTTER_VERSION: '3.27.1'
FLUTTER_VERSION: '3.27.2'

jobs:
build_and_release_linux_snap_edge_amd64:
Expand Down
Binary file added design/adroid_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/adroid_banner.xcf
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/app/view/mobile_musicpod_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _MobileMusicPodAppState extends State<MobileMusicPodApp> {
navigatorKey: libraryModel.masterNavigatorKey,
navigatorObservers: [libraryModel],
initialRoute: isMobilePlatform
? (libraryModel.selectedPageId ?? kLocalAudioPageId)
? (libraryModel.selectedPageId ?? kHomePageId)
: null,
onGenerateRoute: (settings) {
final page = (masterItems.firstWhereOrNull(
Expand Down
83 changes: 45 additions & 38 deletions lib/app/view/mobile_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../common/view/icons.dart';
import '../../common/view/theme.dart';
import '../../common/view/ui_constants.dart';
import '../../constants.dart';
import '../../extensions/build_context_x.dart';
import '../../l10n/l10n.dart';
import '../../library/library_model.dart';
import 'package:flutter/material.dart';
Expand All @@ -17,44 +18,50 @@ class MobileNavigationBar extends StatelessWidget with WatchItMixin {
final selectedPageId =
watchPropertyValue((LibraryModel m) => m.selectedPageId);

return SizedBox(
height: navigationBarHeight,
child: Padding(
padding:
const EdgeInsets.only(bottom: kLargestSpace, top: kSmallestSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
isSelected: selectedPageId == kHomePageId,
selectedIcon: Icon(Iconz.homeFilled),
icon: Icon(Iconz.home),
tooltip: l10n.home,
onPressed: () => di<LibraryModel>().push(pageId: kHomePageId),
),
IconButton(
isSelected: selectedPageId == kLocalAudioPageId,
selectedIcon: Icon(Iconz.localAudioFilled),
icon: Icon(Iconz.localAudio),
tooltip: l10n.local,
onPressed: () =>
di<LibraryModel>().push(pageId: kLocalAudioPageId),
),
IconButton(
isSelected: selectedPageId == kRadioPageId,
selectedIcon: Icon(Iconz.radioFilled),
icon: Icon(Iconz.radio),
tooltip: l10n.radio,
onPressed: () => di<LibraryModel>().push(pageId: kRadioPageId),
),
IconButton(
isSelected: selectedPageId == kPodcastsPageId,
selectedIcon: Icon(Iconz.podcastFilled),
icon: Icon(Iconz.podcast),
tooltip: l10n.podcasts,
onPressed: () => di<LibraryModel>().push(pageId: kPodcastsPageId),
),
],
return Padding(
padding: context.isAndroidGestureNavigationEnabled
? EdgeInsets.zero
: const EdgeInsets.only(bottom: 35),
child: SizedBox(
height: navigationBarHeight,
child: Padding(
padding:
const EdgeInsets.only(bottom: kLargestSpace, top: kSmallestSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
isSelected: selectedPageId == kHomePageId,
selectedIcon: Icon(Iconz.homeFilled),
icon: Icon(Iconz.home),
tooltip: l10n.home,
onPressed: () => di<LibraryModel>().push(pageId: kHomePageId),
),
IconButton(
isSelected: selectedPageId == kLocalAudioPageId,
selectedIcon: Icon(Iconz.localAudioFilled),
icon: Icon(Iconz.localAudio),
tooltip: l10n.local,
onPressed: () =>
di<LibraryModel>().push(pageId: kLocalAudioPageId),
),
IconButton(
isSelected: selectedPageId == kRadioPageId,
selectedIcon: Icon(Iconz.radioFilled),
icon: Icon(Iconz.radio),
tooltip: l10n.radio,
onPressed: () => di<LibraryModel>().push(pageId: kRadioPageId),
),
IconButton(
isSelected: selectedPageId == kPodcastsPageId,
selectedIcon: Icon(Iconz.podcastFilled),
icon: Icon(Iconz.podcast),
tooltip: l10n.podcasts,
onPressed: () =>
di<LibraryModel>().push(pageId: kPodcastsPageId),
),
],
),
),
),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/common/view/adaptive_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ EdgeInsets getAdaptiveHorizontalPadding({
double min = 15,
}) {
return EdgeInsets.symmetric(
horizontal: max((constraints.maxWidth - 650) / 2, 0) > min
? max((constraints.maxWidth - 650) / 2, 0)
horizontal: max((constraints.maxWidth - 850) / 2, 0) > min
? max((constraints.maxWidth - 850) / 2, 0)
: min,
);
}
6 changes: 0 additions & 6 deletions lib/common/view/header_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ class HeaderBar extends StatelessWidget
}

if (isMobilePlatform) {
final fullWindowMode =
watchPropertyValue((AppModel m) => m.fullWindowMode) == true;
return AppBar(
systemOverlayStyle: systemOverlayStyle(
theme: context.theme,
fullWindowMode: fullWindowMode,
),
backgroundColor: backgroundColor,
titleSpacing: titleSpacing,
centerTitle: true,
Expand Down
18 changes: 15 additions & 3 deletions lib/common/view/search_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ import 'icons.dart';
import 'theme.dart';

class SearchButton extends StatelessWidget {
const SearchButton({super.key, this.onPressed, this.active, this.icon});
const SearchButton({
super.key,
this.onPressed,
this.active,
this.icon,
this.iconColor,
});

final void Function()? onPressed;
final bool? active;
final Widget? icon;
final Color? iconColor;

@override
Widget build(BuildContext context) {
Expand All @@ -25,7 +32,11 @@ class SearchButton extends StatelessWidget {
? YaruSearchButton(
searchActive: active,
onPressed: onTap,
icon: icon,
icon: icon ??
Icon(
YaruIcons.search,
color: iconColor,
),
selectedIcon: icon,
)
: IconButton(
Expand All @@ -34,13 +45,14 @@ class SearchButton extends StatelessWidget {
selectedIcon: icon ??
Icon(
Iconz.search,
color: context.theme.colorScheme.primary,
color: iconColor ?? context.theme.colorScheme.primary,
size: iconSize,
),
icon: icon ??
Icon(
Iconz.search,
size: iconSize,
color: iconColor,
),
);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/common/view/sliver_filter_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ class SliverFilterAppBar extends StatelessWidget {
this.onStretchTrigger,
required this.title,
required this.padding,
this.actions,
});

final Future<void> Function()? onStretchTrigger;
final Widget title;
final EdgeInsets padding;
final List<Widget>? actions;

@override
Widget build(BuildContext context) {
Expand All @@ -29,6 +31,7 @@ class SliverFilterAppBar extends StatelessWidget {
stretch: true,
title: title,
onStretchTrigger: onStretchTrigger,
actions: actions ?? [Container()],
),
);
}
Expand Down
26 changes: 1 addition & 25 deletions lib/common/view/theme.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import 'ui_constants.dart';
import 'icons.dart';
import 'ui_constants.dart';

ThemeData? yaruDarkWithTweaks(YaruThemeData yaru) {
return yaru.darkTheme?.copyWith(
Expand Down Expand Up @@ -309,29 +308,6 @@ NavigationBarThemeData navigationBarTheme({required ThemeData theme}) =>
),
);

SystemUiOverlayStyle systemOverlayStyle({
required ThemeData theme,
required bool fullWindowMode,
}) {
return theme.colorScheme.isLight
? SystemUiOverlayStyle.dark.copyWith(
systemNavigationBarColor:
(fullWindowMode ? Colors.transparent : theme.cardColor),
statusBarColor: (fullWindowMode
? Colors.transparent
: theme.scaffoldBackgroundColor),
statusBarBrightness: theme.brightness,
)
: SystemUiOverlayStyle.light.copyWith(
systemNavigationBarColor:
(fullWindowMode ? Colors.transparent : theme.cardColor),
statusBarColor: (fullWindowMode
? Colors.transparent
: theme.scaffoldBackgroundColor),
statusBarBrightness: theme.brightness,
);
}

List<Widget> space({
double widthGap = kSmallestSpace,
double heightGap = kSmallestSpace,
Expand Down
4 changes: 4 additions & 0 deletions lib/extensions/build_context_x.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ extension BuildContextX on BuildContext {

Size get mediaQuerySize => MediaQuery.sizeOf(this);
bool get isPortrait => MediaQuery.orientationOf(this) == Orientation.portrait;
bool get isAndroidGestureNavigationEnabled {
final value = MediaQuery.of(this).systemGestureInsets.bottom;
return value < 48.0 && value != 0.0;
}

bool get smallWindow => mediaQuerySize.width < kMasterDetailBreakPoint;
bool get wideWindow => mediaQuerySize.width < kAdaptivContainerBreakPoint;
Expand Down
2 changes: 1 addition & 1 deletion lib/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class HomePage extends StatelessWidget with WatchItMixin {
),
SliverPadding(
padding: padding,
sliver: const SliverPodcastSearchResults(
sliver: const SliverPodcastSearchCountryChartsResults(
expand: false,
take: 3,
),
Expand Down
1 change: 1 addition & 0 deletions lib/player/view/full_height_player_top_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class FullHeightPlayerTopControls extends StatelessWidget with WatchItMixin {
children: [
if (playerPosition == PlayerPosition.fullWindow)
SearchButton(
iconColor: iconColor,
onPressed: () async {
await onFullHeightButtonPressed();
di<SearchModel>()
Expand Down
14 changes: 10 additions & 4 deletions lib/player/view/full_height_video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../app_config.dart';
import '../../common/data/audio_type.dart';
import '../../common/view/icons.dart';
import '../../common/view/ui_constants.dart';
import '../../extensions/build_context_x.dart';
import '../../l10n/l10n.dart';
import '../player_model.dart';
import 'full_height_player_top_controls.dart';
Expand Down Expand Up @@ -109,10 +110,15 @@ class FullHeightVideoPlayer extends StatelessWidget with WatchItMixin {
),
],
),
child: RepaintBoundary(
child: Video(
controller: di<PlayerModel>().controller,
controls: (state) => MaterialVideoControls(state),
child: Padding(
padding: context.isPortrait && isMobilePlatform
? const EdgeInsets.only(bottom: 40)
: EdgeInsets.zero,
child: RepaintBoundary(
child: Video(
controller: di<PlayerModel>().controller,
controls: (state) => MaterialVideoControls(state),
),
),
),
);
Expand Down
19 changes: 15 additions & 4 deletions lib/search/search_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,19 @@ class SearchModel extends SafeChangeNotifier {
Future<List<Station>?> radioNameSearch(String? searchQuery) async =>
_radioService.search(name: searchQuery, limit: _radioLimit);

List<Station>? _countryCharts;
List<Station>? get countryCharts => _countryCharts;
Future<void> radioCountrySearch({int limit = 3}) async => _countryCharts =
await _radioService.search(country: _country?.name, limit: limit);
List<Station>? _radioCountryChartsPeak;
List<Station>? get radioCountryChartsPeak => _radioCountryChartsPeak;
Future<void> radioCountrySearch({int limit = 3}) async {
_radioCountryChartsPeak =
await _radioService.search(country: _country?.name, limit: limit);
notifyListeners();
}

SearchResult? _podcastChartsPeak;
SearchResult? get podcastChartsPeak => _podcastChartsPeak;
Future<void> fetchPodcastChartsPeak({int limit = 3}) async {
_podcastChartsPeak =
await _podcastService.search(country: _country, limit: limit);
notifyListeners();
}
}
4 changes: 2 additions & 2 deletions lib/search/search_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../l10n/l10n.dart';
enum SearchType {
localTitle,
localArtist,
localAlbumArtist,
// localAlbumArtist,
localAlbum,
localGenreName,
localPlaylists,
Expand All @@ -17,7 +17,7 @@ enum SearchType {
String localize(AppLocalizations l10n) => switch (this) {
localTitle => l10n.titles,
localArtist => l10n.artists,
localAlbumArtist => l10n.albumArtists,
// localAlbumArtist => l10n.albumArtists,
localAlbum => l10n.albums,
localGenreName => l10n.genres,
localPlaylists => l10n.playlists,
Expand Down
2 changes: 2 additions & 0 deletions lib/search/view/search_page_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:podcast_search/podcast_search.dart';
import 'package:watch_it/watch_it.dart';

import '../../app_config.dart';
import '../../common/data/audio_type.dart';
import '../../common/data/podcast_genre.dart';
import '../../common/view/country_auto_complete.dart';
Expand Down Expand Up @@ -34,6 +35,7 @@ class SearchPageInput extends StatelessWidget with WatchItMixin {
SearchType.radioTag => const TagAutoCompleteWithSuffix(),
SearchType.radioLanguage => const LanguageAutoCompleteWithSuffix(),
_ => SearchInput(
autoFocus: !isMobilePlatform,
text: searchQuery,
hintText: context.l10n.search,
onChanged: (v) async {
Expand Down
Loading

0 comments on commit 5d68b82

Please sign in to comment.