Skip to content

Conversation

@thatfiredev
Copy link
Member

@thatfiredev thatfiredev commented Sep 7, 2018

fixed #635

By the time I realized this wasn't one of the simplest quickstarts it was too late. It should probably be one of the last translations. My apologies

@samtstern
Copy link
Contributor

@rosariopfernandes thanks for jumping on this! Since the build is red here I went and reviewed the auth PR by @the-dagger first.

It may be useful for you to participate in that review as well (as an observer and a reviewer), I am sure the decisions we make over there will impact the work you're doing.

if (preview == null) {
Log.d(TAG, "Preview is null")
}
graphicOverlay = findViewById<View>(R.id.fireFaceOverlay) as GraphicOverlay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: should we use synthetic binding instead of findViewById?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the activity xml file uses the java.GraphicOverlay class, synthetic binding automatically casts it to the GraphicOverlay class from the java package.

An alternative to findViewById would be to create a second xml file for that activity and use the kotlin.GraphicOverlay class. But that would make this app different from the others.

Your thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh that's an interesting edge case! I'd say in this case we can leave the dependency on java then, thanks for pointing that out.

Copy link
Member Author

@thatfiredev thatfiredev Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samtstern This actually leads to runtime errors, since java.GraphicOverlay can't be cast to kotlin.GraphicOverlay.
I suggest we keep these classes written in java, but move them to a common package at the root of the quickstart so that they can be used in both the java and kotlin packages. The only classes written in kotlin would be the ones that actually make use of the ML Kit SDK.
I believe @the-dagger 's lint check would allow this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samtstern I need your thoughts on my comment above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rosariopfernandes apologies for not responding, moving to a .common package sounds like the right idea

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will do so.

@thatfiredev
Copy link
Member Author

@samtstern Thanks for your review here. Since there are a lot of files to be changed here (to remove all the !! and use lateinit on activities), I'd like to work on the other apps and let this be my last one (if you don't mind). Then I'll let you know when I update the PR with all the review feedback so that it can go through that last review before merge.
Is that ok?

@samtstern
Copy link
Contributor

@rosariopfernandes ok sounds good to me, let's put this one on hold.

Copy link
Contributor

@the-dagger the-dagger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor styling comments.

barcodes: List<FirebaseVisionBarcode>,
frameMetadata: FrameMetadata,
graphicOverlay: GraphicOverlay) {
graphicOverlay.clear()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : indentation here

@thatfiredev
Copy link
Member Author

@the-dagger Thanks a lot for reviewing this.

@samtstern I believe this one is ready to go.

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

Successfully merging this pull request may close these issues.

[Internal] Translate mlkit app to kotlin

3 participants