99using Dimmer . DimmerSearch ;
1010using Dimmer . UiUtils ;
1111using Dimmer . Utils ;
12+ using Dimmer . Utils . Extensions ;
1213using Dimmer . ViewsAndPages . NativeViews . DimmerLive ;
1314using Dimmer . ViewsAndPages . NativeViews . Misc ;
1415using Dimmer . ViewsAndPages . ViewUtils ;
@@ -75,7 +76,7 @@ public HomePageFragment(BaseViewModelAnd myViewModel)
7576 }
7677 private CancellationTokenSource ? _searchCts ;
7778 private SongAdapter _adapter ;
78-
79+ private ImageView _backgroundImageView ;
7980
8081 public override View OnCreateView ( LayoutInflater inflater , ViewGroup ? container , Bundle ? savedInstanceState )
8182 {
@@ -89,6 +90,15 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
8990
9091 root . SetBackgroundColor ( UiBuilder . IsDark ( ctx ) ? Color . ParseColor ( "#0D0E20" ) : Color . ParseColor ( "#CAD3DA" ) ) ;
9192
93+ _backgroundImageView = new ImageView ( ctx )
94+ {
95+ LayoutParameters = new FrameLayout . LayoutParams ( - 1 , - 1 ) ,
96+
97+ } ;
98+
99+ _backgroundImageView . SetScaleType ( ImageView . ScaleType . CenterCrop ) ;
100+
101+ root . AddView ( _backgroundImageView ) ;
92102 // 2. Main Content Container (Linear Layout inside Coordinator)
93103 var contentLinear = new LinearLayout ( ctx )
94104 {
@@ -129,6 +139,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
129139 Background = null ,
130140 TextSize = 14
131141 } ;
142+ _searchBar . SetTextColor ( ! UiBuilder . IsDark ( this . View ) ? Color . Black : Color . White ) ;
132143 _searchBar . SetPadding ( 40 , 30 , 40 , 30 ) ;
133144
134145 _searchBar . TextChanged += _searchBar_TextChanged ;
@@ -143,27 +154,27 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
143154 } ;
144155 searchCard . AddView ( _searchBar ) ;
145156 // Help Button
146- helpBtn = new Google . Android . Material . Button . MaterialButton ( ctx , null , Resource . Attribute . materialIconButtonStyle )
157+ QueueBtn = new Google . Android . Material . Button . MaterialButton ( ctx , null , Resource . Attribute . materialIconButtonStyle )
147158 {
148159 Icon = AndroidX . Core . Content . ContextCompat . GetDrawable ( ctx , Resource . Drawable . playlista ) ,
149160 IconTint = Android . Content . Res . ColorStateList . ValueOf ( Android . Graphics . Color . DarkSlateBlue ) ,
150161 LayoutParameters = new LinearLayout . LayoutParams ( AppUtil . DpToPx ( 50 ) , AppUtil . DpToPx ( 50 ) )
151162 } ;
152- helpBtn . Click += async ( s , e ) =>
163+ QueueBtn . Click += async ( s , e ) =>
153164 {
154165
155- var queueSheet = new QueueBottomSheetFragment ( MyViewModel ) ;
166+ var queueSheet = new QueueBottomSheetFragment ( MyViewModel , QueueBtn ) ;
156167 queueSheet . Show ( ParentFragmentManager , "QueueSheet" ) ;
157-
168+ QueueBtn . Enabled = false ;
158169 await Task . Delay ( 800 ) ;
159170 queueSheet . ScrollToSong ( ) ;
160171 } ;
161- helpBtn . LongClickable = true ;
162- helpBtn . LongClick += ( s , e ) =>
172+ QueueBtn . LongClickable = true ;
173+ QueueBtn . LongClick += ( s , e ) =>
163174 {
164175 MyViewModel . CopyAllSongsInNowPlayingQueueToMainSearchResult ( ) ;
165176 Toast . MakeText ( ctx , "Copied Queue to Main UI" , ToastLength . Short ) ;
166- helpBtn . PerformHapticFeedback ( FeedbackConstants . Confirm ) ;
177+ QueueBtn . PerformHapticFeedback ( FeedbackConstants . Confirm ) ;
167178 } ;
168179
169180 loadingIndic = new LoadingIndicator ( ctx ) ;
@@ -173,7 +184,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
173184 // Add items to Header
174185 headerLayout . AddView ( menuBtn ) ;
175186 headerLayout . AddView ( searchCard ) ;
176- headerLayout . AddView ( helpBtn ) ;
187+ headerLayout . AddView ( QueueBtn ) ;
177188
178189
179190
@@ -186,24 +197,22 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
186197 bottomLayout . SetPadding ( 20 , 20 , 20 , 20 ) ;
187198
188199 songsTotal = new TextView ( ctx , null , Resource . Attribute . titleTextStyle ) ;
189-
200+ songsTotal . SetTextColor ( UiBuilder . IsDark ( this . View ) ? Color . White : Color . Black ) ;
190201 songsTotal . TextAlignment = TextAlignment . TextStart ;
191202
192203
193- var twoRowLayout = new LinearLayout ( ctx )
194- {
195- Orientation = Orientation . Vertical
196- } ;
197204
198- twoRowLayout . SetPadding ( 10 , 10 , 10 , 10 ) ;
199- currentTql = UiBuilder . CreateMarqueeTextView ( ctx ) ;
205+ currentTql = new TextView ( ctx , null , Resource . Attribute . titleTextStyle ) ;
206+
207+
208+ currentTql . SetTextColor ( UiBuilder . IsDark ( this . View ) ? Color . White : Color . Black ) ;
200209
201- twoRowLayout . AddView ( currentTql ) ;
202210
203211 bottomLayout . AddView ( loadingIndic ) ;
204212
205213 bottomLayout . AddView ( songsTotal ) ;
206- bottomLayout . AddView ( twoRowLayout ) ;
214+
215+ bottomLayout . AddView ( currentTql ) ;
207216
208217
209218
@@ -241,7 +250,9 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup? container,
241250 // --- 5. Extended FAB ---
242251 fab = new Google . Android . Material . FloatingActionButton . ExtendedFloatingActionButton ( ctx ) ;
243252 ;
244- fab . Extended = false ;
253+ fab . Extended = true ;
254+
255+ fab . SetBackgroundColor ( UiBuilder . IsDark ( ctx ) ? Color . ParseColor ( "#1a1a1a" ) : Color . ParseColor ( "#DEDFF0" ) ) ;
245256 fab . SetIconResource ( Resource . Drawable . musicaba ) ;
246257
247258
@@ -337,13 +348,27 @@ public override void OnResume()
337348
338349 MyViewModel . WhenPropertyChange ( nameof ( MyViewModel . CurrentPlayingSongView ) , newVl => MyViewModel . CurrentPlayingSongView )
339350 . ObserveOn ( RxSchedulers . UI )
340- . Subscribe ( currSong =>
351+ . Subscribe ( async currSong =>
341352 {
342353 var art = currSong . Artist ;
343354 var alb = currSong . Album ;
344355 var artImgPath = art ? . ImagePath ;
345356 var albImgPath = alb ? . ImagePath ;
346-
357+ if ( MyViewModel . CurrentPlayingSongView . CoverImagePath is not null )
358+ {
359+
360+ if ( UiBuilder . IsDark ( this . View ) )
361+ {
362+
363+ await _backgroundImageView . SetImageWithStringPathViaGlideAndFilterEffect ( MyViewModel . CurrentPlayingSongView . CoverImagePath ,
364+ Utilities . FilterType . DarkAcrylic ) ;
365+ }
366+ else
367+ {
368+ await _backgroundImageView . SetImageWithStringPathViaGlideAndFilterEffect ( MyViewModel . CurrentPlayingSongView . CoverImagePath ,
369+ Utilities . FilterType . Glassy ) ;
370+ }
371+ }
347372 //currSong.IsCurrentPlayingHighlight= true;
348373 } ) ;
349374
@@ -366,7 +391,7 @@ public override void OnResume()
366391 . Subscribe ( pbQueue =>
367392 {
368393 if ( pbQueue is not null )
369- helpBtn . TooltipText = $ "{ MyViewModel . PlaybackQueue . Count } Songs in Queue";
394+ QueueBtn . TooltipText = $ "{ MyViewModel . PlaybackQueue . Count } Songs in Queue";
370395 } ) ;
371396
372397
@@ -457,37 +482,7 @@ public override void OnViewCreated(View view, Bundle? savedInstanceState)
457482 . DisposeWith ( CompositeDisposables ) ;
458483
459484
460- _morphMenu = new FabMorphMenu ( Context , root , fab )
461- . AddItem ( "Settings" , Resource . Drawable . settings , ( ) =>
462- {
463- // Logic copied from your old ShowFabMenu
464- if ( Activity is TransitionActivity act )
465- act . NavigateTo ( new SettingsFragment ( "sett" , MyViewModel ) , "SettingsFragment" ) ;
466- } )
467- . AddItem ( "Search (TQL)" , Resource . Drawable . searchd , ( ) =>
468- {
469- var searchSheet = new TqlSearchBottomSheet ( MyViewModel ) ;
470- searchSheet . Show ( ParentFragmentManager , "TqlSearchSheet" ) ;
471- } )
472- . AddItem ( "Scroll to Playing" , Resource . Drawable . eye , ( ) =>
473- {
474-
475- var songPos = MyViewModel . SearchResults . IndexOf ( MyViewModel . CurrentPlayingSongView ) ;
476- _songListRecycler ? . SmoothScrollToPosition ( songPos ) ;
477-
478- Toast . MakeText ( Context , $ "Scrolled To Song { MyViewModel . CurrentPlayingSongView . Title } ", ToastLength . Short ) ? . Show ( ) ;
479- } )
480- . AddItem ( "View Queue" , Resource . Drawable . playlistminimalistic3 , ( ) =>
481- {
482- var queueSheet = new QueueBottomSheetFragment ( MyViewModel ) ;
483- queueSheet . Show ( ParentFragmentManager , "QueueSheet" ) ;
484- } )
485- . AddItem ( "Login" , Resource . Drawable . user , ( ) =>
486- {
487- MyViewModel . NavigateToAnyPageOfGivenType ( this , new LoginFragment ( "IntoLogin" , MyViewModel ) , "loginPageTag" ) ;
488- } ) ;
489-
490-
485+
491486 PostponeEnterTransition ( ) ;
492487 _songListRecycler ? . ViewTreeObserver ? . AddOnPreDrawListener ( new MyPreDrawListener ( _songListRecycler , this ) ) ;
493488
@@ -516,7 +511,7 @@ private void Fab_LongClick(object? sender, View.LongClickEventArgs e)
516511 public LoadingIndicator loadingIndic { get ; private set ; }
517512 public TextView songsTotal { get ; private set ; }
518513 public TextView currentTql { get ; private set ; }
519- public Button helpBtn { get ; private set ; }
514+ public Button QueueBtn { get ; private set ; }
520515
521516 public override void OnDestroyView ( )
522517 {
0 commit comments