Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • android/org.benoitharrault.scrobbles
1 result
Show changes
Commits on Source (2)
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.40 app.versionName=0.0.41
app.versionCode=40 app.versionCode=41
...@@ -27,9 +27,8 @@ ...@@ -27,9 +27,8 @@
"settings_title": "Settings", "settings_title": "Settings",
"settings_label_username": "Username: ", "settings_label_username": "Username: ",
"settings_label_security_token": "Security token: ", "settings_label_security_token": "Security token: ",
"settings_label_counts_by_day_days_count": "Counts by day: ",
"settings_label_counts_by_hour_days_count": "Counts by hour: ",
"settings_label_discoveries_days_count": "Discoveries: ", "settings_label_discoveries_days_count": "Discoveries: ",
"settings_label_distribution_days_count": "Distributions : ",
"settings_label_statistics_recent_days_count": "Recent statistics: ", "settings_label_statistics_recent_days_count": "Recent statistics: ",
"settings_label_timeline_days_count": "Timeline: ", "settings_label_timeline_days_count": "Timeline: ",
"settings_label_top_artists_days_count": "Top Artists: ", "settings_label_top_artists_days_count": "Top Artists: ",
......
...@@ -27,9 +27,8 @@ ...@@ -27,9 +27,8 @@
"settings_title": "Paramètres", "settings_title": "Paramètres",
"settings_label_username": "Utilisateur : ", "settings_label_username": "Utilisateur : ",
"settings_label_security_token": "Jeton de sécurité : ", "settings_label_security_token": "Jeton de sécurité : ",
"settings_label_counts_by_day_days_count": "Répartition par heure : ",
"settings_label_counts_by_hour_days_count": "Répartition par jour : ",
"settings_label_discoveries_days_count": "Découvertes : ", "settings_label_discoveries_days_count": "Découvertes : ",
"settings_label_distribution_days_count": "Répartitions : ",
"settings_label_statistics_recent_days_count": "Statistiques récentes : ", "settings_label_statistics_recent_days_count": "Statistiques récentes : ",
"settings_label_timeline_days_count": "Timeline : ", "settings_label_timeline_days_count": "Timeline : ",
"settings_label_top_artists_days_count": "Top Artistes : ", "settings_label_top_artists_days_count": "Top Artistes : ",
......
Merge settings for distribution charts.
Fusion des paramètres pour les graphiques de répartition.
...@@ -7,9 +7,8 @@ class DefaultSettings { ...@@ -7,9 +7,8 @@ class DefaultSettings {
60, 60,
90, 90,
]; ];
static const int defaultCountsByDayDaysCount = 21;
static const int defaultCountsByHourDaysCount = 21;
static const int defaultDiscoveriesDaysCount = 14; static const int defaultDiscoveriesDaysCount = 14;
static const int defaultDistributionDaysCount = 21;
static const int defaultStatisticsRecentDaysCount = 21; static const int defaultStatisticsRecentDaysCount = 21;
static const int defaultTimelineDaysCount = 14; static const int defaultTimelineDaysCount = 14;
static const int defaultTopArtistsDaysCount = 14; static const int defaultTopArtistsDaysCount = 14;
......
...@@ -17,18 +17,14 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -17,18 +17,14 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
return state.securityToken ?? ''; return state.securityToken ?? '';
} }
int getCountsByDayDaysCount() {
return state.countsByDayDaysCount ?? DefaultSettings.defaultCountsByDayDaysCount;
}
int getCountsByHourDaysCount() {
return state.countsByHourDaysCount ?? DefaultSettings.defaultCountsByHourDaysCount;
}
int getDiscoveriesDaysCount() { int getDiscoveriesDaysCount() {
return state.discoveriesDaysCount ?? DefaultSettings.defaultDiscoveriesDaysCount; return state.discoveriesDaysCount ?? DefaultSettings.defaultDiscoveriesDaysCount;
} }
int getDistributionDaysCount() {
return state.distributionDaysCount ?? DefaultSettings.defaultDistributionDaysCount;
}
int getStatisticsRecentDaysCount() { int getStatisticsRecentDaysCount() {
return state.statisticsRecentDaysCount ?? DefaultSettings.defaultStatisticsRecentDaysCount; return state.statisticsRecentDaysCount ?? DefaultSettings.defaultStatisticsRecentDaysCount;
} }
...@@ -44,9 +40,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -44,9 +40,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
void setValues({ void setValues({
String? username, String? username,
String? securityToken, String? securityToken,
int? countsByDayDaysCount,
int? countsByHourDaysCount,
int? discoveriesDaysCount, int? discoveriesDaysCount,
int? distributionDaysCount,
int? statisticsRecentDaysCount, int? statisticsRecentDaysCount,
int? timelineDaysCount, int? timelineDaysCount,
int? topArtistsDaysCount, int? topArtistsDaysCount,
...@@ -54,9 +49,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -54,9 +49,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
emit(SettingsState( emit(SettingsState(
username: username ?? state.username, username: username ?? state.username,
securityToken: securityToken ?? state.securityToken, securityToken: securityToken ?? state.securityToken,
countsByDayDaysCount: countsByDayDaysCount ?? state.countsByDayDaysCount,
countsByHourDaysCount: countsByHourDaysCount ?? state.countsByHourDaysCount,
discoveriesDaysCount: discoveriesDaysCount ?? state.discoveriesDaysCount, discoveriesDaysCount: discoveriesDaysCount ?? state.discoveriesDaysCount,
distributionDaysCount: distributionDaysCount ?? state.distributionDaysCount,
statisticsRecentDaysCount: statisticsRecentDaysCount ?? state.statisticsRecentDaysCount, statisticsRecentDaysCount: statisticsRecentDaysCount ?? state.statisticsRecentDaysCount,
timelineDaysCount: timelineDaysCount ?? state.timelineDaysCount, timelineDaysCount: timelineDaysCount ?? state.timelineDaysCount,
topArtistsDaysCount: topArtistsDaysCount ?? state.topArtistsDaysCount, topArtistsDaysCount: topArtistsDaysCount ?? state.topArtistsDaysCount,
...@@ -67,9 +61,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -67,9 +61,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
SettingsState? fromJson(Map<String, dynamic> json) { SettingsState? fromJson(Map<String, dynamic> json) {
String username = json['username'] as String; String username = json['username'] as String;
String securityToken = json['securityToken'] as String; String securityToken = json['securityToken'] as String;
int countsByDayDaysCount = json['countsByDayDaysCount'] as int;
int countsByHourDaysCount = json['countsByHourDaysCount'] as int;
int discoveriesDaysCount = json['discoveriesDaysCount'] as int; int discoveriesDaysCount = json['discoveriesDaysCount'] as int;
int distributionDaysCount = json['distributionDaysCount'] as int;
int statisticsRecentDaysCount = json['statisticsRecentDaysCount'] as int; int statisticsRecentDaysCount = json['statisticsRecentDaysCount'] as int;
int timelineDaysCount = json['timelineDaysCount'] as int; int timelineDaysCount = json['timelineDaysCount'] as int;
int topArtistsDaysCount = json['topArtistsDaysCount'] as int; int topArtistsDaysCount = json['topArtistsDaysCount'] as int;
...@@ -77,9 +70,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -77,9 +70,8 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
return SettingsState( return SettingsState(
username: username, username: username,
securityToken: securityToken, securityToken: securityToken,
countsByDayDaysCount: countsByDayDaysCount,
countsByHourDaysCount: countsByHourDaysCount,
discoveriesDaysCount: discoveriesDaysCount, discoveriesDaysCount: discoveriesDaysCount,
distributionDaysCount: distributionDaysCount,
statisticsRecentDaysCount: statisticsRecentDaysCount, statisticsRecentDaysCount: statisticsRecentDaysCount,
timelineDaysCount: timelineDaysCount, timelineDaysCount: timelineDaysCount,
topArtistsDaysCount: topArtistsDaysCount, topArtistsDaysCount: topArtistsDaysCount,
...@@ -91,12 +83,10 @@ class SettingsCubit extends HydratedCubit<SettingsState> { ...@@ -91,12 +83,10 @@ class SettingsCubit extends HydratedCubit<SettingsState> {
return <String, dynamic>{ return <String, dynamic>{
'username': state.username ?? '', 'username': state.username ?? '',
'securityToken': state.securityToken ?? '', 'securityToken': state.securityToken ?? '',
'countsByDayDaysCount':
state.countsByDayDaysCount ?? DefaultSettings.defaultCountsByDayDaysCount,
'countsByHourDaysCount':
state.countsByHourDaysCount ?? DefaultSettings.defaultCountsByHourDaysCount,
'discoveriesDaysCount': 'discoveriesDaysCount':
state.discoveriesDaysCount ?? DefaultSettings.defaultDiscoveriesDaysCount, state.discoveriesDaysCount ?? DefaultSettings.defaultDiscoveriesDaysCount,
'distributionDaysCount':
state.distributionDaysCount ?? DefaultSettings.defaultDistributionDaysCount,
'statisticsRecentDaysCount': 'statisticsRecentDaysCount':
state.statisticsRecentDaysCount ?? DefaultSettings.defaultStatisticsRecentDaysCount, state.statisticsRecentDaysCount ?? DefaultSettings.defaultStatisticsRecentDaysCount,
'timelineDaysCount': state.timelineDaysCount ?? DefaultSettings.defaultTimelineDaysCount, 'timelineDaysCount': state.timelineDaysCount ?? DefaultSettings.defaultTimelineDaysCount,
......
...@@ -5,9 +5,8 @@ class SettingsState extends Equatable { ...@@ -5,9 +5,8 @@ class SettingsState extends Equatable {
const SettingsState({ const SettingsState({
this.username, this.username,
this.securityToken, this.securityToken,
this.countsByDayDaysCount,
this.countsByHourDaysCount,
this.discoveriesDaysCount, this.discoveriesDaysCount,
this.distributionDaysCount,
this.statisticsRecentDaysCount, this.statisticsRecentDaysCount,
this.timelineDaysCount, this.timelineDaysCount,
this.topArtistsDaysCount, this.topArtistsDaysCount,
...@@ -15,9 +14,8 @@ class SettingsState extends Equatable { ...@@ -15,9 +14,8 @@ class SettingsState extends Equatable {
final String? username; final String? username;
final String? securityToken; final String? securityToken;
final int? countsByDayDaysCount;
final int? countsByHourDaysCount;
final int? discoveriesDaysCount; final int? discoveriesDaysCount;
final int? distributionDaysCount;
final int? statisticsRecentDaysCount; final int? statisticsRecentDaysCount;
final int? timelineDaysCount; final int? timelineDaysCount;
final int? topArtistsDaysCount; final int? topArtistsDaysCount;
...@@ -26,9 +24,8 @@ class SettingsState extends Equatable { ...@@ -26,9 +24,8 @@ class SettingsState extends Equatable {
List<dynamic> get props => <dynamic>[ List<dynamic> get props => <dynamic>[
username, username,
securityToken, securityToken,
countsByDayDaysCount,
countsByHourDaysCount,
discoveriesDaysCount, discoveriesDaysCount,
distributionDaysCount,
statisticsRecentDaysCount, statisticsRecentDaysCount,
timelineDaysCount, timelineDaysCount,
topArtistsDaysCount, topArtistsDaysCount,
...@@ -37,9 +34,8 @@ class SettingsState extends Equatable { ...@@ -37,9 +34,8 @@ class SettingsState extends Equatable {
Map<String, dynamic> get values => <String, dynamic>{ Map<String, dynamic> get values => <String, dynamic>{
'username': username, 'username': username,
'securityToken': securityToken, 'securityToken': securityToken,
'countsByDayDaysCount': countsByDayDaysCount,
'countsByHourDaysCount': countsByHourDaysCount,
'discoveriesDaysCount': discoveriesDaysCount, 'discoveriesDaysCount': discoveriesDaysCount,
'distributionDaysCount': distributionDaysCount,
'statisticsRecentDaysCount': statisticsRecentDaysCount, 'statisticsRecentDaysCount': statisticsRecentDaysCount,
'timelineDaysCount': timelineDaysCount, 'timelineDaysCount': timelineDaysCount,
'topArtistsDaysCount': topArtistsDaysCount, 'topArtistsDaysCount': topArtistsDaysCount,
......
...@@ -17,7 +17,7 @@ class CardCountsByDay extends StatelessWidget { ...@@ -17,7 +17,7 @@ class CardCountsByDay extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
SettingsCubit settings = BlocProvider.of<SettingsCubit>(context); SettingsCubit settings = BlocProvider.of<SettingsCubit>(context);
final int daysCount = settings.getCountsByDayDaysCount(); final int daysCount = settings.getDistributionDaysCount();
return BlocBuilder<DataCountsByDayCubit, DataCountsByDayState>( return BlocBuilder<DataCountsByDayCubit, DataCountsByDayState>(
builder: (BuildContext context, DataCountsByDayState state) { builder: (BuildContext context, DataCountsByDayState state) {
......
...@@ -17,7 +17,7 @@ class CardCountsByHour extends StatelessWidget { ...@@ -17,7 +17,7 @@ class CardCountsByHour extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
SettingsCubit settings = BlocProvider.of<SettingsCubit>(context); SettingsCubit settings = BlocProvider.of<SettingsCubit>(context);
final int daysCount = settings.getCountsByHourDaysCount(); final int daysCount = settings.getDistributionDaysCount();
return BlocBuilder<DataCountsByHourCubit, DataCountsByHourState>( return BlocBuilder<DataCountsByHourCubit, DataCountsByHourState>(
builder: (BuildContext context, DataCountsByHourState state) { builder: (BuildContext context, DataCountsByHourState state) {
......
...@@ -17,16 +17,14 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -17,16 +17,14 @@ class _SettingsFormState extends State<SettingsForm> {
final usernameController = TextEditingController(); final usernameController = TextEditingController();
final securityTokenController = TextEditingController(); final securityTokenController = TextEditingController();
int countsByDayDaysCount = DefaultSettings.defaultCountsByDayDaysCount;
int countsByHourDaysCount = DefaultSettings.defaultCountsByHourDaysCount;
int discoveriesDaysCount = DefaultSettings.defaultDiscoveriesDaysCount; int discoveriesDaysCount = DefaultSettings.defaultDiscoveriesDaysCount;
int distributionDaysCount = DefaultSettings.defaultDistributionDaysCount;
int statisticsRecentDaysCount = DefaultSettings.defaultStatisticsRecentDaysCount; int statisticsRecentDaysCount = DefaultSettings.defaultStatisticsRecentDaysCount;
int timelineDaysCount = DefaultSettings.defaultTimelineDaysCount; int timelineDaysCount = DefaultSettings.defaultTimelineDaysCount;
int topArtistsDaysCount = DefaultSettings.defaultTopArtistsDaysCount; int topArtistsDaysCount = DefaultSettings.defaultTopArtistsDaysCount;
List<bool> _selectedCountsByDayDaysCount = [];
List<bool> _selectedCountsByHourDaysCount = [];
List<bool> _selectedDiscoveriesDaysCount = []; List<bool> _selectedDiscoveriesDaysCount = [];
List<bool> _selectedDistributionDaysCount = [];
List<bool> _selectedStatisticsRecentDaysCount = []; List<bool> _selectedStatisticsRecentDaysCount = [];
List<bool> _selectedTimelineDaysCount = []; List<bool> _selectedTimelineDaysCount = [];
List<bool> _selectedTopArtistsDaysCount = []; List<bool> _selectedTopArtistsDaysCount = [];
...@@ -38,19 +36,16 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -38,19 +36,16 @@ class _SettingsFormState extends State<SettingsForm> {
usernameController.text = settings.getUsername(); usernameController.text = settings.getUsername();
securityTokenController.text = settings.getSecurityToken(); securityTokenController.text = settings.getSecurityToken();
countsByDayDaysCount = settings.getCountsByDayDaysCount();
countsByHourDaysCount = settings.getCountsByHourDaysCount();
discoveriesDaysCount = settings.getDiscoveriesDaysCount(); discoveriesDaysCount = settings.getDiscoveriesDaysCount();
distributionDaysCount = settings.getDistributionDaysCount();
statisticsRecentDaysCount = settings.getStatisticsRecentDaysCount(); statisticsRecentDaysCount = settings.getStatisticsRecentDaysCount();
timelineDaysCount = settings.getTimelineDaysCount(); timelineDaysCount = settings.getTimelineDaysCount();
topArtistsDaysCount = settings.getTopArtistsDaysCount(); topArtistsDaysCount = settings.getTopArtistsDaysCount();
_selectedCountsByDayDaysCount =
DefaultSettings.allowedValues.map((e) => (e == countsByDayDaysCount)).toList();
_selectedCountsByHourDaysCount =
DefaultSettings.allowedValues.map((e) => (e == countsByHourDaysCount)).toList();
_selectedDiscoveriesDaysCount = _selectedDiscoveriesDaysCount =
DefaultSettings.allowedValues.map((e) => (e == discoveriesDaysCount)).toList(); DefaultSettings.allowedValues.map((e) => (e == discoveriesDaysCount)).toList();
_selectedDistributionDaysCount =
DefaultSettings.allowedValues.map((e) => (e == distributionDaysCount)).toList();
_selectedStatisticsRecentDaysCount = _selectedStatisticsRecentDaysCount =
DefaultSettings.allowedValues.map((e) => (e == statisticsRecentDaysCount)).toList(); DefaultSettings.allowedValues.map((e) => (e == statisticsRecentDaysCount)).toList();
_selectedTimelineDaysCount = _selectedTimelineDaysCount =
...@@ -74,9 +69,8 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -74,9 +69,8 @@ class _SettingsFormState extends State<SettingsForm> {
BlocProvider.of<SettingsCubit>(context).setValues( BlocProvider.of<SettingsCubit>(context).setValues(
username: usernameController.text, username: usernameController.text,
securityToken: securityTokenController.text, securityToken: securityTokenController.text,
countsByDayDaysCount: countsByDayDaysCount,
countsByHourDaysCount: countsByHourDaysCount,
discoveriesDaysCount: discoveriesDaysCount, discoveriesDaysCount: discoveriesDaysCount,
distributionDaysCount: distributionDaysCount,
statisticsRecentDaysCount: statisticsRecentDaysCount, statisticsRecentDaysCount: statisticsRecentDaysCount,
timelineDaysCount: timelineDaysCount, timelineDaysCount: timelineDaysCount,
topArtistsDaysCount: topArtistsDaysCount, topArtistsDaysCount: topArtistsDaysCount,
...@@ -108,70 +102,47 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -108,70 +102,47 @@ class _SettingsFormState extends State<SettingsForm> {
// ), // ),
// SizedBox(height: 20), // SizedBox(height: 20),
// Counts by day // Discoveries
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('settings_label_counts_by_day_days_count').tr(),
ToggleButtons(
onPressed: (int index) {
setState(() {
countsByDayDaysCount = DefaultSettings.allowedValues[index];
for (int i = 0; i < _selectedCountsByDayDaysCount.length; i++) {
_selectedCountsByDayDaysCount[i] = i == index;
}
});
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
isSelected: _selectedCountsByDayDaysCount,
children: DefaultSettings.allowedValues.map((e) => Text(e.toString())).toList(),
),
],
),
// Counts by hour
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_counts_by_hour_days_count').tr(), Text('settings_label_discoveries_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
countsByHourDaysCount = DefaultSettings.allowedValues[index]; discoveriesDaysCount = DefaultSettings.allowedValues[index];
for (int i = 0; i < _selectedCountsByHourDaysCount.length; i++) { for (int i = 0; i < _selectedDiscoveriesDaysCount.length; i++) {
_selectedCountsByHourDaysCount[i] = i == index; _selectedDiscoveriesDaysCount[i] = i == index;
} }
}); });
}, },
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0), constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
isSelected: _selectedCountsByHourDaysCount, isSelected: _selectedDiscoveriesDaysCount,
children: DefaultSettings.allowedValues.map((e) => Text(e.toString())).toList(), children: DefaultSettings.allowedValues.map((e) => Text(e.toString())).toList(),
), ),
], ],
), ),
// Discoveries // Distribution by day/hour + heatmap
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_discoveries_days_count').tr(), Text('settings_label_distribution_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
discoveriesDaysCount = DefaultSettings.allowedValues[index]; distributionDaysCount = DefaultSettings.allowedValues[index];
for (int i = 0; i < _selectedDiscoveriesDaysCount.length; i++) { for (int i = 0; i < _selectedDistributionDaysCount.length; i++) {
_selectedDiscoveriesDaysCount[i] = i == index; _selectedDistributionDaysCount[i] = i == index;
} }
}); });
}, },
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0), constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
isSelected: _selectedDiscoveriesDaysCount, isSelected: _selectedDistributionDaysCount,
children: DefaultSettings.allowedValues.map((e) => Text(e.toString())).toList(), children: DefaultSettings.allowedValues.map((e) => Text(e.toString())).toList(),
), ),
], ],
......
...@@ -3,7 +3,7 @@ description: Display scrobbles data and charts ...@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none' publish_to: 'none'
version: 0.0.40+40 version: 0.0.41+41
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
......