Skip to content

Commit

Permalink
🔖 v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
iota9star committed Sep 3, 2023
1 parent 8f5b284 commit df6e3f7
Show file tree
Hide file tree
Showing 17 changed files with 614 additions and 399 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
```
3 changes: 2 additions & 1 deletion android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<item android:drawable="@android:color/white"/>

<!-- You can insert your own image assets here -->
<item>
<item android:width="120dp"
android:gravity="center">
<bitmap
android:gravity="center"
android:src="@drawable/ic_mikan"/>
Expand Down
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
DEVELOPMENT_TEAM = CHR83T9WY5;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MikanProject;
INFOPLIST_KEY_CFBundleDisplayName = "蜜柑计划";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -521,7 +521,7 @@
DEVELOPMENT_TEAM = CHR83T9WY5;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MikanProject;
INFOPLIST_KEY_CFBundleDisplayName = "蜜柑计划";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -546,7 +546,7 @@
DEVELOPMENT_TEAM = CHR83T9WY5;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MikanProject;
INFOPLIST_KEY_CFBundleDisplayName = "蜜柑计划";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
4 changes: 2 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>MikanProject</string>
<string>蜜柑计划</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MikanProject</string>
<string>蜜柑计划</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
112 changes: 0 additions & 112 deletions lib/ui/components/ova_record_item.dart

This file was deleted.

75 changes: 25 additions & 50 deletions lib/ui/fragments/bangumi_cover_scroll_list.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:waterfall_flow/waterfall_flow.dart';

import '../../internal/image_provider.dart';
import '../../internal/kit.dart';
import '../../model/bangumi_row.dart';
import '../../providers/index_model.dart';
import '../../topvars.dart';
import 'sliver_bangumi_list.dart';

class BangumiCoverScrollListFragment extends StatefulWidget {
const BangumiCoverScrollListFragment({super.key});
Expand All @@ -14,45 +16,8 @@ class BangumiCoverScrollListFragment extends StatefulWidget {
State<StatefulWidget> createState() => _BangumiCoverScrollListFragmentState();
}

const _kRate = 60;
const _kScrollOffset = 360;
const _kScrollDuration =
Duration(milliseconds: 1000 ~/ _kRate * _kScrollOffset);

class _BangumiCoverScrollListFragmentState
extends State<BangumiCoverScrollListFragment> {
final ScrollController _scrollController = ScrollController();

bool _animating = false;

@override
void initState() {
super.initState();
WidgetsBinding.instance.addPersistentFrameCallback((_) {
if (_animating) {
return;
}
if (_scrollController.hasClients) {
_animating = true;
_scrollController
.animateTo(
_scrollController.offset + _kScrollOffset,
duration: _kScrollDuration,
curve: Curves.linear,
)
.whenComplete(() {
_animating = false;
});
}
});
}

@override
void dispose() {
_scrollController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
Expand All @@ -69,28 +34,38 @@ class _BangumiCoverScrollListFragmentState
final bangumis = bangumiRows
.map((e) => e.bangumis)
.expand((e) => e)
.toList(growable: false);
bangumis.sort((a, b) => a.id.compareTo(b.id));
.sortedBy((e) => e.id);
final length = bangumis.length;
if (length == 0) {
return sizedBox;
}
return WaterfallFlow.builder(
controller: _scrollController,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 320.0,
crossAxisSpacing: 24.0,
mainAxisSpacing: 24.0,
const maxCrossAxisExtent = 120.0;
const spacing = 8.0;
final size = calcGridItemSizeWithMaxCrossAxisExtent(
crossAxisExtent: context.screenWidth - spacing * 2,
maxCrossAxisExtent: maxCrossAxisExtent,
crossAxisSpacing: spacing,
childAspectRatio: 1.0,
);
final imageWidth = (size.width * context.devicePixelRatio).ceil();
return GridView.builder(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: maxCrossAxisExtent,
crossAxisSpacing: spacing,
mainAxisSpacing: spacing,
),
padding: const EdgeInsets.all(24.0),
padding: const EdgeInsets.all(spacing),
itemBuilder: (_, index) {
final bangumi = bangumis[index % length];
return ClipRRect(
borderRadius: borderRadius12,
borderRadius: borderRadius4,
child: Image(
image: CacheImage(bangumi.cover),
image: ResizeImage(
CacheImage(bangumi.cover),
width: imageWidth,
),
fit: BoxFit.cover,
isAntiAlias: true,
loadingBuilder: (
context,
child,
Expand Down
19 changes: 4 additions & 15 deletions lib/ui/fragments/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:provider/provider.dart';
import 'package:sliver_tools/sliver_tools.dart';
import 'package:waterfall_flow/waterfall_flow.dart';

import '../../internal/delegate.dart';
import '../../internal/extension.dart';
import '../../internal/image_provider.dart';
import '../../internal/kit.dart';
Expand All @@ -25,7 +24,7 @@ import '../../widget/bottom_sheet.dart';
import '../../widget/ripple_tap.dart';
import '../../widget/scalable_tap.dart';
import '../../widget/sliver_pinned_header.dart';
import '../components/ova_record_item.dart';
import '../components/simple_record_item.dart';
import 'select_season.dart';
import 'select_tablet_mode.dart';
import 'settings.dart';
Expand Down Expand Up @@ -282,25 +281,15 @@ class _IndexFragmentState extends State<IndexFragment> {
SliverPadding(
padding: edgeH24B16T4,
sliver: SliverWaterfallFlow(
gridDelegate: SliverWaterfallFlowDelegateWithMinCrossAxisExtent(
gridDelegate: SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
crossAxisSpacing: margins,
mainAxisSpacing: margins,
minCrossAxisExtent: 400.0,
maxCrossAxisExtent: 400.0,
),
delegate: SliverChildBuilderDelegate(
(context, index) {
final record = records[index];
return OVARecordItem(
index: index,
record: record,
onTap: () {
Navigator.pushNamed(
context,
Routes.record.name,
arguments: Routes.record.d(url: record.url),
);
},
);
return SimpleRecordItem(record: record);
},
childCount: records.length,
),
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/fragments/sliver_bangumi_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,9 @@ class SliverBangumiList extends StatelessWidget {
) {
final image = FadeInImage(
placeholder: Assets.mikan.provider(),
image: ResizeImage.resizeIfNeeded(
cacheWidth,
null,
image: ResizeImage(
CacheImage(bangumi.cover),
width: cacheWidth,
),
fit: BoxFit.cover,
imageErrorBuilder: (_, __, ___) {
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/fragments/subscribed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,9 @@ class _SubscribedFragmentState extends LifecycleAppState<SubscribedFragment> {
child: SizedBox.expand(
child: FadeInImage(
placeholder: Assets.mikan.provider(),
image: ResizeImage.resizeIfNeeded(
(280.0 * context.devicePixelRatio).ceil(),
null,
image: ResizeImage(
CacheImage(bangumiCover),
width: (280.0 * context.devicePixelRatio).ceil(),
),
fit: BoxFit.cover,
),
Expand Down
Loading

0 comments on commit df6e3f7

Please sign in to comment.