Closed talklittle closed 14 years ago
I second this very strongly. IMO, this should be pretty high priority as then reddit.com links submitted to reddit (such as a specific comment) will be much nicer, as I wouldn't have to scroll in and can use the same UI.
I have a fix here: albertb/reddit-is-fun@42aed8df1101316cc4c8848f392ca9ea2c0e197f
It works with links back to either threads or subreddits as well as individual comments (eg. the bestof reddit).
You have a bug in your fix: http://github.com/albertb/reddit-is-fun/commit/42aed8df1101316cc4c8848f392ca9ea2c0e197f#commitcomment-64845
Here are some example URLs that are not matched:
Thanks for the review and sample URLs. I fixed the regular expression to match them all, and fixed the download code for the case where the subreddit is missing from the URL.
I ended up writing some unit tests for the URLs, let me know if you'd like to incorporate them to the repo.
I'm a bit confused by github's compare view and whether it can be used for code reviews, but here's a link to all my changes (they span 4 commits in my repo): http://github.com/albertb/reddit-is-fun/compare/c890b601e9d783205add51614b09b59c962a94a0...master
Let me know what you think!
It looks good, but it also handles reddit links ending in .rss and .json, which it shouldn't. After that, I think you should ask talklittle about merging in your stuff.
Thanks a ton, albertb and eligrey. I have been hacking at my school project, sorry for lack of response. I have set aside a few hours (if need be) tomorrow for this and other patches, and hopefully push your updates to Android Market. Hold tight...
I just checked out the patch and tested a bit. Applied cleanly and works great! I'll put a new version with this patch right now. Thanks!
Did you add a fix for not handling URLs ending in .json and .rss too?
@eligrey Yes, see http://github.com/albertb/reddit-is-fun/commit/6639460f7386fee9c50c61386e5bfb5603ba832f
@talklittle Awesome!
Ah, didn't see that. Yeah, this looks great!
It's possible to have an intent-filter for HTTP URIs based on domain. All that is needed would be some pattern matching to direct the parsed URL to the correct Activity. (RedditIsFun for link to subreddit, RedditCommentsListActivity for link to thread, MoreChildrenActivity for link to a comment)