Skip to content

Commit 03a8839

Browse files
Update locale and fix several bugs
1 parent ad2110e commit 03a8839

File tree

87 files changed

+1752
-1436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1752
-1436
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ android {
4141
}
4242

4343
defaultConfig {
44-
applicationId "com.cloudchewie.loftify"
44+
applicationId "com.cloudchewie.loftifyforlove"
4545
minSdkVersion 23
4646
targetSdkVersion flutter.targetSdkVersion
4747
versionCode flutterVersionCode.toInteger()

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
3-
package="com.cloudchewie.loftify">
3+
package="com.cloudchewie.loftifyforlove">
44

55
<queries>
66
<intent>
@@ -21,13 +21,13 @@
2121
<application
2222
android:name="${applicationName}"
2323
android:icon="@mipmap/ic_launcher"
24-
android:label="Loftify"
24+
android:label="Lofter"
2525
android:networkSecurityConfig="@xml/network_security_config"
2626
android:requestLegacyExternalStorage="true"
2727
android:extractNativeLibs="true"
2828
android:usesCleartextTraffic="true">
2929
<activity
30-
android:name=".MainActivity"
30+
android:name="com.cloudchewie.loftify.MainActivity"
3131
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
3232
android:exported="true"
3333
android:hardwareAccelerated="true"

lib/Api/github_api.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ class GithubApi {
88
static Future<List<ReleaseItem>> getReleases(String user, String repo) async {
99
String url = "https://api.github.com/repos/$user/$repo/releases";
1010
try {
11-
final response =
12-
await Dio().get(url);
11+
final response = await Dio().get(url);
1312
if (response.statusCode == 200) {
1413
final data = response.data;
1514
if (data is List) {
1615
final List<ReleaseItem> items =
17-
(data).map((e) => ReleaseItem.fromJson(e)).toList();
16+
(data).map((e) => ReleaseItem.fromJson(e)).toList();
1817
return items;
1918
}
2019
}

lib/Models/github_response.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ReleaseAsset {
129129
dynamic uploader;
130130
String url;
131131

132-
String pkgsDownloadUrl="";
132+
String pkgsDownloadUrl = "";
133133

134134
ReleaseAsset({
135135
required this.browserDownloadUrl,

lib/Models/suit_response.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class ProductItem {
3737
}
3838

3939
bool isSame(ProductItem other) {
40-
if(type==other.type){
41-
if(type==0){
40+
if (type == other.type) {
41+
if (type == 0) {
4242
return product?.id == other.product?.id;
43-
}else{
43+
} else {
4444
return lootBox?.id == other.lootBox?.id;
4545
}
46-
}else{
46+
} else {
4747
return false;
4848
}
4949
}

lib/Screens/Info/collection_screen.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import '../../Utils/route_util.dart';
1515
import '../../Utils/utils.dart';
1616
import '../../Widgets/General/EasyRefresh/easy_refresh.dart';
1717
import '../../Widgets/Item/item_builder.dart';
18+
import '../../generated/l10n.dart';
1819
import '../Post/collection_detail_screen.dart';
1920
import 'nested_mixin.dart';
2021

@@ -120,7 +121,7 @@ class _CollectionScreenState extends State<CollectionScreen>
120121
} catch (e, t) {
121122
_initPhase = InitPhase.failed;
122123
ILogger.error("Failed to load collection list", e, t);
123-
if (mounted) IToast.showTop("加载失败");
124+
if (mounted) IToast.showTop(S.current.loadFailed);
124125
return IndicatorResult.fail;
125126
} finally {
126127
if (mounted) setState(() {});
@@ -171,7 +172,7 @@ class _CollectionScreenState extends State<CollectionScreen>
171172
return _collectionList.isNotEmpty
172173
? _buildMainBody(physics)
173174
: ItemBuilder.buildEmptyPlaceholder(
174-
context: context, text: "暂无合集",physics: physics);
175+
context: context, text: "暂无合集", physics: physics);
175176
},
176177
);
177178
default:

lib/Screens/Info/favorite_folder_detail_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../generated/l10n.dart';
12
import 'package:flutter/material.dart';
23
import 'package:loftify/Models/favorites_response.dart';
34
import 'package:loftify/Models/recommend_response.dart';
@@ -104,7 +105,7 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
104105
}
105106
} catch (e, t) {
106107
ILogger.error("Failed to load folder detail", e, t);
107-
if (mounted) IToast.showTop("加载失败");
108+
if (mounted) IToast.showTop(S.current.loadFailed);
108109
return IndicatorResult.fail;
109110
} finally {
110111
if (mounted) setState(() {});

lib/Screens/Info/favorite_folder_list_screen.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../../generated/l10n.dart';
12
import 'dart:io';
23

34
import 'package:flutter/material.dart';
@@ -75,7 +76,7 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
7576
}
7677
} catch (e, t) {
7778
ILogger.error("Failed to load folder list", e, t);
78-
if (mounted) IToast.showTop("加载失败");
79+
if (mounted) IToast.showTop(S.current.loadFailed);
7980
return IndicatorResult.fail;
8081
} finally {
8182
if (mounted) setState(() {});
@@ -120,7 +121,7 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
120121

121122
Widget _buildBody() {
122123
return WaterfallFlow.extent(
123-
maxCrossAxisExtent: 800,
124+
maxCrossAxisExtent: 600,
124125
mainAxisSpacing: 12,
125126
crossAxisSpacing: 12,
126127
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),

lib/Screens/Info/following_follower_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:loftify/Resources/theme.dart';
77
import 'package:loftify/Utils/hive_util.dart';
88
import 'package:waterfall_flow/waterfall_flow.dart';
99

10+
import '../../generated/l10n.dart';
1011
import '../../Models/user_response.dart';
1112
import '../../Utils/enums.dart';
1213
import '../../Utils/ilogger.dart';
@@ -93,7 +94,7 @@ class _FollowingFollowerScreenState extends State<FollowingFollowerScreen>
9394
}
9495
} catch (e, t) {
9596
ILogger.error("Failed to load following or follower", e, t);
96-
if (mounted) IToast.showTop("加载失败");
97+
if (mounted) IToast.showTop(S.current.loadFailed);
9798
return IndicatorResult.fail;
9899
} finally {
99100
if (mounted) setState(() {});

lib/Screens/Info/grain_screen.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:loftify/Resources/theme.dart';
88
import 'package:loftify/Screens/Post/grain_detail_screen.dart';
99
import 'package:loftify/Utils/hive_util.dart';
1010
import 'package:waterfall_flow/waterfall_flow.dart';
11+
import '../../generated/l10n.dart';
1112

1213
import '../../Utils/enums.dart';
1314
import '../../Utils/ilogger.dart';
@@ -68,7 +69,7 @@ class _GrainScreenState extends State<GrainScreen>
6869
WidgetsBinding.instance.addPostFrameCallback((_) {
6970
Future.delayed(const Duration(milliseconds: 300), () => _onRefresh());
7071
});
71-
}else{
72+
} else {
7273
_initPhase = InitPhase.successful;
7374
setState(() {});
7475
}
@@ -114,7 +115,7 @@ class _GrainScreenState extends State<GrainScreen>
114115
} catch (e, t) {
115116
_initPhase = InitPhase.failed;
116117
ILogger.error("Failed to load grain list", e, t);
117-
if (mounted) IToast.showTop("加载失败");
118+
if (mounted) IToast.showTop(S.current.loadFailed);
118119
return IndicatorResult.fail;
119120
} finally {
120121
if (mounted) setState(() {});
@@ -165,7 +166,7 @@ class _GrainScreenState extends State<GrainScreen>
165166
return _grainList.isNotEmpty
166167
? _buildMainBody(physics)
167168
: ItemBuilder.buildEmptyPlaceholder(
168-
context: context, text: "暂无粮单",physics: physics);
169+
context: context, text: "暂无粮单", physics: physics);
169170
},
170171
);
171172
default:

0 commit comments

Comments
 (0)