Skip to content

Commit

Permalink
chore: few ui tweaks
Browse files Browse the repository at this point in the history
+ bottom nav bar text overflow & indicator color
+ drawer tile text overflow
+ general pages expandable container text overflow
+ core: clear filenames map properly
  • Loading branch information
MSOB7YY committed May 22, 2024
1 parent c838173 commit 73b4236
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 38 deletions.
1 change: 1 addition & 0 deletions lib/controller/indexer_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ class Indexer {
tracksInfoList.clear();
allTracksMappedByPath.clear();
allTracksMappedByYTID.clear();
_currentFileNamesMap.clear();
SearchSortController.inst.sortMedia(MediaType.track);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/pages/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class _AboutPageState extends State<AboutPage> {
const SizedBox(width: 4.0),
const Icon(
Broken.arrow_up_1,
size: 14.0,
size: 8.0,
),
],
)
Expand Down
47 changes: 29 additions & 18 deletions lib/ui/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -471,25 +471,36 @@ class _CustomNavBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
final bottomNavBar = Obx(
() => NavigationBar(
animationDuration: const Duration(seconds: 1),
elevation: 22,
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
height: 64.0,
onDestinationSelected: (value) async {
final tab = value.toEnum();
ScrollSearchController.inst.animatePageController(tab);
},
selectedIndex: settings.selectedLibraryTab.value.toInt().toIf(0, -1),
destinations: [
...settings.libraryTabs.map(
(e) => NavigationDestination(
icon: Icon(e.toIcon()),
label: settings.libraryTabs.length >= 7 ? '' : e.toText(),
),
final bottomNavBar = NavigationBarTheme(
data: NavigationBarThemeData(
indicatorColor: Color.alphaBlend(context.theme.colorScheme.primary.withAlpha(20), context.theme.colorScheme.secondaryContainer),
labelTextStyle: MaterialStatePropertyAll(
TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: 13.0.multipliedFontScale,
),
],
),
),
child: Obx(
() => NavigationBar(
animationDuration: const Duration(seconds: 1),
elevation: 22,
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
height: 64.0,
onDestinationSelected: (value) async {
final tab = value.toEnum();
ScrollSearchController.inst.animatePageController(tab);
},
selectedIndex: settings.selectedLibraryTab.value.toInt().toIf(0, -1),
destinations: [
...settings.libraryTabs.map(
(e) => NavigationDestination(
icon: Icon(e.toIcon()),
label: settings.libraryTabs.length >= 7 ? '' : e.toText(),
),
),
],
),
),
);

Expand Down
19 changes: 11 additions & 8 deletions lib/ui/widgets/custom_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1861,16 +1861,19 @@ class NamidaDrawerListTile extends StatelessWidget {
color: enabled ? Colors.white.withAlpha(200) : null,
size: iconSize,
),
if (title != '') ...[
const SizedBox(width: 12.0),
Text(
title,
style: context.textTheme.displayMedium?.copyWith(
color: enabled ? Colors.white.withAlpha(200) : null,
fontSize: 15.0.multipliedFontScale,
if (title != '') const SizedBox(width: 12.0),
if (title != '')
Expanded(
child: Text(
title,
style: context.textTheme.displayMedium?.copyWith(
color: enabled ? Colors.white.withAlpha(200) : null,
fontSize: 15.0.multipliedFontScale,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
],
),
),
Expand Down
27 changes: 17 additions & 10 deletions lib/ui/widgets/expandable_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,24 @@ class ExpandableBox extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(width: 18.0),
Row(
children: [
if (leftWidgets != null) ...leftWidgets!,
Text(
leftText,
style: context.textTheme.displayMedium,
),
if (displayloadingIndicator) ...[const SizedBox(width: 8.0), const LoadingIndicator()]
],
Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (leftWidgets != null) ...leftWidgets!,
Expanded(
child: Text(
leftText,
style: context.textTheme.displayMedium,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
if (displayloadingIndicator) ...[const SizedBox(width: 8.0), const LoadingIndicator()]
],
),
),
const Spacer(),
// const Spacer(),
if (gridWidget != null) gridWidget!,
// Sort By Menu
const SizedBox(width: 4.0),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 2.5.5-beta+240522000
version: 2.5.6-beta+240522000

environment:
sdk: ">=3.1.4 <4.0.0"
Expand Down

0 comments on commit 73b4236

Please sign in to comment.