Add QR code scanning for server configuration
Adds QR code scanning functionality to both ServerSetupActivity and SettingsActivity, allowing users to auto-fill server configuration by scanning a QR code from the server's admin dashboard. Changes: - Add ZXing Android Embedded library (v4.3.0) for QR scanning - Add CAMERA permission to AndroidManifest - Create QrServerConfig model to parse and validate QR JSON data - Create QrScannerUtil for shared scanning functionality - Extend PermissionUtil with camera permission handling - Add "Scan QR Code" button to ServerSetupActivity with hint text - Add "Scan QR Code" button to SettingsActivity - Add QR scan icon and string resources - Configure Gradle Java toolchain auto-detection The QR code contains JSON with server address, port, and client key which are automatically populated into the input fields when scanned.
This commit is contained in:
@@ -88,6 +88,27 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- QR Code Scan Button -->
|
||||
<Button
|
||||
android:id="@+id/scanQrButton"
|
||||
style="?attr/materialButtonOutlinedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/scan_qr_code_button"
|
||||
android:drawableLeft="@drawable/ic_qr_scan"
|
||||
android:drawablePadding="8dp"
|
||||
android:paddingVertical="12dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/scan_qr_code_hint"
|
||||
android:textAlignment="center"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/testConnectionInfo"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -67,6 +67,18 @@
|
||||
android:inputType="textPassword" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- QR Code Scan Button -->
|
||||
<Button
|
||||
android:id="@+id/scanQrButton"
|
||||
style="?attr/materialButtonOutlinedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/scan_qr_code_button"
|
||||
android:drawableLeft="@drawable/ic_qr_scan"
|
||||
android:drawablePadding="8dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/saveSettingsButton"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user