1
0
mirror of https://github.com/stonega/tsacdop synced 2025-02-18 04:20:37 +01:00

Update grid view UI.

This commit is contained in:
stonegate 2020-09-14 23:18:13 +08:00
parent 8ea216468a
commit e1fe91983e
2 changed files with 35 additions and 42 deletions

View File

@ -36,7 +36,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
int _groupIndex = 0; int _groupIndex = 0;
AnimationController _controller; AnimationController _controller;
TweenSequence _slideTween; TweenSequence _slideTween;
_getSlideTween(double value) => TweenSequence<double>([ TweenSequence<double> _getSlideTween(double value) => TweenSequence<double>([
TweenSequenceItem( TweenSequenceItem(
tween: Tween<double>(begin: 0.0, end: value), weight: 3 / 5), tween: Tween<double>(begin: 0.0, end: value), weight: 3 / 5),
TweenSequenceItem(tween: ConstantTween<double>(value), weight: 1 / 5), TweenSequenceItem(tween: ConstantTween<double>(value), weight: 1 / 5),
@ -80,7 +80,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width; final width = MediaQuery.of(context).size.width;
final s = context.s; final s = context.s;
return Selector<GroupList, Tuple3<List<PodcastGroup>, bool, bool>>( return Selector<GroupList, Tuple3<List<PodcastGroup>, bool, bool>>(
selector: (_, groupList) => selector: (_, groupList) =>
@ -907,27 +907,27 @@ class ShowEpisode extends StatelessWidget {
episodes[index].pubDate), episodes[index].pubDate),
overflow: TextOverflow.visible, overflow: TextOverflow.visible,
style: TextStyle( style: TextStyle(
height: 1,
fontSize: _width / 35, fontSize: _width / 35,
color: c, color: c,
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
), ),
), ),
Spacer(), Spacer(),
episodes[index].duration != 0 if (episodes[index].duration != 0)
? Container( Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
episodes[index] episodes[index]
.duration .duration
.toTime, .toTime,
style: TextStyle( style: TextStyle(
fontSize: _width / 35, fontSize: _width / 35,
// color: _c, // color: _c,
// fontStyle: FontStyle.italic, // fontStyle: FontStyle.italic,
), ),
), ),
) ),
: Center(),
episodes[index].duration == 0 || episodes[index].duration == 0 ||
episodes[index] episodes[index]
.enclosureLength == .enclosureLength ==
@ -940,25 +940,22 @@ class ShowEpisode extends StatelessWidget {
'|', '|',
style: TextStyle( style: TextStyle(
fontSize: _width / 35, fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
), ),
), ),
episodes[index].enclosureLength != if (episodes[index]
null && .enclosureLength !=
episodes[index] null &&
.enclosureLength != episodes[index]
0 .enclosureLength !=
? Container( 0)
alignment: Alignment.center, Container(
child: Text( alignment: Alignment.center,
'${(episodes[index].enclosureLength) ~/ 1000000}MB', child: Text(
style: TextStyle( '${(episodes[index].enclosureLength) ~/ 1000000}MB',
fontSize: style: TextStyle(
_width / 35), fontSize: _width / 35),
), ),
) ),
: Center(),
], ],
)), )),
], ],

View File

@ -194,7 +194,9 @@ class EpisodeGrid extends StatelessWidget {
Text( Text(
episode.pubDate.toDate(context), episode.pubDate.toDate(context),
overflow: TextOverflow.visible, overflow: TextOverflow.visible,
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
height: 1,
fontSize: context.width / 35, fontSize: context.width / 35,
color: color, color: color,
fontStyle: FontStyle.italic), fontStyle: FontStyle.italic),
@ -468,10 +470,6 @@ class EpisodeGrid extends StatelessWidget {
episode: episodes[index], episode: episodes[index],
color: c), color: c),
Spacer(), Spacer(),
/// _listenIndicater(context,
// episode: episodes[index],
// isListened: snapshot.data),
_isNewIndicator(episodes[index]), _isNewIndicator(episodes[index]),
_downloadIndicater(context, _downloadIndicater(context,
episode: episodes[index], episode: episodes[index],
@ -517,7 +515,7 @@ class EpisodeGrid extends StatelessWidget {
Spacer(), Spacer(),
if (layout != Layout.three && if (layout != Layout.three &&
episodes[index].duration != 0) episodes[index].duration != 0)
Container( Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
episodes[index].duration.toTime, episodes[index].duration.toTime,
@ -535,8 +533,6 @@ class EpisodeGrid extends StatelessWidget {
'|', '|',
style: TextStyle( style: TextStyle(
fontSize: _width / 35, fontSize: _width / 35,
// color: _c,
// fontStyle: FontStyle.italic,
), ),
), ),
if (layout != Layout.three && if (layout != Layout.three &&
@ -544,7 +540,7 @@ class EpisodeGrid extends StatelessWidget {
null && null &&
episodes[index].enclosureLength != episodes[index].enclosureLength !=
0) 0)
Container( Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
'${(episodes[index].enclosureLength) ~/ 1000000}MB', '${(episodes[index].enclosureLength) ~/ 1000000}MB',