Skip to content

Commit

Permalink
chore: play option for floating action button
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Feb 14, 2024
1 parent 69cb045 commit 8c13c38
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/core/dimensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Dimensions {
route == RouteType.SETTINGS_page || // bcz no search
route == RouteType.SETTINGS_subpage || // bcz no search
route == RouteType.YOUTUBE_PLAYLIST_DOWNLOAD_SUBPAGE || // bcz has fab
(fab == FABType.shuffle && SelectedTracksController.inst.currentAllTracks.isEmpty) ||
((fab == FABType.shuffle || fab == FABType.play) && SelectedTracksController.inst.currentAllTracks.isEmpty) ||
(settings.selectedLibraryTab.value == LibraryTab.tracks && LibraryTab.tracks.isBarVisible == false);
return shouldHide;
}
Expand Down
1 change: 1 addition & 0 deletions lib/core/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ enum SettingSubpageEnum {

enum FABType {
none,
play,
shuffle,
search,
}
Expand Down
2 changes: 2 additions & 0 deletions lib/core/namida_converter_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,7 @@ class _NamidaConverters {
FABType.none: lang.NONE,
FABType.search: lang.SEARCH,
FABType.shuffle: lang.SHUFFLE,
FABType.play: lang.PLAY,
},
YTHomePages: {
YTHomePages.home: lang.HOME,
Expand Down Expand Up @@ -1588,6 +1589,7 @@ class _NamidaConverters {
FABType.none: Broken.status,
FABType.search: Broken.search_normal,
FABType.shuffle: Broken.shuffle,
FABType.play: Broken.play_cricle,
},
};

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class MainPage extends StatelessWidget {
if (forceSearch || fab == FABType.search) {
ScrollSearchController.inst.toggleSearchMenu();
ScrollSearchController.inst.searchBarKey.currentState?.openCloseSearchBar();
} else if (fab == FABType.shuffle) {
Player.inst.playOrPause(0, SelectedTracksController.inst.currentAllTracks, QueueSource.allTracks, shuffle: true);
} else if (fab == FABType.shuffle || fab == FABType.play) {
Player.inst.playOrPause(0, SelectedTracksController.inst.currentAllTracks, QueueSource.allTracks, shuffle: fab == FABType.shuffle);
}
},
child: Icon(
Expand Down

0 comments on commit 8c13c38

Please sign in to comment.