Commit bf2a069
refactor: use BaseActivity's loading indicator for Vshare WebView (#156)
* refactor: use BaseActivity's loading indicator for WebView
Replaced custom horizontal ProgressBar with BaseActivity's standard
circular loading indicator to maintain UI consistency across the app.
Changes:
- Removed custom ProgressBar from XML layout
- Removed @BindView for mProgressBar
- Removed WebChromeClient (no longer needed for progress tracking)
- Use showLoading() in onPageStarted()
- Use hideLoading() in onPageFinished()
This provides a cleaner, more consistent loading experience that
matches other activities like TopicActivity, using the app's standard
55dp circular ProgressBar centered on screen.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: prevent white flash when loading WebView in dark mode
Fixed the issue where WebView would briefly show white background
before the page finishes loading in dark mode.
Changes:
1. Set WebView background color to match theme before loading
- Dark mode: #1a1a1a (dark gray)
- Light mode: white
2. Enable FORCE_DARK on Android Q+ when in dark mode
- Automatically applies dark styling to web content
- Provides immediate dark appearance
This ensures a consistent visual experience from the moment the
WebView starts loading, eliminating the jarring white flash that
previously occurred in dark mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: hide WebView until theme is applied to prevent white flash
Changed approach to completely eliminate white flash in dark mode:
- Set WebView to INVISIBLE before loading
- Apply theme via JavaScript when page finishes loading
- Show WebView after 100ms delay to ensure JS executes
- Hide loading indicator when WebView becomes visible
This ensures users only see the WebView after the correct theme
has been fully applied, completely eliminating the white flash
that occurred during page load in dark mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: improve dark mode loading by setting WebView invisible in XML and increasing delay
- Set WebView visibility to invisible in XML layout to prevent initial white flash
- Increase delay from 100ms to 300ms to ensure theme JavaScript executes properly
- This eliminates the white screen gap during page load in dark mode
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: handle WebView loading errors to prevent persistent spinner
Address GitHub Copilot review feedback by adding error handling callbacks
to dismiss the loading indicator when page load fails.
Changes:
- Add onReceivedError() override to hide loading on network/SSL errors
- Add onReceivedHttpError() override to hide loading on HTTP errors
- Both callbacks also hide the theme overlay to restore UI state
This prevents the loading spinner from persisting indefinitely when
WebView encounters errors during page load.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* feat: add bottom margin to WebView for navigation bar spacing
Apply navigation bar height as bottom margin to prevent content from
being hidden under the navigation bar in fullscreen WebView.
Changes:
- Import Utils to access getNavigationBarHeight()
- Update applyStatusBarMargin() to also apply bottom margin
- Use Utils.getNavigationBarHeight() for bottom margin calculation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 10dfdb9 commit bf2a069
File tree
2 files changed
+88
-25
lines changed- app/src/main
- res/layout
2 files changed
+88
-25
lines changedLines changed: 85 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| |||
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
| |||
116 | 149 | | |
117 | 150 | | |
118 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
119 | 157 | | |
120 | 158 | | |
121 | 159 | | |
| |||
152 | 190 | | |
153 | 191 | | |
154 | 192 | | |
155 | | - | |
| 193 | + | |
156 | 194 | | |
157 | 195 | | |
158 | 196 | | |
| |||
165 | 203 | | |
166 | 204 | | |
167 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
168 | 224 | | |
169 | | - | |
170 | 225 | | |
171 | | - | |
172 | | - | |
173 | 226 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
179 | 241 | | |
180 | 242 | | |
181 | 243 | | |
182 | 244 | | |
183 | 245 | | |
184 | | - | |
| 246 | + | |
185 | 247 | | |
186 | 248 | | |
187 | 249 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
191 | 255 | | |
192 | | - | |
193 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
194 | 261 | | |
195 | 262 | | |
196 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | 17 | | |
0 commit comments