Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nt4f04uNd committed Apr 19, 2021
1 parent 152907c commit cfd431a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.3

- Fix issue with current song not updated on search route

## 1.0.2

- Selection is now everywhere - all songs, all albums, queue, search route - every content entry is now selectable
Expand Down
102 changes: 55 additions & 47 deletions lib/routes/home_route/search_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -570,53 +570,61 @@ class _DelegateBuilder extends StatelessWidget {
final contentListContentType = single ? contentTypeEntries.single.key : contentType;
return NFBackButtonListener(
onBackButtonPressed: () => _handlePop(delegate),
child: PageTransitionSwitcher(
duration: const Duration(milliseconds: 300),
reverse: !single && contentType == null,
transitionBuilder: (child, animation, secondaryAnimation) => SharedAxisTransition(
transitionType: SharedAxisTransitionType.vertical,
animation: animation,
secondaryAnimation: secondaryAnimation,
fillColor: Colors.transparent,
child: child,
),
child: Container(
key: ValueKey(contentType),
child: showSingleCategoryContentList
? () {
final list = single
? contentTypeEntries.single.value
: contentPick<Content, List<Content>>(
contentType: contentType,
song: delegate.results.songs,
album: delegate.results.albums,
);
return ContentListView(
contentType: contentListContentType,
controller: delegate.singleListScrollController,
selectionController: delegate.selectionController,
selectedTest: (index) =>delegate.selectionController.data
.firstWhereOrNull((el) => el.data == list[index]) != null,
onItemTap: delegate.getContentTileTapHandler(contentListContentType),
list: list,
);
} ()
:
// AppScrollbar( // TODO: enable this when i have more content on search screen
// controller: delegate.scrollController,
// child:
ListView(
controller: delegate.scrollController,
children: [
for (final entry in contentTypeEntries)
if (entry.value.isNotEmpty)
_ContentSection(
contentType: entry.key,
items: results.map[entry.key],
onTap: () => delegate.contentType = entry.key,
),
],
),
child:
StreamBuilder(
stream: ContentControl.state.onSongChange,
builder: (context, snapshot) =>
StreamBuilder(stream: ContentControl.state.onContentChange,
builder: (context, snapshot) =>
PageTransitionSwitcher(
duration: const Duration(milliseconds: 300),
reverse: !single && contentType == null,
transitionBuilder: (child, animation, secondaryAnimation) => SharedAxisTransition(
transitionType: SharedAxisTransitionType.vertical,
animation: animation,
secondaryAnimation: secondaryAnimation,
fillColor: Colors.transparent,
child: child,
),
child: Container(
key: ValueKey(contentType),
child: showSingleCategoryContentList
? () {
final list = single
? contentTypeEntries.single.value
: contentPick<Content, List<Content>>(
contentType: contentType,
song: delegate.results.songs,
album: delegate.results.albums,
);
return ContentListView(
contentType: contentListContentType,
controller: delegate.singleListScrollController,
selectionController: delegate.selectionController,
selectedTest: (index) =>delegate.selectionController.data
.firstWhereOrNull((el) => el.data == list[index]) != null,
onItemTap: delegate.getContentTileTapHandler(contentListContentType),
list: list,
);
} ()
:
// AppScrollbar( // TODO: enable this when i have more content on search screen
// controller: delegate.scrollController,
// child:
ListView(
controller: delegate.scrollController,
children: [
for (final entry in contentTypeEntries)
if (entry.value.isNotEmpty)
_ContentSection(
contentType: entry.key,
items: results.map[entry.key],
onTap: () => delegate.contentType = entry.key,
),
],
),
),
),
),
),
);
Expand Down
21 changes: 7 additions & 14 deletions lib/routes/home_route/tabs_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class TabsRoute extends StatefulWidget {
class TabsRouteState extends State<TabsRoute> with TickerProviderStateMixin, SelectionHandler {
ContentSelectionController selectionController;
TabController tabController;
StreamSubscription<Song> _songChangeSubscription;
StreamSubscription<void> _contentChangeSubscription;

@override
void initState() {
Expand All @@ -62,23 +60,12 @@ class TabsRouteState extends State<TabsRoute> with TickerProviderStateMixin, Sel
vsync: this,
length: 2,
);
_songChangeSubscription = ContentControl.state.onSongChange.listen((event) {
setState(() {/* update current track indicator */});
});
_contentChangeSubscription = ContentControl.state.onContentChange.listen((event) {
setState(() {/* update to display possible changes in the list */});
});
tabController.addListener(() {
setState(() {/* update to change currently used selection controller */});
});
}

@override
void dispose() {
selectionController.dispose();
tabController.dispose();
_contentChangeSubscription.cancel();
_songChangeSubscription.cancel();
super.dispose();
}

Expand Down Expand Up @@ -162,6 +149,12 @@ class TabsRouteState extends State<TabsRoute> with TickerProviderStateMixin, Sel
),
child: Stack(
children: [
StreamBuilder(
stream: ContentControl.state.onSongChange,
builder: (context, snapshot) =>
StreamBuilder(
stream: ContentControl.state.onContentChange,
builder: (context, snapshot) =>
ScrollConfiguration(
behavior: const GlowlessScrollBehavior(),
child: Padding(
Expand All @@ -179,7 +172,7 @@ class TabsRouteState extends State<TabsRoute> with TickerProviderStateMixin, Sel
],
),
),
),
))),
if (ContentControl.state.albums.isNotEmpty)
IgnorePointer(
ignoring: selectionController.inSelection,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/nt4f04uNd/sweyer
repository: https://github.com/nt4f04uNd/sweyer
issue_tracker: https://github.com/nt4f04uNd/sweyer/issues
publish_to: none
version: 1.0.2+3
version: 1.0.3+4

environment:
sdk: ">=2.6.0<3.0.0"
Expand Down

0 comments on commit cfd431a

Please sign in to comment.