Gestaffelte Enter-Animation für Songlisten (EinblendItem)
Items in song_list.dart und artist_list.dart faden/rutschen beim ersten Erscheinen gestaffelt statt abrupt ein — angelehnt an HyperOS' fließende Motion-Sprache. Läuft einmal pro Element, respektiert Reduce-Motion und deckelt die Verzögerung ab Index 12.
This commit is contained in:
@@ -5,6 +5,7 @@ import '../settings/app_settings.dart';
|
||||
import '../shared/auswahl.dart';
|
||||
import '../shared/auswahl_leiste.dart';
|
||||
import '../shared/cover.dart';
|
||||
import '../shared/einblend_item.dart';
|
||||
import '../shared/theme.dart';
|
||||
import '../shared/titel_listen_screen.dart';
|
||||
import 'category_service.dart';
|
||||
@@ -44,7 +45,10 @@ class _ArtistListScreenState extends State<ArtistListScreen> {
|
||||
itemCount: artists.length,
|
||||
itemBuilder: (context, i) {
|
||||
final artist = artists[i];
|
||||
return _KuenstlerZeile(name: artist, songs: grouped[artist]!);
|
||||
return EinblendItem(
|
||||
index: i,
|
||||
child: _KuenstlerZeile(name: artist, songs: grouped[artist]!),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
@@ -167,25 +171,31 @@ class _KuenstlerScreenState extends State<KuenstlerScreen> {
|
||||
body: ListView.builder(
|
||||
itemCount: vorspann + widget.songs.length,
|
||||
itemBuilder: (context, i) {
|
||||
if (zeigeAlben) {
|
||||
if (i == 0) return const _Kopf('Alben');
|
||||
if (i <= albumListe.length) {
|
||||
final eintrag = albumListe[i - 1];
|
||||
return _AlbumZeile(name: eintrag.key, songs: eintrag.value);
|
||||
Widget zeile() {
|
||||
if (zeigeAlben) {
|
||||
if (i == 0) return const _Kopf('Alben');
|
||||
if (i <= albumListe.length) {
|
||||
final eintrag = albumListe[i - 1];
|
||||
return _AlbumZeile(name: eintrag.key, songs: eintrag.value);
|
||||
}
|
||||
if (i == albumListe.length + 1) {
|
||||
return const Divider(height: 1);
|
||||
}
|
||||
if (i == albumListe.length + 2) return const _Kopf('Alle Titel');
|
||||
}
|
||||
if (i == albumListe.length + 1) return const Divider(height: 1);
|
||||
if (i == albumListe.length + 2) return const _Kopf('Alle Titel');
|
||||
final index = i - vorspann;
|
||||
final song = widget.songs[index];
|
||||
return SongZeile(
|
||||
song: song,
|
||||
warteschlange: widget.songs,
|
||||
index: index,
|
||||
auswahlModus: _waehltAus,
|
||||
ausgewaehlt: _auswahl.contains(song.id),
|
||||
onAuswahlWechsel: () => _wechsleAuswahl(song.id),
|
||||
);
|
||||
}
|
||||
final index = i - vorspann;
|
||||
final song = widget.songs[index];
|
||||
return SongZeile(
|
||||
song: song,
|
||||
warteschlange: widget.songs,
|
||||
index: index,
|
||||
auswahlModus: _waehltAus,
|
||||
ausgewaehlt: _auswahl.contains(song.id),
|
||||
onAuswahlWechsel: () => _wechsleAuswahl(song.id),
|
||||
);
|
||||
|
||||
return EinblendItem(index: i, child: zeile());
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ import '../player/now_playing_screen.dart';
|
||||
import '../playlists/create_playlist_dialog.dart';
|
||||
import '../settings/app_settings.dart';
|
||||
import '../shared/cover.dart';
|
||||
import '../shared/einblend_item.dart';
|
||||
import '../shared/favorite_button.dart';
|
||||
import '../shared/lauf_balken.dart';
|
||||
import 'category_service.dart';
|
||||
@@ -94,15 +95,18 @@ class SongList extends StatelessWidget {
|
||||
controller: controller,
|
||||
itemExtent: festeHoehe ? songZeilenHoeheFuer(context) : null,
|
||||
itemCount: songs.length,
|
||||
itemBuilder: (context, i) => SongZeile(
|
||||
song: songs[i],
|
||||
warteschlange: songs,
|
||||
itemBuilder: (context, i) => EinblendItem(
|
||||
index: i,
|
||||
auswahlModus: gewaehlt != null && gewaehlt.isNotEmpty,
|
||||
ausgewaehlt: gewaehlt?.contains(songs[i].id) ?? false,
|
||||
onAuswahlWechsel: onAuswahlWechsel == null
|
||||
? null
|
||||
: () => onAuswahlWechsel!(songs[i].id),
|
||||
child: SongZeile(
|
||||
song: songs[i],
|
||||
warteschlange: songs,
|
||||
index: i,
|
||||
auswahlModus: gewaehlt != null && gewaehlt.isNotEmpty,
|
||||
ausgewaehlt: gewaehlt?.contains(songs[i].id) ?? false,
|
||||
onAuswahlWechsel: onAuswahlWechsel == null
|
||||
? null
|
||||
: () => onAuswahlWechsel!(songs[i].id),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user