Commit graph

9 commits

Author SHA1 Message Date
moreoronce
e835b5a1e4 Enhance WebViewActivity Functionality and Performance
- Integrated SwipeRefreshLayout for improved refreshing capabilities.
- Added FloatingActionButton for manual WebView refresh.
- Implemented drag-to-move functionality for the refresh button.
- Optimized code with enhanced logging and error handling.
- Ensured proper WebView initialization with upgraded settings.
2024-10-07 13:54:55 +08:00
moreoronce
236bb140f8 Add Functionality and Fix Issues in WebViewActivity
- Implemented draggable FloatingActionButton with click functionality.
- Resolved touch conflict between touch and click events on FloatingActionButton.
- Improved WebView reload logic and ensured UI components are not obstructed.
- Updated XML layouts for better constraint alignment and visual consistency.
- Enhanced logging for user actions on the refresh button.

Ensures a smoother user experience and UI operation.
2024-10-07 13:29:12 +08:00
moreoronce
b82febf82a Refactor and Optimize Layouts and Resources
- Updated activity_main.xml for better layout alignment and consistent use of Material Design components.
- Added ids to LinearLayouts for easier reference and manipulation.
- Enhanced styles in styles.xml to unify the UI appearance across the app.
- Adjusted themes in themes.xml to incorporate the latest Material Components.
- Revised colors.xml and strings.xml to include new color schemes and text resources.
- Updated backup_rules.xml and various drawable resources for consistency and clarity.
2024-10-07 09:00:14 +08:00
moreoronce
80fccdd2d6 - Remove unused import and code 2024-10-06 22:04:54 +08:00
moreoronce
45f1e9636d feat: Add one-time LobeChat validation logic for WebViewActivity
- Introduced a boolean flag `isLobeChatVerified` to ensure LobeChat validation is executed only once for the initial page load.
- Modified `onPageFinished` in `WebViewClient` to check if the header contains "lobechat" text.
- Added logic to redirect the user back to `MainActivity` if the LobeChat validation fails.
- Prevent further validation checks on subsequent page loads once verified.
- This update ensures that unnecessary validation does not disrupt user activities, especially during interactions with third-party services like login.
2024-10-06 22:04:54 +08:00
moreoronce
8e4740c15d update 2024-10-06 22:04:54 +08:00
moreoronce
c2fd9c30ca feat: Implement back button handling using OnBackPressedDispatcher
- Replaced deprecated onBackPressed() method with OnBackPressedDispatcher for better handling of back navigation in WebView.
- Updated WebViewActivity to inject JavaScript to prevent PWA installation prompts.
- Improved file chooser functionality with ActivityResultLauncher.
- Enhanced user experience with Snackbar for error messages.
2024-10-06 22:04:53 +08:00
moreoronce
87a9abc1f2 update 2024-10-06 22:04:53 +08:00
moreoronce
e0bd5602ab feat: Add URL validation and prompt feature
- Implemented regular expression validation for the input URL in WebViewActivity.
- Display a prompt saying "Please enter a valid website address" if the URL format is incorrect.
- Maintained existing functionality to ensure that only valid URLs can be loaded.
- Split the WebView functionality from MainActivity into a separate page
2024-10-05 19:57:47 +08:00