A checkerboard background is added to each image in the image view, so that when you load an image with a transparent background it's easier to visualize.
I may add this to images in the articles and feed icons as well if that is appreciated.
## Types of changes
- [x] I have read the **CONTRIBUTING** document.
- [x] My code follows the code style of this project.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] This is **NOT** translation related.
This closes issue #12
A checkerboard background is added to each image in the image view, so that when you load an image with a transparent background it's easier to visualize.
I may add this to images in the articles and feed icons as well if that is appreciated.
It's weird to have the checkboard background only on the image.
When I was testing, I saw this and thought it didn't work.
It would be better to have the checkboard as a background for the whole activity.
It's weird to have the checkboard background only on the image.
When I was testing, I saw this  and thought it didn't work.
It would be better to have the checkboard as a background for the whole activity.
That's actually quite easy to achieve. I did it this way because I felt it was unesthetic to have the whole screen checkered when that was unnecessary.
I hope this feature will be useful only rarely and thus I would prefer the checkerboard to appear sparingly to users without distracting when that's not necessary.
Moreover, this can be applied to the images within the articles as well and to the sources icons while setting the whole screen to a checkerboard can only be used in this screen.
If you prefer, I can set the whole screen to a checkerboard; but I feel this provides a cleaner interface which is also easier to the eye.
In general the user shouldn't be testing if a particular feature works all the time, it should just work when it's needed.
That's actually quite easy to achieve. I did it this way because I felt it was unesthetic to have the whole screen checkered when that was unnecessary.
I hope this feature will be useful only rarely and thus I would prefer the checkerboard to appear sparingly to users without distracting when that's not necessary.
Moreover, this can be applied to the images within the articles as well and to the sources icons while setting the whole screen to a checkerboard can only be used in this screen.
If you prefer, I can set the whole screen to a checkerboard; but I feel this provides a cleaner interface which is also easier to the eye.
In general the user shouldn't be testing if a particular feature works all the time, it should just work when it's needed.
I did it this way because I felt it was unesthetic to have the whole screen checkered when that was unnecessary.
Do you have a screenshot of the result with the whole screen checkered ? Because the screenshot I posted are unesthetic too.
Moreover, this can be applied to the images within the articles as well and to the sources icons
Is there anything preventing us from doing both ?
If you prefer, I can set the whole screen to a checkerboard; but I feel this provides a cleaner interface which is also easier to the eye.
I don't think that the white and checkered background is easy on the eye either.
In general the user shouldn't be testing if a particular feature works all the time, it should just work when it's needed.
So, is there a way to test if the image have a light background (in light mode) or a dark background (in dark mode) ? That way, we would only change the background when needed.
> I did it this way because I felt it was unesthetic to have the whole screen checkered when that was unnecessary.
Do you have a screenshot of the result with the whole screen checkered ? Because the screenshot I posted are unesthetic too.
> Moreover, this can be applied to the images within the articles as well and to the sources icons
Is there anything preventing us from doing both ?
> If you prefer, I can set the whole screen to a checkerboard; but I feel this provides a cleaner interface which is also easier to the eye.
I don't think that the white and checkered background is easy on the eye either.
> In general the user shouldn't be testing if a particular feature works all the time, it should just work when it's needed.
So, is there a way to test if the image have a light background (in light mode) or a dark background (in dark mode) ? That way, we would only change the background when needed.
I don't think that the white and checkered background is easy on the eye either.
The background was previously black, maybe that would be better.
So, is there a way to test if the image have a light background (in light mode) or a dark background (in dark mode) ? That way, we would only change the background when needed.
I think doing something like that would be quite difficult. I have found no libraries doing that and maintaining such feature would become a huge hassle since I can imagine a lot of problems and hedge cases arising.
Here is a screenshot with the full screen.
> Is there anything preventing us from doing both ?
No, not really.
> I don't think that the white and checkered background is easy on the eye either.
The background was previously black, maybe that would be better.
> So, is there a way to test if the image have a light background (in light mode) or a dark background (in dark mode) ? That way, we would only change the background when needed.
I think doing something like that would be quite difficult. I have found no libraries doing that and maintaining such feature would become a huge hassle since I can imagine a lot of problems and hedge cases arising.
I the screenshot whith the whole screen checkered, the checkboard is smaller than the other screenshots, and the image is very low quality, so I don't find this version better than the other.
I just tested a little bit, and found that setting android:background="?attr/colorOnBackground" to the Photoview works pretty well.
(In light mode)
(In dark mode)
I the screenshot whith the whole screen checkered, the checkboard is smaller than the other screenshots, and the image is very low quality, so I don't find this version better than the other.
I just tested a little bit, and found that setting `android:background="?attr/colorOnBackground"` to the `Photoview` works pretty well.
(In light mode)

(In dark mode)

You mean to set the background color? Yes, I have to insert that in so that the color changes according to the theme.
Here is a screenshot with the fullscreen background and the same image as the first one.
The advantage seems to be that the background does not change when you zoom in, while it gets zoomed does when you set it as the image background.
You mean to set the background color? Yes, I have to insert that in so that the color changes according to the theme.
Here is a screenshot with the fullscreen background and the same image as the first one.
The advantage seems to be that the background does not change when you zoom in, while it gets zoomed does when you set it as the image background.
The advantage seems to be that the background does not change when you zoom in
This should always be the case.
In all the screenshots here, the ones I prefer the most are the one in my previous comment.
> The advantage seems to be that the background does not change when you zoom in
This should always be the case.
In all the screenshots here, the ones I prefer the most are the one in my previous comment.
I added the background and this now produces views such as the ones you sent in your screenshots.
The main problem with this implementation is that the checkerboard background is static and gets zoomed in when you zoom in; thus the squares become larger when you zoom in.
I found no way to keep the checkered background just behind the image without it being zoomed with the image.
I can alternatively set the checkerboard to cover the whole background; this will also appear with images without any transparency.
I added the background and this now produces views such as the ones you sent in your screenshots.
The main problem with this implementation is that the checkerboard background is static and gets zoomed in when you zoom in; thus the squares become larger when you zoom in.
I found no way to keep the checkered background just behind the image without it being zoomed with the image.
I can alternatively set the checkerboard to cover the whole background; this will also appear with images without any transparency.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Types of changes
This closes issue #12
A checkerboard background is added to each image in the image view, so that when you load an image with a transparent background it's easier to visualize.
I may add this to images in the articles and feed icons as well if that is appreciated.
It's weird to have the checkboard background only on the image.
When I was testing, I saw this
and thought it didn't work.
It would be better to have the checkboard as a background for the whole activity.
That's actually quite easy to achieve. I did it this way because I felt it was unesthetic to have the whole screen checkered when that was unnecessary.
I hope this feature will be useful only rarely and thus I would prefer the checkerboard to appear sparingly to users without distracting when that's not necessary.
Moreover, this can be applied to the images within the articles as well and to the sources icons while setting the whole screen to a checkerboard can only be used in this screen.
If you prefer, I can set the whole screen to a checkerboard; but I feel this provides a cleaner interface which is also easier to the eye.
In general the user shouldn't be testing if a particular feature works all the time, it should just work when it's needed.
Do you have a screenshot of the result with the whole screen checkered ? Because the screenshot I posted are unesthetic too.
Is there anything preventing us from doing both ?
I don't think that the white and checkered background is easy on the eye either.
So, is there a way to test if the image have a light background (in light mode) or a dark background (in dark mode) ? That way, we would only change the background when needed.
Here is a screenshot with the full screen.
No, not really.
The background was previously black, maybe that would be better.
I think doing something like that would be quite difficult. I have found no libraries doing that and maintaining such feature would become a huge hassle since I can imagine a lot of problems and hedge cases arising.
I the screenshot whith the whole screen checkered, the checkboard is smaller than the other screenshots, and the image is very low quality, so I don't find this version better than the other.
I just tested a little bit, and found that setting
android:background="?attr/colorOnBackground"to thePhotoviewworks pretty well.(In light mode)

(In dark mode)

You mean to set the background color? Yes, I have to insert that in so that the color changes according to the theme.
Here is a screenshot with the fullscreen background and the same image as the first one.
The advantage seems to be that the background does not change when you zoom in, while it gets zoomed does when you set it as the image background.
This should always be the case.
In all the screenshots here, the ones I prefer the most are the one in my previous comment.
ae0909ef0atoc09a32e9adI added the background and this now produces views such as the ones you sent in your screenshots.
The main problem with this implementation is that the checkerboard background is static and gets zoomed in when you zoom in; thus the squares become larger when you zoom in.
I found no way to keep the checkered background just behind the image without it being zoomed with the image.
I can alternatively set the checkerboard to cover the whole background; this will also appear with images without any transparency.
Here is my proposition.
Looks good to me; you may merge this.