Skip to content

Commit b919075

Browse files
committed
Refactor HomePageAdapter for performance and native UX
- Replaced C# event delegates with native click/long-click interfaces in ViewHolder for all song actions - Programmatically built item layout using Material Design components for improved appearance and performance - Optimized expand/collapse logic for efficient UI updates - Moved DiffUtil calculation to background thread for responsiveness - Improved disposal and resource management in adapter - Centralized song action handling with instant feedback and haptics - Updated TransitionActivity to use GlobalLibraryStatsFragment - Removed unused SongsToWatchSource enum and cleaned up code
1 parent ac8dc6e commit b919075

File tree

2 files changed

+324
-616
lines changed

2 files changed

+324
-616
lines changed

Dimmer/Dimmer.Droid/ViewsAndPages/NativeViews/Activity/TransitionActivity.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Dimmer.ViewsAndPages.NativeViews.DeviceTransfer;
1111
using Dimmer.ViewsAndPages.NativeViews.DimmerLive;
1212
using Dimmer.ViewsAndPages.NativeViews.DimmerLive.LastFMViews;
13-
13+
using Dimmer.ViewsAndPages.NativeViews.Stats;
1414
using Google.Android.Material.BottomNavigation;
1515
using Google.Android.Material.Navigation;
1616

@@ -130,7 +130,7 @@ protected override void OnCreate(Bundle? savedInstanceState)
130130

131131

132132
MyViewModel.HomeAdapter = new HomePageAdapter(this.BaseContext,
133-
MyViewModel, startFragment, HomePageAdapter.SongsToWatchSource.HomePage
133+
MyViewModel, startFragment
134134
);
135135
SupportFragmentManager
136136
.BeginTransaction()
@@ -513,10 +513,14 @@ private void NavigateToId(int id)
513513
break;
514514
case 101:
515515

516-
selectedFrag = new LibraryStatsFragment(MyViewModel);
517-
tag = "LibraryStatsFragment";
516+
var statsVm = MainApplication.ServiceProvider.GetService<StatisticsViewModel>();
517+
if (statsVm != null)
518+
{
519+
selectedFrag = new GlobalLibraryStatsFragment(statsVm);
520+
tag = "GlobalLibraryStatsFragment";
521+
}
522+
break;
518523

519-
break;
520524
case 102:
521525

522526
selectedFrag = new LastFMLoginFragment( MyViewModel);

0 commit comments

Comments
 (0)