Re: [Ankidroid] does Ankidroid support SVG images?

1,519 views
Skip to first unread message

Nicolas Raoul

unread,
Apr 10, 2013, 8:39:07 PM4/10/13
to anki-android
Hi Fabio,

Apparently this is possible only from Android 3+
Reference: http://stackoverflow.com/questions/3889882/svg-support-on-android

If you are really very motivated you could try to generate them
on-the-fly with http://code.google.com/p/svg-android/

Cheers!
Nicolas Raoul

On Thu, Apr 11, 2013 at 6:18 AM, <fabio....@gmail.com> wrote:
> does Ankidroid support SVG images? It's impossible to see them on Android
> 2.1
>
> --
> You received this message because you are subscribed to the Google Groups
> "AnkiDroid" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to anki-android...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Xiao Sun

unread,
Jul 21, 2014, 6:44:22 PM7/21/14
to anki-a...@googlegroups.com
What about svg.png files? It does not seem to display properly on AD. 

I copy and paste the first image from http://en.wikipedia.org/wiki/Butterfly_(options), display fine on Anki, but this is what it looks like on AD 2.2

Xiao Sun

unread,
Jul 21, 2014, 6:54:26 PM7/21/14
to anki-a...@googlegroups.com
PS: The image displays fine when in Day Mode, but in Night Mode, AD tries to invert the colour of this image and only some of the some of the information is displayed as shown.

ospalh

unread,
Jul 22, 2014, 4:44:11 AM7/22/14
to anki-a...@googlegroups.com


Am Dienstag, 22. Juli 2014 00:54:26 UTC+2 schrieb Xiao Sun:
PS: The image displays fine when in Day Mode, but in Night Mode, AD tries to invert the colour of this image and only some of the some of the information is displayed as shown.

Hmm? AnkiDroid does not "try to invert" the colors. The image is gray and black texts/graphs on a transparent background. AD is correctly displaying it that way. I don't really think you can blame AD for that. It's just that the image you picked isn't suited to be displayed on a black background.

Xiao Sun

unread,
Jul 22, 2014, 9:24:41 AM7/22/14
to anki-a...@googlegroups.com
In that case, would it be possible to reverse such image format in Night Mode? Otherwise I will not be able to use these type of format which is fairly common on Wikipedia for science related articles.

Tim Rae

unread,
Jul 22, 2014, 9:28:42 AM7/22/14
to anki-a...@googlegroups.com

Possible and probable are different... probably easier to do it yourself using a 3rd party tool. You can def do it in Photoshop:

https://www.youtube.com/watch?v=63Wdt10lGoY

--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
To post to this group, send email to anki-a...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/anki-android/2e21e08b-26b9-4269-ad66-3254d06dcb7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xiao Sun

unread,
Jul 22, 2014, 9:32:30 AM7/22/14
to anki-a...@googlegroups.com
Lol Photoshop is too much, slows down card creation. I'll just use the Snipping tool in that case.

Nicolas Raoul

unread,
Jul 22, 2014, 10:08:04 AM7/22/14
to anki-android
Message has been deleted

ospalh

unread,
Jul 22, 2014, 11:08:39 AM7/22/14
to anki-a...@googlegroups.com


Am Dienstag, 22. Juli 2014 00:54:26 UTC+2 schrieb Xiao Sun:
PS: The image displays fine when in Day Mode, but in Night Mode, AD tries to invert the colour of this image and only some of the some of the information is displayed as shown.

I think i have found a way to solve your problem:

Use
.night_mode img {background-color: black;}
in the card styling.
  • Better copy-and-paste it to get the syntax right
  • Use "black" here. That will be translated to white. Or some other color, dark gray will be changed to light gray and so on.


Xiao Sun

unread,
Jul 22, 2014, 12:42:12 PM7/22/14
to anki-a...@googlegroups.com
Nice, i'll try that in the morning.

Xiao Sun

unread,
Jul 29, 2014, 6:18:48 AM7/29/14
to anki-a...@googlegroups.com
Thanks, it works very well. 

Is it possible to define background in night mode altogether?

It tried 

.night_mode {background-color: blue;}

It does not work.

ospalh

unread,
Jul 29, 2014, 8:05:54 AM7/29/14
to anki-a...@googlegroups.com


Am Dienstag, 29. Juli 2014 12:18:48 UTC+2 schrieb Xiao Sun:
Thanks, it works very well. 

Is it possible to define background in night mode altogether?

It tried 

.night_mode {background-color: blue;}

It does not work.

It has to be more specific than what AnkiDroid does. That's the way CSS works. That, again, gets translated and shows a yellow background. Try  for example

.night_mode.card {background-color: blue;}


That, again, gets translated and shows a yellow background.


Xiao Sun

unread,
Jul 29, 2014, 8:36:29 AM7/29/14
to anki-a...@googlegroups.com
I'm confused. 

So it's it .night_mode or .night_mode.card?

Flavio Lerda

unread,
Jul 29, 2014, 8:50:49 AM7/29/14
to anki-a...@googlegroups.com
CSS is complicated.

Each CSS selector defines what some style applies to.
There can be multiple CSS selector that apply to the same element.
In that case, the one that is more specific will be applied and the others ignored.

This is the formal definition of selectors:

This document gives you some examples and explanations:

This is a useful tool to experiment with selectors:

Use can also try using the "!important" with your attribute:

.night_mode {
  background-color: blue !important;
}

Flavio



--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
To post to this group, send email to anki-a...@googlegroups.com.

ospalh

unread,
Jul 29, 2014, 8:55:18 AM7/29/14
to anki-a...@googlegroups.com
You can also experiment with the styling with the SuperStyler add-on. Saves a lot of time when you are looking for e.g. just the right tone of your colors.

Xiao Sun

unread,
Jul 29, 2014, 9:13:06 AM7/29/14
to anki-a...@googlegroups.com
Geesh... so much to go through

I just DON'T want Night Mode to reverse the colour of my card content, the only reason why I use Night Mode is because I prefer the darker (why gray not black?) border to white.

Is there any way to tell AnkiDroid to not to touch any of my card styling while in Night Mode?

ospalh

unread,
Jul 29, 2014, 9:32:03 AM7/29/14
to anki-a...@googlegroups.com


Am Dienstag, 29. Juli 2014 15:13:06 UTC+2 schrieb Xiao Sun:


Is there any way to tell AnkiDroid to not to touch any of my card styling while in Night Mode?

Not without patching the source code.
N.B. that commit changes some other stuff to my quite personal taste as well. What you want is probably just take out the
"content = HtmlColors.invertColors(content);" line.

ospalh

unread,
Jul 29, 2014, 9:45:03 AM7/29/14
to anki-a...@googlegroups.com


Am Dienstag, 29. Juli 2014 15:13:06 UTC+2 schrieb Xiao Sun:


I just DON'T want Night Mode to reverse the colour of my card content, the only reason why I use Night Mode is because I prefer the darker border to white.

… or you could wait until version 2.17.0 or thereabout. I thought it would be nice to add a switch to toggle between the Holo and Holo light themes (black background vs. white background). I'm sure i will find the time to implement that any day now. Or not. 

Xiao Sun

unread,
Jul 29, 2014, 9:55:32 AM7/29/14
to anki-a...@googlegroups.com
To be honest, I think there should be two independent switches, one for general theme of the app, the other switch ask if the content of the card to be reverse. I would think that most desktop users would want their card content to be independent of the app theme.

What do other devs think?

Tim Rae

unread,
Jul 29, 2014, 9:59:53 AM7/29/14
to anki-a...@googlegroups.com
One switch for app theme -- which doesn't affect card styling, then Android specific CSS switch to set background of card maybe?
Not much point in discussing though really, unless someone is feeling motivated to implement themes


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
To post to this group, send email to anki-a...@googlegroups.com.

Xiao Sun

unread,
Jul 29, 2014, 10:54:59 AM7/29/14
to anki-a...@googlegroups.com
We should create theme packs and sell it on Play Store, the money goes to a trust fund where it can be used to pay external developers for urgent features or bug fixes...
Reply all
Reply to author
Forward
0 new messages