Skip to content

Commit

Permalink
full screen in zoom page
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Jun 29, 2024
1 parent 844a26b commit 67896bf
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 22 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ flutter {
}

dependencies {
implementation("androidx.core:core-remoteviews:1.0.0")
implementation("androidx.core:core-remoteviews:1.1.0")
implementation("androidx.annotation:annotation:1.7.1")
implementation fileTree(dir: "libs", include: ["*.aar"])
implementation project(":weiss")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("com.google.android.material:material:1.11.0")
implementation("io.coil-kt:coil:2.1.0")
implementation("io.coil-kt:coil:2.6.0")
implementation("androidx.webkit:webkit:1.4.0")
implementation("androidx.browser:browser:1.7.0")
implementation("androidx.browser:browser:1.8.0")
implementation("com.waynejo:androidndkgif:0.3.3")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.documentfile:documentfile:1.0.1")
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.0'

repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
Expand Down
1 change: 0 additions & 1 deletion lib/page/novel/viewer/image_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ class NovelSpansGenerator {
if (link != null) {
final uri = Uri.tryParse(link);
if (uri != null && uri.host.contains("pixiv.net")) {
final str = now.split(">").firstOrNull ?? "";
return NovelSpansData(NovelSpansType.jumpUri, link);
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/page/novel/viewer/novel_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:html/parser.dart';
import 'package:dio/dio.dart';
import 'package:mobx/mobx.dart';
Expand Down
41 changes: 41 additions & 0 deletions lib/page/zoom/photo_zoom_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:io';

import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
Expand Down Expand Up @@ -50,6 +51,14 @@ class _PhotoZoomPageState extends State<PhotoZoomPage> {
initCache();
}

@override
void dispose() {
if (_fullScreen)
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
super.dispose();
}

initCache() async {
var fileInfo = await pixivCacheManager.getFileFromCache(nowUrl);
if (mounted)
Expand Down Expand Up @@ -128,8 +137,30 @@ class _PhotoZoomPageState extends State<PhotoZoomPage> {
bool show = false;
bool shareShow = false;
bool _loadSource = false;
bool _fullScreen = false;

Widget _buildBottom(BuildContext context) {
if (_fullScreen) {
return BottomAppBar(
color: Colors.transparent,
child: Row(
children: [
IconButton(
onPressed: () {
setState(() {
_fullScreen = false;
});
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
},
icon: Icon(
Icons.fullscreen_exit,
color: Colors.white.withOpacity(0.5),
))
],
),
);
}
return BottomAppBar(
color: Colors.transparent,
child: Visibility(
Expand Down Expand Up @@ -168,6 +199,16 @@ class _PhotoZoomPageState extends State<PhotoZoomPage> {
onPressed: () async {
Navigator.of(context).pop();
}),
IconButton(
icon: Icon(Icons.fullscreen, color: Colors.white),
onPressed: () {
setState(() {
_fullScreen = true;
});
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: []);
},
),
if (ClipboardPlugin.supported)
IconButton(
icon: Icon(
Expand Down
2 changes: 0 additions & 2 deletions lib/store/fullscreen_store.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:mobx/mobx.dart';
import 'package:pixez/models/account.dart';
import 'package:shared_preferences/shared_preferences.dart';

part 'fullscreen_store.g.dart';

Expand Down
11 changes: 0 additions & 11 deletions lib/store/mute_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,4 @@ abstract class _MuteStoreBase with Store {
final exportJson = jsonEncode(entity);
LPrinter.d("exportJson:$exportJson");
}

import() async {
final importStr = "";
await banUserIdProvider.open();
await banIllustIdProvider.open();
await banTagProvider.open();
final importBean = jsonDecode(importStr);
final importMap = importBean as Map<String, dynamic>;
final illustId = importMap['banillustid'];
//TODO
}
}
4 changes: 1 addition & 3 deletions lib/store/save_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ abstract class _SaveStoreBase with Store {
stream.entity as QueueRetryEntity;
final id = entity.taskPersist.id;
if (id != null) {
await fetcher
.taskPersistProvider
.remove(id);
await fetcher.taskPersistProvider.remove(id);
_joinQueue(entity.url, entity.illusts,
entity.fileName);
}
Expand Down

0 comments on commit 67896bf

Please sign in to comment.