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

feat: Voice search implemented on skills listing #2202

Merged
merged 19 commits into from
Jun 8, 2019
Merged

feat: Voice search implemented on skills listing #2202

merged 19 commits into from
Jun 8, 2019

Conversation

atm1504
Copy link
Member

@atm1504 atm1504 commented May 14, 2019

Fixes #2082

Changes:
Added voice search icon in action bar, clicking on which prompts voice search.

Screenshots for the change:
ezgif com-video-to-gif

@auto-label auto-label bot added the feature label May 14, 2019
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault())

if (intent.resolveActivity(packageManager) != null) {
startActivityForResult(intent, 10)//Sends the detected query to search
Copy link
Member

Choose a reason for hiding this comment

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

Declare 10 as constant.

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
when (requestCode) {
10 -> if (resultCode == Activity.RESULT_OK && data != null) {
Copy link
Member

Choose a reason for hiding this comment

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

You declared it as constant, and still using directly.

@@ -92,4 +92,7 @@ object Constant {

//Visit Website Url
const val SUSI_VISIT_WEBSITE = "https://chat.susi.ai/"

//Voice search request code
const val VOICE_SEARCH_REQUEST_CODE = 10
Copy link
Member

Choose a reason for hiding this comment

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

Make it a local constant

@ci-reporter
Copy link

ci-reporter bot commented May 17, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 64ddcda. Here's the output:

Run Tests
> Task :app:preBuild UP-TO-DATE

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


Failed build for 1c41c86
Run Tests
> Task :app:preBuild UP-TO-DATE
Failed build for 4e66861
Run Tests
> Task :app:preBuild UP-TO-DATE
Failed build for 6ca9600
Run Tests
> Task :app:preBuild UP-TO-DATE
Failed build for d3a320c
Run Tests
> Task :app:preBuild UP-TO-DATE
Failed build for 7a0f279
spotless check
> Task :app:spotlessKotlin FAILED

This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@ci-reporter
Copy link

ci-reporter bot commented May 17, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 7a0f279. Here's the output:

spotless check
> Task :app:spotlessKotlin FAILED

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@atm1504
Copy link
Member Author

atm1504 commented May 20, 2019

@iamareebjamal please review it

@atm1504
Copy link
Member Author

atm1504 commented Jun 2, 2019

@iamareebjamal please review it

Copy link
Member

@liveHarshit liveHarshit left a comment

Choose a reason for hiding this comment

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

reset lgtm

super.onActivityResult(requestCode, resultCode, data)
when (requestCode) {
VOICE_SEARCH_REQUEST_CODE -> if (resultCode == Activity.RESULT_OK && data != null) {
val result = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS)
Copy link
Member

Choose a reason for hiding this comment

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

When and if statements can be combined

@atm1504
Copy link
Member Author

atm1504 commented Jun 6, 2019

@iamareebjamal @liveHarshit please review it.

Copy link
Member

@liveHarshit liveHarshit left a comment

Choose a reason for hiding this comment

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

Reset LGTM


override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if ((requestCode == VOICE_SEARCH_REQUEST_CODE) && (resultCode == Activity.RESULT_OK) && data != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Remove extra parentheses.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do check now.

@mariobehling mariobehling merged commit f11b2d0 into fossasia:development Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement voice search in susi
4 participants