Haptic-Apps / Slide

Slide is an open-source, ad-free Reddit browser for Android.
https://reddit.com/r/slideforreddit
GNU General Public License v3.0
1.78k stars 344 forks source link

Use image, not emoji, for gold indicator #1832

Closed The0x539 closed 8 years ago

The0x539 commented 8 years ago

Looks weird on my aunt's S6 the way it is, it's gray and 3D.

Nxt3 commented 8 years ago

any suggestions? I don't think this will be easy given how we make the gilded status a SpannableText. Doubt we'd be able to use an image.

Nxt3 commented 8 years ago

Best we'd be able to do (for the easiest fix) is this: http://www.fileformat.info/info/unicode/char/2606/index.htm

But that looks ugly.

Alexendoo commented 8 years ago

If the font being used has the full star looking odd it would likely be the same for the empty one, as they're just one code point apart. Roboto doesn't provide a glyph for either unfortunately so it falls back to a local one. The normal one you'd expect to see is provided by noto sans symbols, might be possible to include a copy of the font.

Could also just blame Samsung for letting people set weird fonts as default

Nxt3 commented 8 years ago

I always blame Samsung.

Nxt3 commented 8 years ago

I think we should include a copy of the Noto Emoji font file. There is a black and white version available that only weighs in at 248KB.

Link to fonts

l3d00m commented 8 years ago

I think 0.25mb is quite a lot for such a small issue, I'm against this.

Alexendoo commented 8 years ago

The individual glyph(s) needed could be easily extracted and repackaged, however I think the bigger challenge is setting the fallback font which I couldn't find a good way of doing. That or we would need to patch in the extra glyphs to the included roboto typefaces

Nxt3 commented 8 years ago

I agree that the size is too large, but we could definitely extract the single glyph. Honestly though, this sounds like a lot of work for a Samsung issue.

freundTech commented 8 years ago

Adding an image to a SpannableText is possible and it's not even that hard:

int fontsize = a.getDimensionPixelSize(R.styleable.FontStyle_font_cardtitle, -1);  
float aspectRatio = (float) (1.00 * image.getWidth() / image.getHeight());
image = Bitmap.createScaledBitmap(image,
    (int) Math.ceil(fontsize * aspectRatio),
    (int) Math.ceil(fontsize), true);
icon.setSpan(new ImageSpan(mContext, image), 0, icon.length(), 0);

If anyone has a recommendation for what icon to use (Original reddit gold icon?) I could implement it.

Nxt3 commented 8 years ago

As long as you're still able to see the number of times gilded, feel free to use whatever icon. I say go with the original Reddit Gold icon. Make sure it's solid white.

freundTech commented 8 years ago

Just read up on Reddits licencing terms. Using reddits icons (even in reddit apps) is only possible with reddits approval: https://www.reddit.com/wiki/api (point 4).

I'll use a placeholder icon for now. Maybe someone could ask reddit for permission to use the gold icon later. Or we make our own.

Nxt3 commented 8 years ago

Boo. For now, find a vector star. Something simple. If you need help finding one, let me know. More than happy to help with semantics.

ccrama commented 8 years ago

Should be done now!