Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point to the same tag as the requested api level in the url for "view source" #28

Open
yrizk opened this issue Apr 15, 2017 · 2 comments

Comments

@yrizk
Copy link

yrizk commented Apr 15, 2017

basically change /ref/heads/master to the right tag level found here . Its something I find myself doing a quite a bit. Also, I think professional android developers use it to compare implementations of a class at an older version of android os. This would only apply to class and resource paths if the user decides he wants to look at google source code instead of git. Adding git would be trivial.

Additions would be to...
[ ] make /refs/heads/master a placeholder and fill it in with the current api level.
[ ] register a onChange listener for that api selector dropdown
[ ] map that number to the latest tag and update the url if it changes.

Things to consider:

  • new tags are added to AOSP as new rcs are made. The Android Team doesn't have a consistent rule or algorithm to determine when the the api level shifts to a new version of android. This means someone will have to go in and update the map to point to the right tag in the url. Obviously keeping current behaviour in states of uncertainty is advised.
    @romannurik , I'm curious if to see if you have ideas on this.

  • What if that class is not in that level?
    Previously, this was never a problem. nothing ever gets deleted, and head tracks all things. Now it will certainly break if you attempt to view JobService in api 12 or . At the same time, there is a big warning when you attempt to toggle into a lower api level, so I say the user was warned. Otherwise, I could write a function to determine if this class is unsupported and default to master in that case.

I've completed the first two bullet points, and the second half of the last bullet point.

@romannurik
Copy link
Owner

I likely won't have time to work on this but very open to pull requests! Seems like there'll need to be some sort of mapping file between branches and API levels, no immediate ideas on automating that though. Re: classes missing, could possibly insert HTML content into 404 pages that offers suggested alternative links (e.g. "This class seems to be missing... try the master branch")

@yrizk
Copy link
Author

yrizk commented Apr 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants