Skip to content
Snippets Groups Projects
Commit 1218cf25 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Improve some layout

parent 21d9ae16
No related branches found
No related tags found
1 merge request!22Resolve "Improve layout"
Pipeline #4530 passed
Showing with 31 additions and 33 deletions
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.20
app.versionCode=20
app.versionName=0.0.21
app.versionCode=21
......@@ -5,8 +5,7 @@
"statistics_total_scrobbles_count": "Total scrobbles count: {count}",
"statistics_last_scrobble": "Last scrobble: {datetime}",
"statistics_selected_period": "On last {daysCount} days:",
"statistics_recent_scrobbles_count": "Scrobbles: {count}",
"statistics_discoveries": "Discoveries: {artistsCount} artists / {tracksCount} tracks",
"statistics_recent_scrobbles_count_and_discoveries": "{count} scrobbles and {artistsCount} artists / {tracksCount} tracks discovered.",
"timeline_title": "Recent scrobbles ({daysCount} days)",
"counts_by_day": "Counts by day ({daysCount} days)",
......
......@@ -4,9 +4,8 @@
"global_statistics": "Statistiques globales d'écoutes",
"statistics_total_scrobbles_count": "Nombre total d'écoutes : {count}",
"statistics_last_scrobble": "Dernière écoute : {datetime}",
"statistics_selected_period": "Sur les {daysCount} derniers jours:",
"statistics_recent_scrobbles_count": "Écoutes : {count}",
"statistics_discoveries": "Découvertes : {artistsCount} artistes / {tracksCount} morceaux",
"statistics_selected_period": "Sur les {daysCount} derniers jours :",
"statistics_recent_scrobbles_count_and_discoveries": "{count} écoutes et {artistsCount} artistes / {tracksCount} morceaux découverts.",
"timeline_title": "Écoutes récentes ({daysCount} jours)",
"counts_by_day": "Écoutes par jour ({daysCount} jours)",
......
Minor layout improvments.
Améliorations visuelles mineures.
......@@ -6,26 +6,31 @@ import '../widgets/main_screen/discoveries_card.dart';
import '../widgets/main_screen/statistics_card.dart';
import '../widgets/main_screen/timeline_card.dart';
class MainScreen extends StatelessWidget {
class MainScreen extends StatefulWidget {
const MainScreen({super.key});
@override
State<MainScreen> createState() => _MainScreenState();
}
class _MainScreenState extends State<MainScreen> {
@override
Widget build(BuildContext context) {
return Material(
color: Theme.of(context).colorScheme.background,
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(),
children: <Widget>[
const SizedBox(height: 90),
const StatisticsCard(),
const SizedBox(height: 8),
const SizedBox(height: 6),
const ChartTimelineCard(),
const SizedBox(height: 8),
const SizedBox(height: 6),
const ChartDiscoveriesCard(),
const SizedBox(height: 8),
const SizedBox(height: 6),
const ChartCountsByDayCard(),
const SizedBox(height: 8),
const SizedBox(height: 6),
const ChartCountsByHourCard(),
const SizedBox(height: 36),
],
......
......@@ -28,11 +28,11 @@ class ChartCountsByDayCard extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
Radius.circular(8),
),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
padding: const EdgeInsets.all(8.0),
child: ChartCountsByDayCardContent(
daysCount: daysCount,
chartData: snapshot.hasData
......
......@@ -29,11 +29,11 @@ class ChartCountsByHourCard extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
Radius.circular(8),
),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
padding: const EdgeInsets.all(8.0),
child: ChartCountsByHourCardContent(
daysCount: daysCount,
chartData: snapshot.hasData
......
......@@ -28,11 +28,11 @@ class ChartDiscoveriesCard extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
Radius.circular(8),
),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
padding: const EdgeInsets.all(8.0),
child: ChartDiscoveriesCardContent(
daysCount: daysCount,
chartData: snapshot.hasData
......
......@@ -28,11 +28,11 @@ class StatisticsCard extends StatelessWidget {
color: Theme.of(context).colorScheme.primary,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
Radius.circular(8),
),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
padding: const EdgeInsets.all(8.0),
child: StatisticsContent(
statistics: snapshot.hasData
? StatisticsData.fromJson(jsonDecode(snapshot.data.toString()))
......
......@@ -43,7 +43,7 @@ class StatisticsContent extends StatelessWidget {
),
Text(
'statistics_selected_period',
style: textTheme.bodyMedium,
style: textTheme.bodyMedium!.apply(fontWeightDelta: 2),
).tr(
namedArgs: {
'daysCount':
......@@ -51,18 +51,11 @@ class StatisticsContent extends StatelessWidget {
},
),
Text(
'statistics_recent_scrobbles_count',
'statistics_recent_scrobbles_count_and_discoveries',
style: textTheme.bodyMedium,
).tr(
namedArgs: {
'count': this.isLoading ? placeholder : this.statistics.recentCount.toString(),
},
),
Text(
'statistics_discoveries',
style: textTheme.bodyMedium,
).tr(
namedArgs: {
'artistsCount': this.isLoading
? placeholder
: this.statistics.firstPlayedArtistsCount.toString(),
......
......@@ -28,11 +28,11 @@ class ChartTimelineCard extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12),
Radius.circular(8),
),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
padding: const EdgeInsets.all(8.0),
child: ChartTimelineCardContent(
daysCount: daysCount,
chartData: snapshot.hasData
......
......@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none'
version: 0.0.20+20
version: 0.0.21+21
environment:
sdk: '^3.0.0'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment