fix(app): lock capture page portrait; gate zoom badge on 2 pointers; drop dead getter

- MainActivity locked to portrait: the capture page top bar / bottom
  controls and the preview aspect swap all assume portrait; landscape
  misaligns the preview ratio and control layers.
- Zoom badge now requires details.pointerCount >= 2 on onScaleStart so a
  single stationary tap no longer pops a 1.0x badge for 1s; base-zoom
  rebasing stays unconditional (single-finger-into-pinch still resumes
  from the current level).
- Removed unused CameraPluginSource.currentZoom getter.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-28 16:33:15 +08:00
parent ac602acf47
commit 4f89c25bad
2 changed files with 7 additions and 4 deletions
@@ -30,11 +30,14 @@
<meta-data
android:name="io.flutter.embedding.android.EnableImpeller"
android:value="false" />
<!-- 连拍页按竖屏设计(顶部常驻层/底部控制位与预览宽高交换均假设
纵向),横屏下预览比例与控制层错位;锁定竖屏。 -->
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:screenOrientation="portrait"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
+4 -4
View File
@@ -139,9 +139,6 @@ class CameraPluginSource extends CaptureSource {
_zoomLevel = clamped;
}
/// 当前变焦倍数(最近一次硬件同步值)。
double get currentZoom => _zoomLevel;
@override
bool get supportsFlash => true;
@@ -377,7 +374,10 @@ class _CapturePageState extends ConsumerState<CapturePage>
_pinchBaseZoom = _lastSentZoom
.clamp(source.minZoom, source.maxZoom)
.toDouble();
_showZoomBadge(_pinchBaseZoom!);
// 单指轻点同样触发 onScaleStart——倍数徽标仅在真捏合(≥2 指)时显示,
// 避免轻点预览也弹 1.0×;基线重定保持无条件(单指转捏合、抬起再捏合
// 均从当前倍数续接)。
if (details.pointerCount >= 2) _showZoomBadge(_pinchBaseZoom!);
}
void _onPinchUpdate(ScaleUpdateDetails details) {