Skip to content

Commit

Permalink
1. 修复图标白边
Browse files Browse the repository at this point in the history
2. 修改包名
3. 减小应用大小
  • Loading branch information
share121 committed Sep 7, 2024
1 parent 9e0ab7e commit 148614d
Show file tree
Hide file tree
Showing 61 changed files with 141 additions and 117 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.14.1+19

1. 修复图标白边
2. 修改包名
3. 减小应用大小

## 2.14.0+18

1. 防止换页太快
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.inter_knot"
applicationId "com.share121.inter-knot"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/icon.webp
Binary file not shown.
Binary file added icon.webp
Binary file not shown.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand All @@ -384,7 +384,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -401,7 +401,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand All @@ -416,7 +416,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand Down Expand Up @@ -547,7 +547,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -569,7 +569,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot;
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
1 change: 0 additions & 1 deletion lib/api_root/get_discussion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Future<Article?> getDiscussion(int number) async {
lastEditedAt:
lastEditedAt == null ? null : DateTime.tryParse(lastEditedAt),
commentsCount: commentsCount,
isPin: false,
);
}
return null;
Expand Down
1 change: 0 additions & 1 deletion lib/api_user/get_discussion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Future<Article?> getDiscussion(int number) async {
lastEditedAt:
lastEditedAt == null ? null : DateTime.tryParse(lastEditedAt),
commentsCount: commentsCount,
isPin: false,
);
}
return null;
Expand Down
8 changes: 4 additions & 4 deletions lib/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class Controller extends GetxController {

late final info = PackageInfo.fromPlatform();

bool canVisit(Article article) =>
bool canVisit(Article article, bool isPin) =>
report[article.number] == null ||
[owner, ...collaborators].contains(article.author.login) ||
article.isPin ||
isPin ||
report[article.number]!.length < 6;

@override
Expand Down Expand Up @@ -277,5 +277,5 @@ class Controller extends GetxController {
}
}

bool canReport(Article article) =>
![owner, ...collaborators].contains(article.author.login) && !article.isPin;
bool canReport(Article article, bool isPin) =>
![owner, ...collaborators].contains(article.author.login) && !isPin;
16 changes: 2 additions & 14 deletions lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions lib/interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class Article extends GetxController {
final comments = <Comment>{}.obs;
var hasNextPage = true.obs;
String? endCursor;
final bool isPin;
late final bodyText = rawBodyText.replaceAll(RegExp(r'\s+'), ' ').trim();

final cache = <String?>{};
Expand All @@ -108,7 +107,6 @@ class Article extends GetxController {
required this.createdAt,
required this.commentsCount,
this.lastEditedAt,
required this.isPin,
});

@override
Expand Down Expand Up @@ -202,8 +200,7 @@ class HData {

HData(this.number, {this.isPin = false});
HData.fromStr(String number) : this(int.parse(number));
HData.fromArtilce(Article article)
: this(article.number, isPin: article.isPin);
HData.fromArtilce(Article article) : this(article.number);

@override
operator ==(Object other) => other is HData && other.number == number;
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Messages extends Translations {
'User Api': '用户接口',
'Announcement': '公告',
'Polls': '投票',
'Toolkit': '工具',
},
'zh_TC': {
'Inter-Knot': '绳网',
Expand Down Expand Up @@ -180,6 +181,7 @@ class Messages extends Translations {
'User Api': '用户接口',
'Announcement': '公告',
'Polls': '投票',
'Toolkit': '工具',
},
};
}
14 changes: 11 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

import 'package:get/get.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:window_manager/window_manager.dart';

Expand All @@ -15,6 +16,7 @@ import 'pages/history_page.dart';
import 'pages/liked_page.dart';
import 'pages/partition_page.dart';
import 'pages/notifications_page.dart';
import 'pages/toolkit_page.dart';
import 'widget/github_button.dart';
import 'widget/discord_button.dart';
import 'widget/doc_button.dart';
Expand Down Expand Up @@ -72,7 +74,7 @@ class MyApp extends StatelessWidget {
locale: Get.deviceLocale,
themeMode: ThemeMode.dark,
fallbackLocale: const Locale('en'),
home: const DragToResizeArea(child: MyHomePage()),
home: const MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
Expand Down Expand Up @@ -103,6 +105,11 @@ final destinations = [
selectedIcon: const Icon(Icons.history),
label: Text('History'.tr),
),
NavigationRailDestination(
icon: Icon(MdiIcons.toolboxOutline),
selectedIcon: Icon(MdiIcons.toolbox),
label: Text('Toolkit'.tr),
),
NavigationRailDestination(
icon: const Icon(Icons.settings_outlined),
selectedIcon: const Icon(Icons.settings),
Expand Down Expand Up @@ -183,14 +190,14 @@ class MyHomePage extends StatelessWidget {
LayoutBuilder(builder: (context, con) {
return SingleChildScrollView(
child: SizedBox(
height: max(con.maxHeight, 292),
height: max(con.maxHeight, 336),
child: Obx(() {
return NavigationRail(
destinations: destinations,
selectedIndex: c.selectedIndex(),
onDestinationSelected: (index) =>
c.animateToPage(index),
labelType: con.maxHeight < 392
labelType: con.maxHeight < 456
? NavigationRailLabelType.selected
: NavigationRailLabelType.all,
);
Expand All @@ -209,6 +216,7 @@ class MyHomePage extends StatelessWidget {
PartitionPage(),
LikedPage(),
HistoryPage(),
ToolkitPage(),
SettingsPage(),
][index],
),
Expand Down
10 changes: 8 additions & 2 deletions lib/pages/article_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ import '../data.dart';
import '../widget/window_buttons.dart';

class ArticlePage extends StatefulWidget {
const ArticlePage({super.key, required this.article, required this.heroKey});
const ArticlePage({
super.key,
required this.article,
required this.heroKey,
required this.isPin,
});

final Article article;
final Object heroKey;
final bool isPin;

@override
State<ArticlePage> createState() => _ArticlePageState();
Expand Down Expand Up @@ -126,7 +132,7 @@ class _ArticlePageState extends State<ArticlePage> {
),
child: const Icon(Icons.arrow_upward),
),
if (canReport(widget.article)) ...[
if (canReport(widget.article, widget.isPin)) ...[
const SizedBox(height: 8),
FloatingActionButton(
heroTag: null,
Expand Down
37 changes: 37 additions & 0 deletions lib/pages/toolkit_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:waterfall_flow/waterfall_flow.dart';

class ToolkitPage extends StatelessWidget {
const ToolkitPage({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) =>
[SliverAppBar(title: Text('Toolkit'.tr))],
floatHeaderSlivers: true,
body: WaterfallFlow.extent(
maxCrossAxisExtent: 270,
padding: const EdgeInsets.all(8),
children: [
Card(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
Text(
'Toolkit',
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
),
)
],
),
),
);
}
}
8 changes: 6 additions & 2 deletions lib/widget/article_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ class ArticleGrid extends StatelessWidget {
if (snaphost.hasData) {
return DiscussionCard(
article: snaphost.data!,
isPin: item.isPin,
onTap: (heroKey) {
Get.to(() =>
ArticlePage(heroKey: heroKey, article: snaphost.data!));
Get.to(() => ArticlePage(
heroKey: heroKey,
article: snaphost.data!,
isPin: item.isPin,
));
},
);
}
Expand Down
8 changes: 5 additions & 3 deletions lib/widget/discussion_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import 'avatar.dart';
import 'comment_count.dart';

class DiscussionCard extends StatefulWidget {
const DiscussionCard({super.key, this.onTap, required this.article});
const DiscussionCard(
{super.key, this.onTap, required this.article, required this.isPin});

final Article article;
final bool isPin;
final void Function(Object heroKey)? onTap;

@override
Expand All @@ -29,7 +31,7 @@ class _DiscussionCardState extends State<DiscussionCard> {
clipBehavior: Clip.antiAlias,
elevation: elevation,
child: Obx(() {
if (!c.canVisit(widget.article)) {
if (!c.canVisit(widget.article, widget.isPin)) {
return AspectRatio(
aspectRatio: 5 / 6,
child: InkWell(
Expand Down Expand Up @@ -75,7 +77,7 @@ class _DiscussionCardState extends State<DiscussionCard> {
color: Colors.white,
),
),
if (widget.article.isPin)
if (widget.isPin)
Positioned(
top: 8,
right: 12,
Expand Down
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
2 changes: 1 addition & 1 deletion macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PRODUCT_NAME = 绳网

// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.share121.interKnot
PRODUCT_BUNDLE_IDENTIFIER = com.share121.inter-knot

// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2024 com.share121. All rights reserved.
Loading

0 comments on commit 148614d

Please sign in to comment.