fix(android): change QR scanner to portrait orientation
- Created PortraitCaptureActivity that extends CaptureActivity - Registered it in AndroidManifest.xml with screenOrientation="portrait" - Updated JoinKeygenScreen and CoSignJoinScreen to use the portrait activity - Also simplified keygen join logic to match Electron exactly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d90c722c7d
commit
13d1e58b84
|
|
@ -31,6 +31,14 @@
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<!-- Portrait-only QR code scanner activity -->
|
||||||
|
<activity
|
||||||
|
android:name=".presentation.screens.PortraitCaptureActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:stateNotNeeded="true"
|
||||||
|
android:theme="@style/zxing_CaptureTheme"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,8 @@ fun CoSignJoinScreen(
|
||||||
setCameraId(0)
|
setCameraId(0)
|
||||||
setBeepEnabled(true)
|
setBeepEnabled(true)
|
||||||
setBarcodeImageEnabled(false)
|
setBarcodeImageEnabled(false)
|
||||||
setOrientationLocked(false)
|
setOrientationLocked(true)
|
||||||
|
setCaptureActivity(PortraitCaptureActivity::class.java)
|
||||||
}
|
}
|
||||||
scanLauncher.launch(options)
|
scanLauncher.launch(options)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,7 @@ private fun InputScreen(
|
||||||
setBeepEnabled(true)
|
setBeepEnabled(true)
|
||||||
setBarcodeImageEnabled(false)
|
setBarcodeImageEnabled(false)
|
||||||
setOrientationLocked(true)
|
setOrientationLocked(true)
|
||||||
|
setCaptureActivity(PortraitCaptureActivity::class.java)
|
||||||
}
|
}
|
||||||
scanLauncher.launch(options)
|
scanLauncher.launch(options)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.durian.tssparty.presentation.screens
|
||||||
|
|
||||||
|
import com.journeyapps.barcodescanner.CaptureActivity
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Portrait-only barcode capture activity
|
||||||
|
* Used to force the QR scanner to use portrait orientation
|
||||||
|
*/
|
||||||
|
class PortraitCaptureActivity : CaptureActivity()
|
||||||
Loading…
Reference in New Issue