Skip to content

Commit b17a3b0

Browse files
committed
stay compressed, mr.APK! (use legacy compression) and more
- added range slider in genres page - changed navigation rail selected icon color to onAccent - minor ui tweak in accounts page - fix ugly paddings in player setting page - had to make the pink less hot cus of the attention she was drawing 😔
1 parent d58154e commit b17a3b0

File tree

11 files changed

+110
-55
lines changed

11 files changed

+110
-55
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
android:label="animestream"
1212
android:name="${applicationName}"
1313
android:icon="@mipmap/ic_launcher"
14+
android:extractNativeLibs="true"
1415
android:requestLegacyExternalStorage="true"
1516
android:allowBackup="false">
1617
<activity

lib/core/anime/providers/aniplay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class AniPlay extends AnimeProvider {
6969
}
7070

7171
//choosing this since the quality is changeable in the default
72-
final stream = parsed!.where((element) => element['quality'] == "default").firstOrNull;
72+
final stream = parsed.where((element) => element['quality'] == "default").firstOrNull;
7373
if (stream != null) {
7474
serversFetched++;
7575
update([

lib/core/database/anilist/queries.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class AnilistQueries {
270270
// return genrePopular;
271271
// }
272272

273-
Future<List<AnimeCardData>> getAnimesWithGenresAndTags(List<String> genres, List<String> tags, {int page = 1}) async {
273+
Future<List<AnimeCardData>> getAnimesWithGenresAndTags(List<String> genres, List<String> tags, {int page = 1, int ratingLow = 0, int ratingHigh = 10}) async {
274274
String genreString = "";
275275
String tagString = "";
276276
if (genres.isNotEmpty) {
@@ -281,7 +281,8 @@ class AnilistQueries {
281281
}
282282

283283
final query =
284-
"""{ Page(perPage: 30, page: $page){media(${genreString.isNotEmpty ? "${genreString}," : ''} ${tagString.isNotEmpty ? "${tagString}," : ''} sort: TRENDING_DESC, type: ANIME, countryOfOrigin:"JP") { id coverImage { large } title { english romaji } status averageScore } } }""";
284+
"""{ Page(perPage: 30, page: $page){media(${genreString.isNotEmpty ? "${genreString}," : ''} ${tagString.isNotEmpty ? "${tagString}," : ''} \
285+
sort: TRENDING_DESC, type: ANIME, countryOfOrigin:"JP", averageScore_lesser: ${ratingHigh * 10}, averageScore_greater: ${ratingLow * 10}) { id coverImage { large } title { english romaji } status averageScore } } }""";
285286
final res = await Anilist().fetchQuery(query, RequestType.media);
286287
List<AnimeCardData> results = [];
287288
for (final item in res) {

lib/ui/models/customControls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class _ControlsState extends State<Controls> {
8484

8585
int selectedQuality = 0;
8686
int? skipDuration = currentUserSettings?.skipDuration ?? 10;
87-
int? megaSkipDuration = currentUserSettings?.skipDuration ?? 85;
87+
int? megaSkipDuration = currentUserSettings?.megaSkipDuration ?? 85;
8888

8989
bool buffering = false;
9090
bool finalEpisodeReached = false;

lib/ui/pages/genres.dart

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class _GenresPageState extends State<GenresPage> {
2121
}
2222

2323
void scrollListener() async {
24-
if (_scrollController.position.pixels >= _scrollController.position.maxScrollExtent * 0.9) {
24+
//fetch more when scroll space is less than 300px
25+
if (_scrollController.position.pixels >= _scrollController.position.maxScrollExtent - 300) {
2526
if (!_isLazyLoading) {
2627
print("loading...");
2728
getList(lazyLoaded: true);
@@ -45,8 +46,13 @@ class _GenresPageState extends State<GenresPage> {
4546
return;
4647
}
4748
print("loading page $currentLoadedPage");
48-
final res =
49-
await AnilistQueries().getAnimesWithGenresAndTags(selectedGenres, selectedTags, page: currentLoadedPage);
49+
final res = await AnilistQueries().getAnimesWithGenresAndTags(
50+
selectedGenres,
51+
selectedTags,
52+
page: currentLoadedPage,
53+
ratingHigh: ratingRange.end.toInt(),
54+
ratingLow: ratingRange.start.toInt(),
55+
);
5056
res.forEach((e) {
5157
searchResultsAsWidgets.add(
5258
Cards(context: context).animeCard(
@@ -74,6 +80,8 @@ class _GenresPageState extends State<GenresPage> {
7480
List<String> selectedGenres = [];
7581
List<String> selectedTags = [];
7682

83+
RangeValues ratingRange = RangeValues(1, 10);
84+
7785
List<Card> searchResultsAsWidgets = [];
7886

7987
int currentLoadedPage = 1;
@@ -105,7 +113,10 @@ class _GenresPageState extends State<GenresPage> {
105113
child: Text(
106114
"Results",
107115
style: TextStyle(
108-
color: appTheme.textMainColor, fontFamily: "NotoSans", fontSize: 22, fontWeight: FontWeight.bold),
116+
color: appTheme.textMainColor,
117+
fontFamily: "NotoSans",
118+
fontSize: 22,
119+
fontWeight: FontWeight.bold),
109120
),
110121
),
111122
ElevatedButton(
@@ -135,6 +146,20 @@ class _GenresPageState extends State<GenresPage> {
135146
title: "Genres", mainList: genres, selectedList: selectedGenres),
136147
_scrollablelListWithTitle(setChildState,
137148
title: "Tags", mainList: tags, selectedList: selectedTags),
149+
_filterItemTitle("Rating range"),
150+
RangeSlider(
151+
values: ratingRange,
152+
min: 1,
153+
max: 10,
154+
divisions: 9,
155+
activeColor: appTheme.accentColor,
156+
labels: RangeLabels(ratingRange.start.toString(), ratingRange.end.toString()),
157+
onChanged: (rv) {
158+
setChildState(() {
159+
ratingRange = RangeValues(rv.start.roundToDouble(), rv.end.roundToDouble());
160+
});
161+
},
162+
),
138163
Container(
139164
margin: EdgeInsets.only(top: 25),
140165
child: Row(
@@ -217,11 +242,13 @@ class _GenresPageState extends State<GenresPage> {
217242
children: [
218243
GridView.builder(
219244
physics: NeverScrollableScrollPhysics(),
220-
padding: EdgeInsets.zero,
221-
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
222-
crossAxisCount: MediaQuery.of(context).orientation == Orientation.portrait ? 3 : 6,
245+
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
246+
maxCrossAxisExtent: 140,
247+
mainAxisExtent: 230,
248+
// crossAxisCount: MediaQuery.of(context).orientation == Orientation.portrait ? 3 : 6,
223249
childAspectRatio: 120 / 220,
224250
mainAxisSpacing: 10),
251+
padding: EdgeInsets.only(top: 20, bottom: MediaQuery.of(context).padding.bottom),
225252
shrinkWrap: true,
226253
itemCount: searchResultsAsWidgets.length,
227254
itemBuilder: (context, index) => Container(
@@ -247,6 +274,22 @@ class _GenresPageState extends State<GenresPage> {
247274
);
248275
}
249276

277+
Container _filterItemTitle(String title) {
278+
return Container(
279+
padding: const EdgeInsets.only(bottom: 15, top: 20, left: 20),
280+
alignment: Alignment.centerLeft,
281+
child: Text(
282+
title,
283+
style: TextStyle(
284+
color: appTheme.textMainColor,
285+
fontFamily: "Rubik",
286+
fontSize: 18,
287+
fontWeight: FontWeight.bold,
288+
),
289+
),
290+
);
291+
}
292+
250293
Column _scrollablelListWithTitle(StateSetter setChildState,
251294
{required String title, required List<String> mainList, required List<String> selectedList}) {
252295
return Column(
@@ -290,7 +333,7 @@ class _GenresPageState extends State<GenresPage> {
290333
controller: _tagsScrollController,
291334
interactive: true,
292335
child: GridView(
293-
controller: _tagsScrollController,
336+
controller: _tagsScrollController,
294337
shrinkWrap: true,
295338
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
296339
crossAxisCount: 2,
@@ -314,12 +357,16 @@ class _GenresPageState extends State<GenresPage> {
314357
height: 40,
315358
alignment: Alignment.center,
316359
decoration: BoxDecoration(
317-
color: selectedList.contains(e) ? appTheme.accentColor : appTheme.backgroundSubColor,
360+
color: selectedList.contains(e)
361+
? appTheme.accentColor
362+
: appTheme.backgroundSubColor,
318363
borderRadius: BorderRadius.circular(13)),
319364
child: Text(
320365
e,
321366
style: TextStyle(
322-
color: selectedList.contains(e) ? appTheme.backgroundColor : appTheme.textMainColor,
367+
color: selectedList.contains(e)
368+
? appTheme.backgroundColor
369+
: appTheme.textMainColor,
323370
fontFamily: "NotoSans",
324371
fontWeight: FontWeight.bold),
325372
),

lib/ui/pages/mainNav.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,20 @@ class MainNavigatorState extends State<MainNavigator> with TickerProviderStateMi
348348
NavigationRailDestination(
349349
icon: Icon(
350350
Icons.home,
351-
color: tabController.index == 0 ? appTheme.backgroundSubColor : appTheme.textMainColor,
351+
color: tabController.index == 0 ? appTheme.onAccent : appTheme.textMainColor,
352352
),
353353
label: Text("Home"),
354354
),
355355
NavigationRailDestination(
356356
icon: ImageIcon(
357-
color: tabController.index == 1 ? appTheme.backgroundSubColor : appTheme.textMainColor,
357+
color: tabController.index == 1 ? appTheme.onAccent : appTheme.textMainColor,
358358
AssetImage("lib/assets/images/shines.png"),
359359
),
360360
label: Text("Discover"),
361361
),
362362
NavigationRailDestination(
363363
icon: Icon(Icons.search_rounded,
364-
color: tabController.index == 2 ? appTheme.backgroundSubColor : appTheme.textMainColor),
364+
color: tabController.index == 2 ? appTheme.onAccent : appTheme.textMainColor),
365365
label: Text("Search"),
366366
),
367367
],

lib/ui/pages/settingPages/account.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,18 @@ class _AccountSettingState extends State<AccountSetting> {
305305
height: 150,
306306
decoration: BoxDecoration(
307307
borderRadius: BorderRadius.circular(25),
308-
color: appTheme.textSubColor,
309308
image: DecorationImage(
310309
image: usermodal?.banner != null
311310
? NetworkImage(usermodal!.banner!)
312311
: AssetImage('lib/assets/images/profile_banner.jpg') //such a nice image!
313312
as ImageProvider,
314313
fit: BoxFit.cover,
315-
opacity: 0.65,
314+
opacity: 0.75,
316315
),
317316
),
318317
// alignment: Alignment.bottomCenter,
319318
child: BackdropFilter(
320-
filter: ImageFilter.blur(sigmaX: 2, sigmaY: 2),
319+
filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
321320
child: Row(
322321
mainAxisAlignment: MainAxisAlignment.center,
323322
children: [
@@ -344,7 +343,7 @@ class _AccountSettingState extends State<AccountSetting> {
344343
ElevatedButton(
345344
onPressed: onLogout,
346345
style: ElevatedButton.styleFrom(
347-
backgroundColor: Colors.transparent,
346+
backgroundColor: Colors.transparent.withAlpha(50),
348347
shape: RoundedRectangleBorder(
349348
side: BorderSide(color: appTheme.accentColor),
350349
borderRadius: BorderRadius.circular(
@@ -355,7 +354,7 @@ class _AccountSettingState extends State<AccountSetting> {
355354
child: Text(
356355
"Logout",
357356
style: TextStyle(
358-
color: appTheme.accentColor,
357+
color: Colors.white,
359358
fontFamily: "NotoSans",
360359
fontWeight: FontWeight.bold,
361360
),

lib/ui/pages/settingPages/common.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,21 @@ Widget settingPagesTitleHeader(BuildContext context, String title) {
9090
);
9191
}
9292

93-
InkWell toggleItem(String label, bool value, void Function() onTapFunction, {String? description = null, bool applySidePadding = true,}) {
93+
InkWell toggleItem(
94+
String label,
95+
bool value,
96+
void Function() onTapFunction, {
97+
String? description = null,
98+
}) {
9499
return InkWell(
95100
onTap: onTapFunction,
96101
child: Container(
97-
padding: EdgeInsets.only(top: 10, bottom: 10, left: applySidePadding ? 10 : 0, right: applySidePadding ? 10 : 0) ,
102+
padding: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10),
98103
child: Container(
99-
padding: applySidePadding ? EdgeInsets.only(
104+
padding: EdgeInsets.only(
100105
left: 10,
101106
right: 10,
102-
) : null,
107+
),
103108
child: Row(
104109
mainAxisAlignment: MainAxisAlignment.spaceBetween,
105110
children: [

lib/ui/pages/settingPages/player.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class PlayerSettingState extends State<PlayerSetting> {
6767
children: [
6868
settingPagesTitleHeader(context, "Player"),
6969
Container(
70-
padding: EdgeInsets.only(left: 20, right: 20, top: 0),
70+
// padding: EdgeInsets.only(left: 20, right: 20, top: 0),
7171
child: Column(
7272
crossAxisAlignment: CrossAxisAlignment.start,
7373
children: [
@@ -212,7 +212,8 @@ class PlayerSettingState extends State<PlayerSetting> {
212212
),
213213
InkWell(
214214
onTap: () {
215-
Navigator.of(context).push(MaterialPageRoute(builder: (context) => SubtitleSettingPage()));
215+
Navigator.of(context)
216+
.push(MaterialPageRoute(builder: (context) => SubtitleSettingPage()));
216217
},
217218
child: item(
218219
// padding: EdgeInsets.only(top: 10, bottom: 10),
@@ -237,7 +238,8 @@ class PlayerSettingState extends State<PlayerSetting> {
237238
),
238239
),
239240
),
240-
toggleItem("Enable super speeds", enableSuperSpeeds, applySidePadding: false,() {
241+
toggleItem("Enable super speeds", enableSuperSpeeds,
242+
description: "Enable extra player speeds", () {
241243
enableSuperSpeeds = !enableSuperSpeeds;
242244
writeSettings(SettingsModal(enableSuperSpeeds: enableSuperSpeeds));
243245
})
@@ -254,7 +256,7 @@ class PlayerSettingState extends State<PlayerSetting> {
254256

255257
Container item({required Widget child}) {
256258
return Container(
257-
padding: EdgeInsets.only(top: 15, bottom: 15),
259+
padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
258260
child: child,
259261
);
260262
}

0 commit comments

Comments
 (0)