-
Notifications
You must be signed in to change notification settings - Fork 365
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
Port of Spruce #12
Port of Spruce #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to come together and whiteboard an api design.
/** | ||
* SpruceView | ||
* <p> | ||
* Copyright (c) 2017 WillowTree, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should go at top of file. You can create a Copyright Profile in AS to auto-add these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to do that under File and Code Templates . I've added a Spruce copyright that now does the right thing. Thanks for calling that out.
* THE SOFTWARE. | ||
**/ | ||
|
||
public interface SortFunctionImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really get the impl distinction, why not just have the abstract class?
I'm also curious how often this recursive depth param comes up in practice, it will really complicate the implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial thought was to use the Impl as a sort of class schema but I can do without it.
* THE SOFTWARE. | ||
**/ | ||
|
||
public class SpruceView extends View implements SpruceViewImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to subclass a specific view? That's going to be really hard to do in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these view could definitely use javadocs and usage examples because I'm having trouble telling from the outside how to use a "SpruceView" or what it is supposed to do
<component name="Encoding"> | ||
<file url="PROJECT" charset="UTF-8" /> | ||
</component> | ||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to remove this, but is .idea in your gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is in the gitignore as well. not sure how they still ended up getting added
|
||
import java.util.List; | ||
|
||
public interface SortFunctionImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Impl
suffix usually implies that this is the implementation in java. If you want this to be the interface I'd use ISortFunction
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this usually in like... a LICENSE.txt instead of every file? If you want to change the LICENSE this is gonna be a HUGE pain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is. @jacksontaylor13 has it as headers for his files as well so I was copying him. You're right though, changing many is far more difficult than changing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tylerjromeo @bret-fears I was told by biz-dev that when releasing this publicly we would need to add the license to the header of each document. This is something that Apple has always done and a lot of open source iOS projects.
public abstract class SortFunction implements SortFunctionImpl { | ||
|
||
public List<SpruceTimedView> getTimeOffsets(SpruceView view) { | ||
return getTimeOffsets(view, /*recursiveDepth=*/0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool named param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't take credit for that. I saw @evant doing it before and adopted it since. I think he got it from AOSP
|
||
import java.util.List; | ||
|
||
public abstract class SortFunction implements SortFunctionImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use an abstract class with no abstract functions?
ab4d7d0
to
35f0883
Compare
e338129
to
d1f984e
Compare
I |
42db7bf
to
9dedc97
Compare
* @param timeOffset (long) time offset in milliseconds | ||
* @return List of SpruceTimedView objects that contain the view and it's offset | ||
*/ | ||
public abstract List<SpruceTimedView> getTimeOffsets(View view, long timeOffset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this take a ViewGroup
since it's returning a list of it's children?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good point.
Port of SortFunction and it's dependency of SpruceView -Create Spruce main class with build pattern API -Add base class for SortFunction to be extended Refactor - provide a builder pattern that takes a view group with the option of adding a sort function and an animator - Add java docs and comments - Remove redundant interfaces
64d9ea8
to
eb7c659
Compare
Port of SortFunction:
Refactor: