Skip to content

Commit aef4d7d

Browse files
Feat: Add 'Run an Example' button and trigger AgentService
This commit introduces a new button on the main screen that allows users to run an example task. The "Run an Example" button is only visible when all the necessary permissions have been granted by the user. When clicked, it now starts the `AgentService` with the task "open youtube and play never gonna give you up", demonstrating the app's automation capabilities. This replaces the previous implementation where the button would simply open a YouTube link directly. Changes include: - Added a new button to `app/src/main/res/layout/activity_main.xml`. - Modified `app/src/main/java/com/blurr/voice/MainActivity.kt` to handle the button's visibility and to call `AgentService.start()` on click.
1 parent ede9931 commit aef4d7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/blurr/voice/MainActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import androidx.core.content.ContextCompat
3535
import androidx.core.net.toUri
3636
import androidx.core.graphics.toColorInt
3737
import androidx.lifecycle.lifecycleScope
38+
import com.blurr.voice.v2.AgentService
3839
import com.blurr.voice.services.EnhancedWakeWordService
3940
import com.blurr.voice.utilities.FreemiumManager
4041
import com.blurr.voice.utilities.OnboardingManager
@@ -331,9 +332,8 @@ class MainActivity : AppCompatActivity(), PaywallResultHandler {
331332
showDisclaimerDialog()
332333
}
333334
runExampleButton.setOnClickListener {
334-
val youtubeUrl = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
335-
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(youtubeUrl))
336-
startActivity(intent)
335+
val task = "open youtube and play never gonna give you up"
336+
AgentService.start(this, task)
337337
}
338338
}
339339

0 commit comments

Comments
 (0)