Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.1.2.6+1 #104

Merged
merged 32 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
558274b
Show external links for media (#86)
crxssed7 Jun 24, 2023
636f75b
Improved settings and horizontal chip lists
lotusprey Jul 15, 2023
3a6acca
Better button row on user pages and cleanup
lotusprey Jul 17, 2023
0e94bdc
Improved switcher widgets and other visual elements
lotusprey Jul 25, 2023
e7fd71b
Code cleanup and padding improvements
lotusprey Jul 26, 2023
746ec2c
Merge remote-tracking branch 'origin/master' into dev
lotusprey Jul 27, 2023
4bcf86b
Improved external link sorting, and bar chart sizing
lotusprey Jul 27, 2023
8ce285f
Added language identification on external media links
lotusprey Jul 29, 2023
dd4b37b
Fixed media external link sorting
lotusprey Jul 29, 2023
f6ace81
Maintenance
lotusprey Aug 19, 2023
30b3416
Reorganised discover logic
lotusprey Aug 19, 2023
237d9e1
Modified searching logic
lotusprey Aug 21, 2023
f5edcdc
Added site links to character/staff/studio pages
lotusprey Aug 21, 2023
fbfb744
Fixed notification icon and feed badge
lotusprey Aug 22, 2023
3edd1eb
Changed handling of certain padding
lotusprey Aug 23, 2023
5dad1ba
Fixed padding and bottom bar layouts
lotusprey Aug 25, 2023
4a19a2d
Updated versioning
lotusprey Aug 26, 2023
7d4f0b6
Fixed settings spacing
lotusprey Aug 26, 2023
12005d1
Updated screenshots
lotusprey Aug 29, 2023
9d958c7
Updated dependencies and fixed visual/lazy-loading bugs
lotusprey Sep 10, 2023
ef83d41
Fixed activity page padding
lotusprey Sep 12, 2023
6ad2821
Fixed and restructuring
lotusprey Sep 26, 2023
4d2ddca
Finished calendar and restructured some files
lotusprey Oct 1, 2023
f5a1e62
Pure theme option now not only makes dark themes black, but light the…
lotusprey Oct 1, 2023
1f07ab4
Support more languages in the external links
lotusprey Oct 2, 2023
44d1c4a
Fastlane setup
lotusprey Oct 9, 2023
e8af8b6
Updated dependencies and other cleanup
lotusprey Oct 10, 2023
703c502
Versioning and calendar fixes
lotusprey Oct 13, 2023
edda57c
Fixed null exceptions
lotusprey Oct 14, 2023
fe01a0d
Calendar filters are cached
lotusprey Oct 14, 2023
7c79516
Made calendar date selection more flexible
lotusprey Oct 14, 2023
4a07284
Merge
lotusprey Oct 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/59.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Added calendar in discover to view and filter new episode schedules
- Option for pure background in settings now not only makes dark backgrounds black, but also light backgrounds white
- Fixed lazy-loading in "Following" on the media page
- Other fixes and improvements
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
An unofficial AniList client for Android and iOS.
You can view/track/explore anime/manga, interact with your feed and more.
Binary file added fastlane/metadata/android/en-US/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An unofficial AniList client for Android and iOS
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Otraku
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -439,7 +439,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -489,7 +489,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
2 changes: 1 addition & 1 deletion lib/common/utils/background_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BackgroundHandler {
AndroidFlutterLocalNotificationsPlugin>();
if (android == null) return true;

return await android.requestPermission() ?? true;
return await android.requestNotificationsPermission() ?? true;
}

/// Should be called, for example, when the user logs out of an account.
Expand Down
153 changes: 0 additions & 153 deletions lib/common/utils/convert.dart

This file was deleted.

144 changes: 144 additions & 0 deletions lib/common/utils/extensions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import 'package:flutter/material.dart';
import 'package:otraku/common/utils/options.dart';

extension StringUtil on String {
static String? codeToCountry(String? code) => switch (code) {
'JP' => 'Japan',
'CN' => 'China',
'KR' => 'South Korea',
'TW' => 'Taiwan',
_ => null,
};

static String? languageToCode(String? language) => switch (language) {
'Japanese' => 'JP',
'Chinese' => 'CN',
'Korean' => 'KR',
'French' => 'FR',
'Spanish' => 'ES',
'Italian' => 'IT',
'Portuguese' => 'PT',
'German' => 'DE',
_ => null,
};

static String? tryNoScreamingSnakeCase(dynamic str) =>
str is String ? str.noScreamingSnakeCase : null;

static final _ampersand = '&'.codeUnitAt(0);
static final _hashtag = '#'.codeUnitAt(0);
static final _semicolon = ';'.codeUnitAt(0);

/// AniList can't handle some unicode characters, so before uploading text,
/// symbols that are too big should be represented as HTML character entity
/// references. Important primarily for emojis, hence the name.
String get withParsedEmojis {
final parsedRunes = <int>[];
for (final c in runes.toList()) {
if (c > 0xFFFF) {
parsedRunes.addAll(
[_ampersand, _hashtag, ...c.toString().codeUnits, _semicolon],
);
} else {
parsedRunes.add(c);
}
}

return String.fromCharCodes(parsedRunes);
}

String get noScreamingSnakeCase => splitMapJoin(
'_',
onMatch: (_) => ' ',
onNonMatch: (s) => s[0].toUpperCase() + s.substring(1).toLowerCase(),
);
}

extension DateTimeUtil on DateTime {
int get secondsSinceEpoch => millisecondsSinceEpoch ~/ 1000;

static DateTime fromSecondsSinceEpoch(int seconds) =>
DateTime.fromMillisecondsSinceEpoch(seconds * 1000);

static DateTime? fromFuzzyDate(Map<String, dynamic>? map) {
if (map?['year'] == null) return null;
return DateTime(map!['year'], map['month'] ?? 0, map['day'] ?? 0);
}

static DateTime? tryFromSecondsSinceEpoch(int? seconds) =>
seconds != null ? fromSecondsSinceEpoch(seconds) : null;

static String tryFormattedDateTimeFromSeconds(int? seconds) {
if (seconds == null) return '';
return fromSecondsSinceEpoch(seconds).formattedDateTime;
}

Map<String, dynamic> get fuzzyDate =>
{'year': year, 'month': month, 'day': day};

String get formattedDateTime =>
'$formattedWeekday, $formattedDate, $formattedTime';

String get formattedWeekday => switch (weekday) {
1 => 'Mon',
2 => 'Tue',
3 => 'Wed',
4 => 'Thu',
5 => 'Fri',
6 => 'Sat',
_ => 'Sun',
};

String get formattedDate {
final monthName = switch (month) {
1 => 'Jan',
2 => 'Feb',
3 => 'Mar',
4 => 'Apr',
5 => 'May',
6 => 'Jun',
7 => 'Jul',
8 => 'Aug',
9 => 'Sep',
10 => 'Oct',
11 => 'Nov',
_ => 'Dec',
};
return '$day $monthName $year';
}

String get formattedTime {
if (Options().analogueClock) {
final (overflows, realHour) =
hour > 12 ? (true, hour - 12) : (false, hour);

return '${realHour < 10 ? 0 : ''}$realHour'
':${minute < 10 ? 0 : ''}$minute '
'${overflows ? 'PM' : 'AM'}';
}

return '${hour <= 9 ? 0 : ''}$hour'
':${minute <= 9 ? 0 : ''}$minute';
}

String get timeUntil {
int minutes = difference(DateTime.now()).inMinutes;
int hours = minutes ~/ 60;
minutes %= 60;
int days = hours ~/ 24;
hours %= 24;
return '${days < 1 ? "" : "${days}d "}'
'${hours < 1 ? "" : "${hours}h "}'
'${minutes < 1 ? "" : "${minutes}m"}';
}
}

extension ColorUtil on Color {
static Color? fromHexString(String src) {
try {
return Color(int.parse(src.substring(1, 7), radix: 16) + 0xFF000000);
} catch (_) {
return null;
}
}
}
Loading