HabitRPG / habitica-android

Native Android app for Habitica
GNU General Public License v3.0
1.4k stars 505 forks source link

Custom Rewards have different titles on app, from computer version. #797

Closed thatrobotdev closed 6 years ago

thatrobotdev commented 6 years ago

In this photo, is my rewards list of custom rewards created from challenges on computer habitica: capture In this photo, is my rewards list of custom rewards created from challenges on mobile habitica: img_0146 See the difference? The second picture includes the part of the title that gives the challenge a photo. I propose on mobile, that this part is not shown to the user. Ex: ![image alt](image url)Image Title should only show Image Title. So, "![balist] (https://s2.postimg.org/m7d7jndu1/ballisa.png)Fire the Ballista!" should only show in the title of the reward "Fire the Ballista!"

Alys commented 6 years ago

Thanks for your report! In the case of your two Rewards where the images are there to add flavour, it wouldn't matter so much if they weren't shown, as you suggest, however other players might have tasks with images that are important to the meaning and so it would be helpful for them for the images to be shown in the mobile apps.

thatrobotdev commented 6 years ago

Oh, sorry if my text wasn't clear @Alys. I meant that the images would still be shown, but the messy text in the title wouldn't.

Maybe alt text for the image could still be shown, in a different way.

LunarGem commented 6 years ago

I could try to show the images, found some code on StackOverflow that I should be learning, great way to figure out if I know what I'm doing.

thatrobotdev commented 6 years ago

@LunarGem, that would be amazing!

phillipthelen commented 6 years ago

Which code would this be? Is it compatible with the markdown library we are using?

LunarGem commented 6 years ago

The second answer here or perhaps something else. I believe it's just an ImageView and internet permissions, but not sure what would mess with the markdown library.

LunarGem commented 6 years ago

I could also try to use Glide or Picasso.

phillipthelen commented 6 years ago

I don't think that actually helps in this case. Since the problem is about images embedded in the markdown. Which means there is not imageview that can be used to display any images, since they have to be embedded in the text.

LunarGem commented 6 years ago

Which markdown library do we use? Perhaps I could troubleshoot or find a workaround. An interesting idea would be allowing the user to set the custom reward image like the official rewards have. Then we could potentially not need this... Any thoughts? I'm just brainstorming.

Alys commented 6 years ago

@LunarGem The user might want to use two or more images in a Reward (or in any of their tasks), so allowing them to do that with markdown is the most flexible solution. The website uses this markdown library: https://github.com/HabitRPG/habitica-markdown I have no knowledge of how the app does markdown. :)

LunarGem commented 6 years ago

@Alys Did we have any plans of letting users set custom rewards images, though? It's something I've really wished were possible. I'll see what I can do looking at the library.

phillipthelen commented 6 years ago

setting custom images through markdown is possible (as alys mentioned), but we don't have plans to allow users to set a custom image that appears on the left side of the reward.

The Android app uses CWAC Anddown for markdown.

LunarGem commented 6 years ago

Okay so I've been thinking about this, and it looks like the images are recognized for what they are but aren't loaded. Any clue why that might be?

phillipthelen commented 6 years ago

I haven't looked further into how the images are currently handled yet. The original PR where markdown support was added can be found here: https://github.com/HabitRPG/habitica-android/pull/348 maybe there is some more info there.

phillipthelen commented 6 years ago

created an issue that better describes what is needed https://github.com/HabitRPG/habitica-android/issues/904