update android to android,adjust two fingers scroll
This commit is contained in:
parent
4840b2744b
commit
d2a01a7240
@ -244,8 +244,6 @@ class FfiModel with ChangeNotifier {
|
|||||||
|
|
||||||
if (isPeerAndroid) {
|
if (isPeerAndroid) {
|
||||||
_touchMode = true;
|
_touchMode = true;
|
||||||
FFI.setByName('peer_option', '{"name": "view-style", "value": "shrink"}');
|
|
||||||
FFI.canvasModel.updateViewStyle();
|
|
||||||
if (FFI.ffiModel.permissions['keyboard'] != false) {
|
if (FFI.ffiModel.permissions['keyboard'] != false) {
|
||||||
showMobileActionsOverlay();
|
showMobileActionsOverlay();
|
||||||
}
|
}
|
||||||
@ -296,6 +294,13 @@ class ImageModel with ChangeNotifier {
|
|||||||
FFI.canvasModel.scale = max(xscale, yscale);
|
FFI.canvasModel.scale = max(xscale, yscale);
|
||||||
}
|
}
|
||||||
initializeCursorAndCanvas();
|
initializeCursorAndCanvas();
|
||||||
|
Future.delayed(Duration(milliseconds: 1), () {
|
||||||
|
if (FFI.ffiModel.isPeerAndroid) {
|
||||||
|
FFI.setByName(
|
||||||
|
'peer_option', '{"name": "view-style", "value": "shrink"}');
|
||||||
|
FFI.canvasModel.updateViewStyle();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_image = image;
|
_image = image;
|
||||||
if (image != null) notifyListeners();
|
if (image != null) notifyListeners();
|
||||||
|
@ -536,8 +536,13 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
FFI.canvasModel.panX(d.focalPointDelta.dx);
|
FFI.canvasModel.panX(d.focalPointDelta.dx);
|
||||||
FFI.canvasModel.panY(d.focalPointDelta.dy);
|
FFI.canvasModel.panY(d.focalPointDelta.dy);
|
||||||
},
|
},
|
||||||
onTwoFingerScaleEnd: (d) => _scale = 1,
|
onTwoFingerScaleEnd: (d) {
|
||||||
onTwoFingerVerticalDragUpdate: (d) {
|
_scale = 1;
|
||||||
|
FFI.setByName('peer_option', '{"name": "view-style", "value": ""}');
|
||||||
|
},
|
||||||
|
onTwoFingerVerticalDragUpdate: FFI.ffiModel.isPeerAndroid
|
||||||
|
? null
|
||||||
|
: (d) {
|
||||||
FFI.scroll(d.delta.dy / 2);
|
FFI.scroll(d.delta.dy / 2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -933,7 +938,6 @@ void showOptions() {
|
|||||||
String quality = FFI.getByName('image_quality');
|
String quality = FFI.getByName('image_quality');
|
||||||
if (quality == '') quality = 'balanced';
|
if (quality == '') quality = 'balanced';
|
||||||
String viewStyle = FFI.getByName('peer_option', 'view-style');
|
String viewStyle = FFI.getByName('peer_option', 'view-style');
|
||||||
if (viewStyle == '') viewStyle = 'original';
|
|
||||||
var displays = <Widget>[];
|
var displays = <Widget>[];
|
||||||
final pi = FFI.ffiModel.pi;
|
final pi = FFI.ffiModel.pi;
|
||||||
final image = FFI.ffiModel.getConnectionImage();
|
final image = FFI.ffiModel.getConnectionImage();
|
||||||
|
@ -213,10 +213,6 @@ class _PermissionCheckerState extends State<PermissionChecker> {
|
|||||||
"* ${translate("android_version_audio_tip")}",
|
"* ${translate("android_version_audio_tip")}",
|
||||||
style: TextStyle(color: MyTheme.darkGray),
|
style: TextStyle(color: MyTheme.darkGray),
|
||||||
),
|
),
|
||||||
Text(
|
|
||||||
"DEBUG:VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR",
|
|
||||||
style: TextStyle(color: MyTheme.darkGray),
|
|
||||||
),
|
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
@ -155,7 +155,16 @@ class CustomTouchGestureRecognizer extends ScaleGestureRecognizer {
|
|||||||
_sumHorizontal += d.focalPointDelta.dx;
|
_sumHorizontal += d.focalPointDelta.dx;
|
||||||
_sumVertical += d.focalPointDelta.dy;
|
_sumVertical += d.focalPointDelta.dy;
|
||||||
// start
|
// start
|
||||||
if (_sumScale.abs() > kScaleSlop) {
|
if (onTwoFingerVerticalDragUpdate != null &&
|
||||||
|
_sumVertical.abs() > kPrecisePointerPanSlop &&
|
||||||
|
_sumHorizontal.abs() < kPrecisePointerPanSlop) {
|
||||||
|
debugPrint("start Vertical");
|
||||||
|
if (onTwoFingerVerticalDragStart != null) {
|
||||||
|
onTwoFingerVerticalDragStart!(_getDragStartDetails(d));
|
||||||
|
}
|
||||||
|
_currentState = CustomTouchGestureState.twoFingerVerticalDrag;
|
||||||
|
_reset();
|
||||||
|
} else if (onTwoFingerScaleUpdate != null && _sumScale.abs() > kScaleSlop) {
|
||||||
debugPrint("start Scale");
|
debugPrint("start Scale");
|
||||||
_currentState = CustomTouchGestureState.twoFingerScale;
|
_currentState = CustomTouchGestureState.twoFingerScale;
|
||||||
if (onTwoFingerScaleStart != null) {
|
if (onTwoFingerScaleStart != null) {
|
||||||
@ -163,14 +172,6 @@ class CustomTouchGestureRecognizer extends ScaleGestureRecognizer {
|
|||||||
localFocalPoint: d.localFocalPoint, focalPoint: d.focalPoint));
|
localFocalPoint: d.localFocalPoint, focalPoint: d.focalPoint));
|
||||||
}
|
}
|
||||||
_reset();
|
_reset();
|
||||||
} else if (_sumVertical.abs() > kPrecisePointerPanSlop &&
|
|
||||||
_sumHorizontal.abs() < kPrecisePointerHitSlop) {
|
|
||||||
debugPrint("start Vertical");
|
|
||||||
if (onTwoFingerVerticalDragStart != null) {
|
|
||||||
_getDragStartDetails(d);
|
|
||||||
}
|
|
||||||
_currentState = CustomTouchGestureState.twoFingerVerticalDrag;
|
|
||||||
_reset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user