This commit is contained in:
Moustapha Kodjo Amadou 2025-06-02 10:37:01 +01:00
parent d5247a8183
commit 1c256f884d
3 changed files with 81 additions and 56 deletions

View file

@ -34,6 +34,14 @@ jobs:
with:
distribution: "temurin"
java-version: "17"
env:
JAVA_OPTS: "-Xmx4096m -XX:MaxMetaspaceSize=512m"
- name: Setup Gradle properties for CI
run: |
echo "org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m -XX:+UseG1GC" >> android/gradle.properties
echo "org.gradle.parallel=true" >> android/gradle.properties
echo "org.gradle.daemon=false" >> android/gradle.properties
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
@ -56,7 +64,8 @@ jobs:
- name: build android apks
run: |
flutter build apk --release --split-per-abi
export GRADLE_OPTS="-Xmx4096m -XX:MaxMetaspaceSize=512m -XX:+UseG1GC"
flutter build apk --release --split-per-abi --verbose
cd build/app/outputs/flutter-apk
mv app-arm64-v8a-release.apk Mangayomi-${{ github.ref_name }}-android-arm64-v8a.apk
mv app-armeabi-v7a-release.apk Mangayomi-${{ github.ref_name }}-android-armeabi-v7a.apk

View file

@ -1,3 +1,10 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
# Optimizations for build performance
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
android.enableR8.fullMode=true

View file

@ -208,6 +208,7 @@ class _SourceRepositoriesState extends ConsumerState<SourceRepositories> {
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
bool isLoading = false;
final controller = TextEditingController();
showDialog(
context: context,
@ -269,62 +270,70 @@ class _SourceRepositoriesState extends ConsumerState<SourceRepositories> {
child: Text(l10n.cancel),
),
const SizedBox(width: 15),
TextButton(
onPressed:
controller.text.isEmpty ||
!controller.text.endsWith(".json")
? null
: () async {
try {
final mangaRepos = ref
.read(
extensionsRepoStateProvider(
widget.itemType,
),
)
.toList();
final repo = await ref.read(
getRepoInfosProvider(
jsonUrl: controller.text,
).future,
);
if (repo == null) {
botToast(l10n.unsupported_repo);
return;
}
mangaRepos.add(repo);
ref
.read(
extensionsRepoStateProvider(
widget.itemType,
).notifier,
)
.set(mangaRepos);
ref.invalidate(
extensionsRepoStateProvider(
widget.itemType,
),
);
} catch (e, s) {
botToast('$e\n$s');
}
if (context.mounted) {
Navigator.pop(context);
}
},
child: Text(
l10n.add,
style: TextStyle(
color:
StatefulBuilder(
builder: (context, setState) {
return TextButton(
onPressed:
controller.text.isEmpty ||
!controller.text.endsWith(".json")
? Theme.of(
context,
).primaryColor.withValues(alpha: 0.2)
: null,
),
),
? null
: () async {
setState(() => isLoading = true);
try {
final mangaRepos = ref
.read(
extensionsRepoStateProvider(
widget.itemType,
),
)
.toList();
final repo = await ref.read(
getRepoInfosProvider(
jsonUrl: controller.text,
).future,
);
if (repo == null) {
botToast(l10n.unsupported_repo);
return;
}
mangaRepos.add(repo);
ref
.read(
extensionsRepoStateProvider(
widget.itemType,
).notifier,
)
.set(mangaRepos);
} catch (e, s) {
setState(() => isLoading = false);
botToast('$e\n$s');
}
if (context.mounted) {
Navigator.pop(context);
}
},
child: isLoading
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(),
)
: Text(
l10n.add,
style: TextStyle(
color:
controller.text.isEmpty ||
!controller.text.endsWith(
".json",
)
? Theme.of(context).primaryColor
.withValues(alpha: 0.2)
: null,
),
),
);
},
),
],
),