Skip to content

Commit

Permalink
v.1.2.5 (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
lotusprey committed Aug 29, 2023
1 parent 24a6ff9 commit 87d3fc4
Show file tree
Hide file tree
Showing 68 changed files with 2,677 additions and 2,761 deletions.
16 changes: 13 additions & 3 deletions README.md
Expand Up @@ -13,9 +13,19 @@ The iOS .ipa and the android .apk are bundled with each Github release.
</p>

<details><p align='center'>
<summary>Screenshots (Old. New ones coming soon)</summary>
<summary>Screenshots</summary>

<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/b6d04e69-e0ae-4b4d-b9bb-621b85b6f220'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/62cf5d01-43cd-4aba-a292-1bf08e7500b6'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/63e50f2e-30ca-4e36-8ed0-0d34048060b7'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/692c6bf8-a5c0-41bf-8bc4-4ce16909550a'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/a68aac0e-7f2a-4ae0-b0d5-d06d6f485f87'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/40d47bfc-a0eb-43fa-be70-21aa8ae59122'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/560d8261-a206-4403-87e3-2207bdbb1c23'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/7fcfd048-80c2-472f-a833-548ea6b7fafe'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/c8ab401e-1098-4e69-992b-1d6bc3513ddd'>
<img width=18% src='https://github.com/lotusprey/otraku/assets/35681808/5bcd8eff-2cd7-4f35-90a3-145156a83e2a'>

<img width=16% src='https://user-images.githubusercontent.com/35681808/127747012-ed233f01-2cf7-4bcb-b812-e0f934359d13.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747055-063b5454-af1c-456b-a4e4-37a3cdb26dec.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747071-50aad5d5-19a6-4f47-8d10-84b45b1fded9.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747090-f9ba3c00-afd8-4e10-acb7-dc91fe2c5d62.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747103-c7d5793c-ac09-4ed7-8f33-8aaa5fd7b002.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747119-bf8930d7-1250-494d-beab-406d8333f9eb.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747125-99f966e7-c8fe-4b52-a6a0-05509f8b2087.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747126-95cad82e-b548-4445-b834-084265fe89d6.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747128-1fb62fee-82ae-417d-a46b-3aba685d0b59.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747130-94ad6117-2be4-4835-8a7d-dacb51a45d84.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747132-e11afe34-45de-4374-a21e-13f956aff658.png'><img width=16% src='https://user-images.githubusercontent.com/35681808/127747135-081490fc-7ba8-48d5-90ba-6af283d042c7.png'>
</p></details>
</br>
<details><summary>Building for ios</summary>
Expand All @@ -24,4 +34,4 @@ The iOS .ipa and the android .apk are bundled with each Github release.
2. In the `build` directory, open package contents and go into `Products/Applications`
3. Copy the `.app` file into a `Payload` folder
4. Compress the `Payload` folder and change the extension to `.ipa`
</details>
</details>
4 changes: 2 additions & 2 deletions android/app/build.gradle
Expand Up @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 33
compileSdkVersion 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,7 +45,7 @@ android {
defaultConfig {
applicationId "com.otraku.app"
minSdkVersion 26
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Expand Up @@ -58,7 +58,7 @@ SPEC CHECKSUMS:
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6
Expand Down
4 changes: 2 additions & 2 deletions ios/Runner.xcodeproj/project.pbxproj
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -163,7 +163,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 0 additions & 1 deletion lib/common/utils/background_handler.dart
Expand Up @@ -238,7 +238,6 @@ void _fetch() => Workmanager().executeTask((_, __) async {
notification.type.name,
notification.type.text,
channelDescription: notification.type.text,
color: const Color(0xFF45A0F2),
),
),
payload: payload,
Expand Down
5 changes: 4 additions & 1 deletion lib/common/utils/graphql.dart
Expand Up @@ -82,6 +82,7 @@ abstract class GqlQuery {
siteUrl
rankings {rank type year season allTime}
stats {scoreDistribution {score amount} statusDistribution {status amount}}
externalLinks {url site type color language}
relations {
edges {
relationType(version: 2)
Expand Down Expand Up @@ -259,6 +260,7 @@ abstract class GqlQuery {
age
favourites
isFavourite
siteUrl
}
fragment media on MediaConnection {
pageInfo {hasNextPage}
Expand Down Expand Up @@ -332,6 +334,7 @@ abstract class GqlQuery {
homeTown
favourites
isFavourite
siteUrl
}
''';

Expand Down Expand Up @@ -363,7 +366,7 @@ abstract class GqlQuery {
}
}
}
fragment info on Studio {id name favourites isFavourite}
fragment info on Studio {id name favourites isFavourite siteUrl}
''';

static const studios = r'''
Expand Down
2 changes: 1 addition & 1 deletion lib/common/utils/options.dart
Expand Up @@ -8,7 +8,7 @@ import 'package:otraku/common/utils/theming.dart';
import 'package:path_provider/path_provider.dart';

/// Current app version.
const versionCode = '1.2.4+1';
const versionCode = '1.2.5';

/// General options keys.
enum _OptionKey {
Expand Down
5 changes: 4 additions & 1 deletion lib/common/utils/theming.dart
Expand Up @@ -41,7 +41,7 @@ ThemeData themeDataFrom(ColorScheme scheme) => ThemeData(
size: Consts.iconBig,
),
navigationBarTheme: NavigationBarThemeData(
backgroundColor: scheme.background.withAlpha(190),
backgroundColor: scheme.surface.withAlpha(190),
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
),
elevatedButtonTheme: ElevatedButtonThemeData(
Expand All @@ -57,6 +57,9 @@ ThemeData themeDataFrom(ColorScheme scheme) => ThemeData(
fontWeight: FontWeight.normal,
),
),
segmentedButtonTheme: const SegmentedButtonThemeData(
style: ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap),
),
typography: Typography.material2014(),
textTheme: TextTheme(
titleLarge: TextStyle(
Expand Down
87 changes: 44 additions & 43 deletions lib/common/widgets/fields/search_field.dart
@@ -1,41 +1,44 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:ionicons/ionicons.dart';
import 'package:otraku/common/utils/consts.dart';

/// After [_delay] time has passed, since the last [run] call, call [callback].
/// E.g. do a search query after the user stops typing.
class Debounce {
static const _delay = Duration(milliseconds: 600);

Timer? _timer;

void cancel() => _timer?.cancel();

void run(void Function() callback) {
_timer?.cancel();
_timer = Timer(_delay, callback);
}
}

class SearchField extends StatefulWidget {
const SearchField({
required this.hint,
required this.onChange,
required this.value,
this.onHide,
required this.hint,
required this.onChanged,
this.focusNode,
this.debounce,
});

final String value;
final String hint;
final void Function(String) onChange;
final void Function()? onHide;
final void Function(String) onChanged;
final FocusNode? focusNode;
final Debounce? debounce;

@override
State<SearchField> createState() => _SearchFieldState();
}

class _SearchFieldState extends State<SearchField> {
late final TextEditingController _ctrl = TextEditingController(
text: widget.value,
);
late bool _empty = _ctrl.text.isEmpty;
FocusNode? _focus;

@override
void initState() {
super.initState();
if (widget.onHide != null && _empty) {
_focus = FocusNode();
WidgetsBinding.instance.addPostFrameCallback(
(_) => _focus!.requestFocus(),
);
}
}
late final _ctrl = TextEditingController(text: widget.value);

@override
void didUpdateWidget(covariant SearchField oldWidget) {
Expand All @@ -53,16 +56,29 @@ class _SearchFieldState extends State<SearchField> {
Widget build(BuildContext context) {
return TextField(
controller: _ctrl,
focusNode: _focus,
focusNode: widget.focusNode,
style: Theme.of(context).textTheme.bodyMedium,
onChanged: (val) {
if (val.isEmpty) {
widget.debounce?.cancel();
widget.onChanged('');
return;
}

if (widget.debounce != null) {
widget.debounce!.run(() => widget.onChanged(val));
} else {
widget.onChanged(val);
}
},
decoration: InputDecoration(
isDense: false,
hintText: widget.hint,
filled: true,
fillColor: Theme.of(context).colorScheme.surfaceVariant,
contentPadding: const EdgeInsets.only(left: 15),
constraints: const BoxConstraints(minHeight: 35, maxHeight: 35),
suffixIcon: !_empty
constraints: const BoxConstraints(minHeight: 35, maxHeight: 40),
suffixIcon: _ctrl.text.isNotEmpty
? IconButton(
tooltip: 'Clear',
iconSize: Consts.iconSmall,
Expand All @@ -71,27 +87,12 @@ class _SearchFieldState extends State<SearchField> {
padding: const EdgeInsets.all(0),
onPressed: () {
_ctrl.clear();
widget.onChange('');
setState(() => _empty = true);
widget.debounce?.cancel();
widget.onChanged('');
},
)
: widget.onHide != null
? IconButton(
tooltip: 'Hide',
iconSize: Consts.iconSmall,
icon: const Icon(Ionicons.chevron_forward_outline),
color: Theme.of(context).colorScheme.onBackground,
padding: const EdgeInsets.all(0),
onPressed: widget.onHide,
)
: null,
: null,
),
onChanged: (val) {
widget.onChange(val);
if (_empty != _ctrl.text.isEmpty) {
setState(() => _empty = _ctrl.text.isEmpty);
}
},
);
}
}

0 comments on commit 87d3fc4

Please sign in to comment.