Skip to content

Instantly share code, notes, and snippets.

@erdalkaymak
Created January 18, 2021 08:33
Show Gist options
  • Select an option

  • Save erdalkaymak/3ed3b5535f5564805b7504d8df3048a4 to your computer and use it in GitHub Desktop.

Select an option

Save erdalkaymak/3ed3b5535f5564805b7504d8df3048a4 to your computer and use it in GitHub Desktop.
test
val task: Task<MLText> = analyzer.asyncAnalyseFrame(frame)
task.addOnSuccessListener {
txt_translate_result.visibility= View.VISIBLE
txt_to.visibility= View.VISIBLE
txt_translation.visibility= View.VISIBLE
toSpinner.visibility= View.VISIBLE
selected_img.visibility= View.VISIBLE
text_recognition_device_text.visibility= View.VISIBLE
text_recognition_device_text.setText(it.stringValue)
detectAndTranslateLanguage(it.stringValue, txt_translation,languageCode.toString(),applicationContext)
mytext=SharedPreferencesUtil.getInstance(applicationContext)!!.getStringValue("detectedLanguage")
Log.i("myDetectedLanguage",mytext!!)
txt_detect_result.text="Detected Result " + "("+getLanguage(mytext!!)+")"
txt_detect_result.visibility= View.VISIBLE
detectedText=it.stringValue
isEntered=true
SharedPreferencesUtil.getInstance(applicationContext)!!.deleteValue("detectedLanguage")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment