@@ -101,6 +101,8 @@ private ChanPerformer.ReadCaptchaResult solveEmojiCaptchaLoop(
101
101
int maxSize = Math .max (origKeyIcon .getHeight (), origKeyIcon .getWidth ());
102
102
Bitmap keyBitmap = Bitmap .createBitmap (maxSize , maxSize , Bitmap .Config .ARGB_8888 );
103
103
Canvas keyCanvas = new Canvas (keyBitmap );
104
+ // set key background to white so the black icon would not overlap with dark theme
105
+ keyCanvas .drawARGB (255 , 255 , 255 , 255 );
104
106
int x = Math .max ((origKeyIcon .getHeight () - origKeyIcon .getWidth ()) / 2 , 0 );
105
107
int y = Math .max ((origKeyIcon .getWidth () - origKeyIcon .getHeight ()) / 2 , 0 );
106
108
keyCanvas .drawBitmap (origKeyIcon , x , y , null );
@@ -227,6 +229,12 @@ private Bitmap createTaskWithSelectedBitmap(Bitmap captchaImage, SelectedEmojis
227
229
comboBitmap = Bitmap .createBitmap (width , height , Bitmap .Config .ARGB_8888 );
228
230
Canvas comboImage = new Canvas (comboBitmap );
229
231
232
+ // Ensure that captcha has white background, so we will have black
233
+ // selected icons on white canvas, despite of app theme
234
+ if (!selected .bitmaps .isEmpty ()) {
235
+ comboImage .drawARGB (255 , 255 , 255 , 255 );
236
+ }
237
+
230
238
for (int i = 0 ; i < selected .bitmaps .size (); i ++) {
231
239
comboImage .drawBitmap (selected .bitmaps .get (i ),
232
240
i * SelectedEmojis .SIZE_WITH_PADDING , 0f , null );
0 commit comments