Commit graph

25 commits

Author SHA1 Message Date
Yawata
97293b44fd Merge branch 'master' of https://github.com/moreoronce/LobeChat-Android 2024-12-30 09:16:35 +08:00
Yawata
3d49ae565d feat: Add support for IP address:port access
Update regex to support IP address format
Improve URL handling logic for IP addresses
Update error message to reflect supported formats
fix: Allow cleartext HTTP traffic

Add android:usesCleartextTraffic="true" to AndroidManifest.xml
Fix err_cleartext_not_permitted error
perf: Optimize regex performance

Precompile regex patterns as constants
Use precompiled URL_PATTERN and IP_PATTERN for matching
Reduce CPU overhead on each button click
2024-12-30 09:13:26 +08:00
Yawata
12e696486e
Add files via upload
Add image
2024-10-07 18:29:00 +08:00
moreoronce
90cacdc914 Add back navigation support in WebViewActivity
- Fixed the implemented onBackPressed method to enable back navigation within the WebView.
2024-10-07 17:44:41 +08:00
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
e1314869dc - Delete unused resources 2024-10-06 22:06:55 +08:00
moreoronce
56b312ef82 - Update Colors.xml 2024-10-06 22:04:54 +08:00
moreoronce
80fccdd2d6 - Remove unused import and code 2024-10-06 22:04:54 +08:00
moreoronce
aea98ecf6f Add Spinner for URL selection and adjust layout
- Change Logo And aligned the logo with LobeHub SVG for better visual consistency.
- Adjusted the input field style to match the LobeChat design guidelines.
- Ensured proper padding, margins, and constraints for responsiveness across different screen sizes.
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
moreoronce
c4f50c2c14 feat: Update storage permission handling for image access
- Implemented request for READ_EXTERNAL_STORAGE permission to allow users to select images.
- Optimized permission request logic to avoid unnecessary prompts if permission has already been granted.
- Added user-friendly dialogs to guide users to app settings when permissions are denied.
- Enhanced error handling and logging for WebView to improve debugging and user experience.
- Loaded last entered URL from SharedPreferences for better usability.
- Updated UI interactions to hide input elements when loading web content.
- Remove unnecessary permission granted.

This update improves the overall user experience by streamlining the permission process and enhancing image selection functionality.
2024-10-05 19:06:53 +08:00
moreoronce
a2c84cc7f4 update 2024-10-05 16:39:59 +08:00
moreoronce
f54f9eed62 update 2024-10-05 16:30:20 +08:00
moreoronce
bbc565af33 fix Storage Permission Denied 2024-10-05 16:23:44 +08:00
moreoronce
a3169eb2f9 remove audio and video permission requests 2024-10-05 16:08:00 +08:00
moreoronce
dac1709acd add url input to use user's lobechat mirror 2024-10-05 15:55:43 +08:00
moreoronce
38d2280c93 add url input to use user's lobechat mirror 2024-10-05 14:25:31 +08:00
moreoronce
51dd4fccbb delete unnecessary import 2024-10-05 12:47:44 +08:00
moreoronce
1e3175db83 init 2024-10-05 12:35:47 +08:00