Files
rr3-apk/res/layout/activity_settings.xml
Daniel Elliott 9497ebce05 Add in-game settings menu with web panel sync
Features:
- SettingsActivity accessible via Menu button (keycode 82)
- Configure server URL and mode (online/offline) in-game
- Test connection before saving settings
- Switch to offline mode with one tap
- Sync settings from web admin panel
- Real-time status messages with emoji indicators

Implementation:
- Created 13 SettingsActivity Smali files (main + inner classes)
- Created activity_settings.xml UI layout
- Added SettingsActivity to AndroidManifest.xml (portrait mode)
- Modified MainActivity.smali to handle Menu button press
- Integrated with existing ServerManager for Nimble SDK overrides
- Settings stored in SharedPreferences (rr3_server_config.xml)

APK:
- Built and signed: RR3-v14-Settings-Menu.apk (103 MB)
- Keystore: rr3-release.keystore (alias: rr3key)
- Ready for distribution

Related server changes:
- ServerSettingsController.cs with 3 API endpoints
- DeviceSettings.cshtml admin page
- UserSettings database model and migration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-19 10:13:47 -08:00

134 lines
4.4 KiB
XML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="24dp"
android:background="#000000">
<!-- Header -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="⚙️ Server Settings"
android:textSize="28sp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:gravity="center"
android:layout_marginBottom="32dp"/>
<!-- Current Mode Display -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#1E1E1E"
android:padding="16dp"
android:layout_marginBottom="24dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Current Mode:"
android:textSize="16sp"
android:textColor="#AAAAAA"/>
<TextView
android:id="@+id/tv_current_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Online"
android:textSize="16sp"
android:textColor="#4CAF50"
android:textStyle="bold"/>
</LinearLayout>
<!-- Server URL Section -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Server URL:"
android:textSize="16sp"
android:textColor="#FFFFFF"
android:layout_marginBottom="8dp"/>
<EditText
android:id="@+id/et_server_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="https://rr3.barrer.net:8443"
android:text=""
android:textColor="#FFFFFF"
android:textColorHint="#666666"
android:inputType="textUri"
android:padding="16dp"
android:background="#1E1E1E"
android:layout_marginBottom="16dp"/>
<!-- Action Buttons -->
<Button
android:id="@+id/btn_test_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🔍 Test Connection"
android:textSize="16sp"
android:padding="16dp"
android:layout_marginBottom="12dp"
android:backgroundTint="#2196F3"/>
<Button
android:id="@+id/btn_save_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="💾 Save Settings"
android:textSize="16sp"
android:padding="16dp"
android:layout_marginBottom="12dp"
android:backgroundTint="#4CAF50"/>
<Button
android:id="@+id/btn_switch_to_offline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🏠 Switch to Offline Mode"
android:textSize="16sp"
android:padding="16dp"
android:layout_marginBottom="12dp"
android:backgroundTint="#FF9800"/>
<Button
android:id="@+id/btn_sync_from_web"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🔄 Sync from Web Panel"
android:textSize="16sp"
android:padding="16dp"
android:layout_marginBottom="24dp"
android:backgroundTint="#9C27B0"/>
<!-- Status Message -->
<TextView
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="14sp"
android:textColor="#4CAF50"
android:gravity="center"
android:padding="12dp"
android:background="#1E1E1E"
android:visibility="gone"/>
<!-- Info Section -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text=" Server URL Format:\n• HTTPS: https://domain.com:8443\n• HTTP: http://domain.com:8080\n• IP: http://192.168.1.100:8080"
android:textSize="12sp"
android:textColor="#666666"
android:lineSpacingMultiplier="1.4"/>
</LinearLayout>