tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.5k stars 389 forks source link

Display @ mentions outside the content warning #292

Closed Vavassor closed 5 years ago

Vavassor commented 7 years ago

This is how the website displays them. Also, it makes it clear that the post is a reply and who it's replying to without having to "show more".

charlag commented 6 years ago

@connyduck still relevant? Did you decide against it?

connyduck commented 6 years ago

Well I would like Tusky to be quite similar to the web, and this is definitely something we should do, but it doesn't have any priority.

ariasuni commented 6 years ago

I thought this might not be too complicated to do so I checked the code a bit but I couldn’t find where toot displaying is done. Do you think it would be easy to do for someone not familiar with the code base? I’d like to have some pointers, and try to do that if I find the time.

charlag commented 6 years ago

@ariasuni I think it's totally doable and I would like to help! I think you need to look into StatusViewHolder If you need any additional help feel free to ping me here, on Masto or in our Riot room!

charlag commented 6 years ago

(or base view holder)

ariasuni commented 5 years ago

So I looked a bit at the code and managed to do something really buggy. I’m not sure how I can do that properly.

Here’s what I found:

I tried to change the text of the view instead of changing the visibility of the text. So here’s what I did:

But it needed some type casting (to store both texts as members of StatusBaseViewHolder). And the different string types used in Android aren’t always clear.

Also, it only worked in threaded view and not right away, only after having clicked on the spoiler button so I guess there are other places to look at.

Edit: here’s my code.

charlag commented 5 years ago

Hey, thanks for the changes! From your code I see that you use mentions array directly which is probably the easiest and the most sane option. I'm not sure which type casting you're referring to, tbh. I looked only briefly but it looks fine and should work fine too. For the future I would recommend opening a pull request. Even if it's WIP just make it clear. It's easier to review changes and keep track of all requests there (I stumbled upon this comment by accident now).

connyduck commented 5 years ago

I think you are on the right track, but this should be even simpler.