diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/CCL.txt b/CCL.txt old mode 100644 new mode 100755 diff --git a/GPL.txt b/GPL.txt old mode 100644 new mode 100755 diff --git a/Licensing.txt b/Licensing.txt old mode 100644 new mode 100755 diff --git a/MITL.txt b/MITL.txt old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/framework/.DS_Store b/framework/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/framework/.DS_Store differ diff --git a/framework/.classpath b/framework/.classpath deleted file mode 100644 index 3f9691c..0000000 --- a/framework/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/java/.DS_Store b/java/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/java/.DS_Store differ diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index c036912..062afa8 100755 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -15,18 +15,23 @@ + + + + + + + android:targetSdkVersion="17" > - + android:label="@string/english_ime_name" android:allowBackup="true"> - - - + android:key="desktop_settings" + android:title="@string/desktop_settings_title" > - + + + + + + + + + + + + + + + + + + + android:summary="@string/contributor_ma_summary" + android:title="@string/contributor_ma" /> + + + + + + diff --git a/java/res/raw/emergency_error.mp3 b/java/res/raw/emergency_error.mp3 new file mode 100644 index 0000000..6f02d19 Binary files /dev/null and b/java/res/raw/emergency_error.mp3 differ diff --git a/java/res/raw/emergency_succes.mp3 b/java/res/raw/emergency_succes.mp3 new file mode 100644 index 0000000..a71eb4d Binary files /dev/null and b/java/res/raw/emergency_succes.mp3 differ diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml index f770b98..f88572c 100644 --- a/java/res/values-es-rUS/strings.xml +++ b/java/res/values-es-rUS/strings.xml @@ -1,248 +1,253 @@ - + - "Vibrar al pulsar tecla" - "Sonido al pulsar tecla" - "Corregir errores de escritura" - "Habilitar la introducción de corrección de errores" - "Errores de introducción de datos en vista horizontal" - "Permitir la corrección de error de entrada" - "Sugerencias de palabras" - "Corregir automáticamente la palabra anterior" - "Sugerencias de palabras" - "Configuración de sugerencia de palabras" - "Habilitar autocompletar al escribir" - "Autocompletar" - "Aumentar el tamaño del campo de texto" - "Ocultar sugerencias de palabras en la vista horizontal" - "Uso de mayúsculas auto." - "Escribir en mayúscula el principio de la frase" - "Puntuación automática" - "Correcciones rápidas" - "Corrige los errores tipográficos que se cometen con más frecuencia." - "Mostrar sugerencias" - "Muestra las palabras sugeridas mientras se escribe." - "Autocompletar" - "La barra espaciadora y los signos de puntuación insertan automáticamente la palabra resaltada." - "0" - "1" - "2" - "%s : Guardada" - "á" - "é" - "í" - "ó" - "úü" - "§ß" - "ñ" - "ç" - "ýÿ" - "i" - "Mantén pulsada una tecla para ver los caracteres acentuados (ø, ö, etc.)." - "Pulsa la tecla \"Atrás\" ↶ para cerrar el teclado en cualquier momento." - "Acceso a números y símbolos" - Mantén pulsada la palabra situada más a la izquierda para añadirla al diccionario - "Toca esta sugerencia para continuar »" - "Toca aquí para cerrar la sugerencia y comenzar a escribir." - "El teclado se abre cada vez que tocas un campo de texto" - Mantén pulsada una tecla para ver los caracteres acentuados\n(ø, ö, ô, ó, etc.) - "Toca esta tecla para cambiar al teclado de números y símbolos"\".\" - "Toca esta tecla de nuevo para volver a las letras" - "Mantén pulsada esta tecla para cambiar la configuración del teclado como, por ejemplo, la opción de autocompletar"\".\" - "¡Pruébalo!" - "Ir" - "Sig." - "Hecho" - "Enviar" - "?123" - "123" - "ABC" - "ALT" - "Abrir el teclado"\n\n\"Pulsa cualquier campo de texto.\" - "Cerrar el teclado"\n\n\"Pulsa la tecla \"Atrás\".\" - "Mantén pulsada una tecla para acceder a las opciones."\n\n\"Accede a los signos de puntuación y a los acentos.\" - "Configuración del teclado"\n\n"Mantén pulsada la tecla "\"?123\"\".\" - ".com" - ".net" - ".org" - ".gov" - ".edu" - "Teclado Tecla" - Configuración de Tecla Access - Método de entrada - Habilitar entrada de voz - Añade una tecla de acceso rápido a comandos de voz y reconocimiento de voz - Mostrar la tecla de acentos - Agrega una tecla que permite introducir caracteres acentuados y otras variantes - Configuración de entrada alternativa - Conectar al Tecla Shield - Bluetooth no soportado - Bluetooth desactivado - Intenta una conexión con un Tecla Shield cercano - Desconectar temporalmente el Tecla Shield - Selecciona para permitir que otro dispositivo se conecte al Tecla Shield - Modo pantalla completa - Utiliza la pantalla completa como un único pulsador - Activar siempre el altavoz - Activa el altavoz para llamadas de voz, comandos de voz y entrada de voz. - Mostrar teclado de navegación - Muestra un pequeño teclado para navegar cuando no se introduce texto - Tiempo de espera del teclado de navegación - Ajuste el retardo para que el teclado de navegación se oculte automáticamente - Ocultar teclado de navegación - Pulsa para símbolos - Pulsa para letras y números - Configuración de entrada Morse - Ajustar las preferencias y el modo de entrada Morse - Usar entrada Morse - Proporciona un método de entrada Morse que sustituye el teclado estándar - Mostrar guía Morse - Muestra un conjunto de claves/valores Morse arriba del teclado - Método de entrada Morse - Unidad de tiempo Morse - Seleccione su unidad de tiempo Morse - Configura la frecuencia de repetición - Ajustar la frecuencia de repetición de un punto/raya Morse cuando se mantiene presionado un interruptor - Configurar la frecuencia de repetición - Duración de pulsación larga para restablecimiento - Ajusta la duración de la pulsación larga para regresar a la pantalla de inicio - ¿Está seguro que desea restablecer las acciones predeterminadas? - - No - Mas rápido - Mas lento - "Hecho" - Configuración de escaneo - Ajustar el modo y la velocidad de escaneo - Activar auto-escaneo - Escanea el teclado automáticamente - Activar escaneo inverso - Escanea al pulsar el interruptor y selecciona al soltarlo - Velocidad de auto-escaneo - Ajusta la velocidad de escaneo - Configurar acciones de interruptores - Personaliza las acciones asignadas a cada interruptor de entrada - ECU 1 / Adelante - ECU 2 / Reversa - ECU 3 / Izquierda - ECU 4 / Derecha - Interruptor 1 - Interruptor 2 - Acción Tecla de ECU 1 / Adelante - Acción Tecla de ECU 2 / Reversa - Acción Tecla de ECU 3 / Izquierda - Acción Tecla de ECU 4 / Derecha - Acción Tecla de Interruptor 1 - Acción Tecla de Interruptor 2 - Acción Morse de ECU 1 / Adelante - Acción Morse de ECU 2 / Reversa - Acción Morse de ECU 3 / Izquierda - Acción Morse de ECU 4 / Derecha - Acción Morse de Interruptor 1 - Acción Morse de Interruptor 2 - Restablecer las acciones predeterminadas - Asignar valores predeterminados a las acciones de interruptores - Restablecer acciones de interruptores - Configuración avanzada - Conectando al Tecla Shield - No se puede conectar el Tecla Shield - Conexión al Tecla Shield cancelada - No hay ningún Tecla Shield en el radio de alcance - Buscando Tecla Shields. Espere por favor… - Método de entrada Morse habilitado - Método de entrada Morse deshabilitado - Interruptor de pantalla completa activado - Interruptor de pantalla completa desactivado - Por favor seleccione Tecla Access como su método de entrada por defecto antes de ajustar la configuración. - ¡No hay aplicaciones de reconocimiento de voz disponibles! - Voice Search no está instalado! - Entrada de voz de Tecla - Configurando Tecla… - Acerca de Tecla Access - El equipo - Los que hicieron de Tecla Acces una realidad - Equipo básico - Jan Richards - Manager & User Experience - Jorge Silva - Programador Principal - Mauricio Meza - Experiencia de usuario - Eric Wan - Programador Junior - Programadores - Eric Ma - Voluntario - Eric Ma - Voluntario - Eric Ma - Voluntario - Mejoras - Mats Lundalv - Cancelación automática de escaneo - Traductores - - "Ninguno" - "Básico" - "Avanzado" - - - @string/prediction_none - @string/prediction_basic - @string/prediction_full - - - Inmediatamente - Después de 4 segundos - Después de 8 segundos - Después de 15 segundos - Después de 30 segundos - Después de 60 segundos - Nunca - - - Nunca - 1000 ms - 950 ms - 900 ms - 850 ms - 800 ms - 750 ms - 700 ms - 650 ms - 600 ms - 550 ms - 500 ms - - - Ninguno - Escanea siguiente - Escanea anterior - Salir, cancelar - Selecciona elemento destacado - - - Ninguno - Punto (Morse) - Raya (Morse) - Final de caracter Morse - Retroceso (Morse) - Ocultar teclado Morse - - - Modo de triple interruptor - Mode de doble interruptor - Modo de interruptor único - - - 3 segundos - 6 segundos - 9 segundos - 12 segundos - 16 segundos - 20 segundos - 25 segundos - 32 segundos - 40 segundos - - + + "Vibrar al pulsar tecla" + "Sonido al pulsar tecla" + "Corregir errores de escritura" + "Habilitar la introducción de corrección de errores" + "Errores de introducción de datos en vista horizontal" + "Permitir la corrección de error de entrada" + "Sugerencias de palabras" + "Corregir automáticamente la palabra anterior" + "Sugerencias de palabras" + "Configuración de sugerencia de palabras" + "Habilitar autocompletar al escribir" + "Autocompletar" + "Aumentar el tamaño del campo de texto" + "Ocultar sugerencias de palabras en la vista horizontal" + "Uso de mayúsculas auto." + "Escribir en mayúscula el principio de la frase" + "Puntuación automática" + "Correcciones rápidas" + "Corrige los errores tipográficos que se cometen con más frecuencia." + "Mostrar sugerencias" + "Muestra las palabras sugeridas mientras se escribe." + "Autocompletar" + "La barra espaciadora y los signos de puntuación insertan automáticamente la palabra resaltada." + "0" + "1" + "2" + "%s : Guardada" + "á" + "é" + "í" + "ó" + "úü" + "§ß" + "ñ" + "ç" + "ýÿ" + "i" + "Mantén pulsada una tecla para ver los caracteres acentuados (ø, ö, etc.)." + "Pulsa la tecla \"Atrás\" ↶ para cerrar el teclado en cualquier momento." + "Acceso a números y símbolos" + Mantén pulsada la palabra situada más a la izquierda para añadirla al diccionario + "Toca esta sugerencia para continuar »" + "Toca aquí para cerrar la sugerencia y comenzar a escribir." + "El teclado se abre cada vez que tocas un campo de texto" + Mantén pulsada una tecla para ver los caracteres acentuados\n(ø, ö, ô, ó, etc.) + "Toca esta tecla para cambiar al teclado de números y símbolos"\".\" + "Toca esta tecla de nuevo para volver a las letras" + "Mantén pulsada esta tecla para cambiar la configuración del teclado como, por ejemplo, la opción de autocompletar"\".\" + "¡Pruébalo!" + "Ir" + "Sig." + "Hecho" + "Enviar" + "?123" + "123" + "ABC" + "ALT" + "Abrir el teclado"\n\n\"Pulsa cualquier campo de texto.\" + "Cerrar el teclado"\n\n\"Pulsa la tecla \"Atrás\".\" + "Mantén pulsada una tecla para acceder a las opciones."\n\n\"Accede a los signos de puntuación y a los acentos.\" + "Configuración del teclado"\n\n"Mantén pulsada la tecla "\"?123\"\".\" + ".com" + ".net" + ".org" + ".gov" + ".edu" + "Teclado Tecla" + Configuración de Tecla Access + Método de entrada + Habilitar entrada de voz + Añade una tecla de acceso rápido a comandos de voz y reconocimiento de voz + Mostrar la tecla de acentos + Agrega una tecla que permite introducir caracteres acentuados y otras variantes + Configuración de entrada alternativa + Conectar al Tecla Shield + Bluetooth no soportado + Bluetooth desactivado + Intenta una conexión con un Tecla Shield cercano + Desconectar temporalmente el Tecla Shield + Selecciona para permitir que otro dispositivo se conecte al Tecla Shield + Modo pantalla completa + Utiliza la pantalla completa como un único pulsador + Activar siempre el altavoz + Activa el altavoz para llamadas de voz, comandos de voz y entrada de voz. + Mostrar teclado de navegación + Muestra un pequeño teclado para navegar cuando no se introduce texto + Tiempo de espera del teclado de navegación + Ajuste el retardo para que el teclado de navegación se oculte automáticamente + Ocultar teclado de navegación + Pulsa para símbolos + Pulsa para letras y números + Configuración de entrada Morse + Ajustar las preferencias y el modo de entrada Morse + Usar entrada Morse + Proporciona un método de entrada Morse que sustituye el teclado estándar + Mostrar guía Morse + Muestra un conjunto de claves/valores Morse arriba del teclado + Método de entrada Morse + Unidad de tiempo Morse + Seleccione su unidad de tiempo Morse + Configura la frecuencia de repetición + Ajustar la frecuencia de repetición de un punto/raya Morse cuando se mantiene presionado un interruptor + Configurar la frecuencia de repetición + Duración de pulsación larga para restablecimiento + Ajusta la duración de la pulsación larga para regresar a la pantalla de inicio + ¿Está seguro que desea restablecer las acciones predeterminadas? + + No + Mas rápido + Mas lento + "Hecho" + Configuración de escaneo + Ajustar el modo y la velocidad de escaneo + Activar auto-escaneo + Escanea el teclado automáticamente + Activar escaneo inverso + Escanea al pulsar el interruptor y selecciona al soltarlo + Velocidad de auto-escaneo + Ajusta la velocidad de escaneo + Configurar acciones de interruptores + Personaliza las acciones asignadas a cada interruptor de entrada + ECU 1 / Adelante + ECU 2 / Reversa + ECU 3 / Izquierda + ECU 4 / Derecha + Interruptor 1 + Interruptor 2 + Acción Tecla de ECU 1 / Adelante + Acción Tecla de ECU 2 / Reversa + Acción Tecla de ECU 3 / Izquierda + Acción Tecla de ECU 4 / Derecha + Acción Tecla de Interruptor 1 + Acción Tecla de Interruptor 2 + Acción Morse de ECU 1 / Adelante + Acción Morse de ECU 2 / Reversa + Acción Morse de ECU 3 / Izquierda + Acción Morse de ECU 4 / Derecha + Acción Morse de Interruptor 1 + Acción Morse de Interruptor 2 + Restablecer las acciones predeterminadas + Asignar valores predeterminados a las acciones de interruptores + Restablecer acciones de interruptores + Configuración avanzada + Conectando al Tecla Shield + No se puede conectar el Tecla Shield + Conexión al Tecla Shield cancelada + No hay ningún Tecla Shield en el radio de alcance + Buscando Tecla Shields. Espere por favor… + Método de entrada Morse habilitado + Método de entrada Morse deshabilitado + Interruptor de pantalla completa activado + Interruptor de pantalla completa desactivado + Por favor seleccione Tecla Access como su método de entrada por defecto antes de ajustar la configuración. + ¡No hay aplicaciones de reconocimiento de voz disponibles! + Voice Search no está instalado! + Entrada de voz de Tecla + Configurando Tecla… + Acerca de Tecla Access + El equipo + Los que hicieron de Tecla Acces una realidad + Equipo básico + Jan Richards + Manager & User Experience + Jorge Silva + Programador Principal + Mauricio Meza + Experiencia de usuario + Eric Wan + Programador Junior + Programadores + Eric Ma + Voluntario + Elyas Bhy + Voluntario + Rishab Garg + Voluntario + Jeroen Teunissen + Teunissen Enabling + Mejoras + Mats Lundalv + Cancelación automática de escaneo + Traductores + + + "Ninguno" + "Básico" + "Avanzado" + + + @string/prediction_none + @string/prediction_basic + @string/prediction_full + + + Inmediatamente + Después de 4 segundos + Después de 8 segundos + Después de 15 segundos + Después de 30 segundos + Después de 60 segundos + Nunca + + + Nunca + 1000 ms + 950 ms + 900 ms + 850 ms + 800 ms + 750 ms + 700 ms + 650 ms + 600 ms + 550 ms + 500 ms + + + Ninguno + Escanea siguiente + Escanea anterior + Salir, cancelar + Selecciona elemento destacado + + + Ninguno + Punto (Morse) + Raya (Morse) + Final de caracter Morse + Retroceso (Morse) + Ocultar teclado Morse + + + Modo de triple interruptor + Mode de doble interruptor + Modo de interruptor único + + + 3 segundos + 6 segundos + 9 segundos + 12 segundos + 16 segundos + 20 segundos + 25 segundos + 32 segundos + 40 segundos + + + \ No newline at end of file diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml index f770b98..f88572c 100644 --- a/java/res/values-es/strings.xml +++ b/java/res/values-es/strings.xml @@ -1,248 +1,253 @@ - + - "Vibrar al pulsar tecla" - "Sonido al pulsar tecla" - "Corregir errores de escritura" - "Habilitar la introducción de corrección de errores" - "Errores de introducción de datos en vista horizontal" - "Permitir la corrección de error de entrada" - "Sugerencias de palabras" - "Corregir automáticamente la palabra anterior" - "Sugerencias de palabras" - "Configuración de sugerencia de palabras" - "Habilitar autocompletar al escribir" - "Autocompletar" - "Aumentar el tamaño del campo de texto" - "Ocultar sugerencias de palabras en la vista horizontal" - "Uso de mayúsculas auto." - "Escribir en mayúscula el principio de la frase" - "Puntuación automática" - "Correcciones rápidas" - "Corrige los errores tipográficos que se cometen con más frecuencia." - "Mostrar sugerencias" - "Muestra las palabras sugeridas mientras se escribe." - "Autocompletar" - "La barra espaciadora y los signos de puntuación insertan automáticamente la palabra resaltada." - "0" - "1" - "2" - "%s : Guardada" - "á" - "é" - "í" - "ó" - "úü" - "§ß" - "ñ" - "ç" - "ýÿ" - "i" - "Mantén pulsada una tecla para ver los caracteres acentuados (ø, ö, etc.)." - "Pulsa la tecla \"Atrás\" ↶ para cerrar el teclado en cualquier momento." - "Acceso a números y símbolos" - Mantén pulsada la palabra situada más a la izquierda para añadirla al diccionario - "Toca esta sugerencia para continuar »" - "Toca aquí para cerrar la sugerencia y comenzar a escribir." - "El teclado se abre cada vez que tocas un campo de texto" - Mantén pulsada una tecla para ver los caracteres acentuados\n(ø, ö, ô, ó, etc.) - "Toca esta tecla para cambiar al teclado de números y símbolos"\".\" - "Toca esta tecla de nuevo para volver a las letras" - "Mantén pulsada esta tecla para cambiar la configuración del teclado como, por ejemplo, la opción de autocompletar"\".\" - "¡Pruébalo!" - "Ir" - "Sig." - "Hecho" - "Enviar" - "?123" - "123" - "ABC" - "ALT" - "Abrir el teclado"\n\n\"Pulsa cualquier campo de texto.\" - "Cerrar el teclado"\n\n\"Pulsa la tecla \"Atrás\".\" - "Mantén pulsada una tecla para acceder a las opciones."\n\n\"Accede a los signos de puntuación y a los acentos.\" - "Configuración del teclado"\n\n"Mantén pulsada la tecla "\"?123\"\".\" - ".com" - ".net" - ".org" - ".gov" - ".edu" - "Teclado Tecla" - Configuración de Tecla Access - Método de entrada - Habilitar entrada de voz - Añade una tecla de acceso rápido a comandos de voz y reconocimiento de voz - Mostrar la tecla de acentos - Agrega una tecla que permite introducir caracteres acentuados y otras variantes - Configuración de entrada alternativa - Conectar al Tecla Shield - Bluetooth no soportado - Bluetooth desactivado - Intenta una conexión con un Tecla Shield cercano - Desconectar temporalmente el Tecla Shield - Selecciona para permitir que otro dispositivo se conecte al Tecla Shield - Modo pantalla completa - Utiliza la pantalla completa como un único pulsador - Activar siempre el altavoz - Activa el altavoz para llamadas de voz, comandos de voz y entrada de voz. - Mostrar teclado de navegación - Muestra un pequeño teclado para navegar cuando no se introduce texto - Tiempo de espera del teclado de navegación - Ajuste el retardo para que el teclado de navegación se oculte automáticamente - Ocultar teclado de navegación - Pulsa para símbolos - Pulsa para letras y números - Configuración de entrada Morse - Ajustar las preferencias y el modo de entrada Morse - Usar entrada Morse - Proporciona un método de entrada Morse que sustituye el teclado estándar - Mostrar guía Morse - Muestra un conjunto de claves/valores Morse arriba del teclado - Método de entrada Morse - Unidad de tiempo Morse - Seleccione su unidad de tiempo Morse - Configura la frecuencia de repetición - Ajustar la frecuencia de repetición de un punto/raya Morse cuando se mantiene presionado un interruptor - Configurar la frecuencia de repetición - Duración de pulsación larga para restablecimiento - Ajusta la duración de la pulsación larga para regresar a la pantalla de inicio - ¿Está seguro que desea restablecer las acciones predeterminadas? - - No - Mas rápido - Mas lento - "Hecho" - Configuración de escaneo - Ajustar el modo y la velocidad de escaneo - Activar auto-escaneo - Escanea el teclado automáticamente - Activar escaneo inverso - Escanea al pulsar el interruptor y selecciona al soltarlo - Velocidad de auto-escaneo - Ajusta la velocidad de escaneo - Configurar acciones de interruptores - Personaliza las acciones asignadas a cada interruptor de entrada - ECU 1 / Adelante - ECU 2 / Reversa - ECU 3 / Izquierda - ECU 4 / Derecha - Interruptor 1 - Interruptor 2 - Acción Tecla de ECU 1 / Adelante - Acción Tecla de ECU 2 / Reversa - Acción Tecla de ECU 3 / Izquierda - Acción Tecla de ECU 4 / Derecha - Acción Tecla de Interruptor 1 - Acción Tecla de Interruptor 2 - Acción Morse de ECU 1 / Adelante - Acción Morse de ECU 2 / Reversa - Acción Morse de ECU 3 / Izquierda - Acción Morse de ECU 4 / Derecha - Acción Morse de Interruptor 1 - Acción Morse de Interruptor 2 - Restablecer las acciones predeterminadas - Asignar valores predeterminados a las acciones de interruptores - Restablecer acciones de interruptores - Configuración avanzada - Conectando al Tecla Shield - No se puede conectar el Tecla Shield - Conexión al Tecla Shield cancelada - No hay ningún Tecla Shield en el radio de alcance - Buscando Tecla Shields. Espere por favor… - Método de entrada Morse habilitado - Método de entrada Morse deshabilitado - Interruptor de pantalla completa activado - Interruptor de pantalla completa desactivado - Por favor seleccione Tecla Access como su método de entrada por defecto antes de ajustar la configuración. - ¡No hay aplicaciones de reconocimiento de voz disponibles! - Voice Search no está instalado! - Entrada de voz de Tecla - Configurando Tecla… - Acerca de Tecla Access - El equipo - Los que hicieron de Tecla Acces una realidad - Equipo básico - Jan Richards - Manager & User Experience - Jorge Silva - Programador Principal - Mauricio Meza - Experiencia de usuario - Eric Wan - Programador Junior - Programadores - Eric Ma - Voluntario - Eric Ma - Voluntario - Eric Ma - Voluntario - Mejoras - Mats Lundalv - Cancelación automática de escaneo - Traductores - - "Ninguno" - "Básico" - "Avanzado" - - - @string/prediction_none - @string/prediction_basic - @string/prediction_full - - - Inmediatamente - Después de 4 segundos - Después de 8 segundos - Después de 15 segundos - Después de 30 segundos - Después de 60 segundos - Nunca - - - Nunca - 1000 ms - 950 ms - 900 ms - 850 ms - 800 ms - 750 ms - 700 ms - 650 ms - 600 ms - 550 ms - 500 ms - - - Ninguno - Escanea siguiente - Escanea anterior - Salir, cancelar - Selecciona elemento destacado - - - Ninguno - Punto (Morse) - Raya (Morse) - Final de caracter Morse - Retroceso (Morse) - Ocultar teclado Morse - - - Modo de triple interruptor - Mode de doble interruptor - Modo de interruptor único - - - 3 segundos - 6 segundos - 9 segundos - 12 segundos - 16 segundos - 20 segundos - 25 segundos - 32 segundos - 40 segundos - - + + "Vibrar al pulsar tecla" + "Sonido al pulsar tecla" + "Corregir errores de escritura" + "Habilitar la introducción de corrección de errores" + "Errores de introducción de datos en vista horizontal" + "Permitir la corrección de error de entrada" + "Sugerencias de palabras" + "Corregir automáticamente la palabra anterior" + "Sugerencias de palabras" + "Configuración de sugerencia de palabras" + "Habilitar autocompletar al escribir" + "Autocompletar" + "Aumentar el tamaño del campo de texto" + "Ocultar sugerencias de palabras en la vista horizontal" + "Uso de mayúsculas auto." + "Escribir en mayúscula el principio de la frase" + "Puntuación automática" + "Correcciones rápidas" + "Corrige los errores tipográficos que se cometen con más frecuencia." + "Mostrar sugerencias" + "Muestra las palabras sugeridas mientras se escribe." + "Autocompletar" + "La barra espaciadora y los signos de puntuación insertan automáticamente la palabra resaltada." + "0" + "1" + "2" + "%s : Guardada" + "á" + "é" + "í" + "ó" + "úü" + "§ß" + "ñ" + "ç" + "ýÿ" + "i" + "Mantén pulsada una tecla para ver los caracteres acentuados (ø, ö, etc.)." + "Pulsa la tecla \"Atrás\" ↶ para cerrar el teclado en cualquier momento." + "Acceso a números y símbolos" + Mantén pulsada la palabra situada más a la izquierda para añadirla al diccionario + "Toca esta sugerencia para continuar »" + "Toca aquí para cerrar la sugerencia y comenzar a escribir." + "El teclado se abre cada vez que tocas un campo de texto" + Mantén pulsada una tecla para ver los caracteres acentuados\n(ø, ö, ô, ó, etc.) + "Toca esta tecla para cambiar al teclado de números y símbolos"\".\" + "Toca esta tecla de nuevo para volver a las letras" + "Mantén pulsada esta tecla para cambiar la configuración del teclado como, por ejemplo, la opción de autocompletar"\".\" + "¡Pruébalo!" + "Ir" + "Sig." + "Hecho" + "Enviar" + "?123" + "123" + "ABC" + "ALT" + "Abrir el teclado"\n\n\"Pulsa cualquier campo de texto.\" + "Cerrar el teclado"\n\n\"Pulsa la tecla \"Atrás\".\" + "Mantén pulsada una tecla para acceder a las opciones."\n\n\"Accede a los signos de puntuación y a los acentos.\" + "Configuración del teclado"\n\n"Mantén pulsada la tecla "\"?123\"\".\" + ".com" + ".net" + ".org" + ".gov" + ".edu" + "Teclado Tecla" + Configuración de Tecla Access + Método de entrada + Habilitar entrada de voz + Añade una tecla de acceso rápido a comandos de voz y reconocimiento de voz + Mostrar la tecla de acentos + Agrega una tecla que permite introducir caracteres acentuados y otras variantes + Configuración de entrada alternativa + Conectar al Tecla Shield + Bluetooth no soportado + Bluetooth desactivado + Intenta una conexión con un Tecla Shield cercano + Desconectar temporalmente el Tecla Shield + Selecciona para permitir que otro dispositivo se conecte al Tecla Shield + Modo pantalla completa + Utiliza la pantalla completa como un único pulsador + Activar siempre el altavoz + Activa el altavoz para llamadas de voz, comandos de voz y entrada de voz. + Mostrar teclado de navegación + Muestra un pequeño teclado para navegar cuando no se introduce texto + Tiempo de espera del teclado de navegación + Ajuste el retardo para que el teclado de navegación se oculte automáticamente + Ocultar teclado de navegación + Pulsa para símbolos + Pulsa para letras y números + Configuración de entrada Morse + Ajustar las preferencias y el modo de entrada Morse + Usar entrada Morse + Proporciona un método de entrada Morse que sustituye el teclado estándar + Mostrar guía Morse + Muestra un conjunto de claves/valores Morse arriba del teclado + Método de entrada Morse + Unidad de tiempo Morse + Seleccione su unidad de tiempo Morse + Configura la frecuencia de repetición + Ajustar la frecuencia de repetición de un punto/raya Morse cuando se mantiene presionado un interruptor + Configurar la frecuencia de repetición + Duración de pulsación larga para restablecimiento + Ajusta la duración de la pulsación larga para regresar a la pantalla de inicio + ¿Está seguro que desea restablecer las acciones predeterminadas? + + No + Mas rápido + Mas lento + "Hecho" + Configuración de escaneo + Ajustar el modo y la velocidad de escaneo + Activar auto-escaneo + Escanea el teclado automáticamente + Activar escaneo inverso + Escanea al pulsar el interruptor y selecciona al soltarlo + Velocidad de auto-escaneo + Ajusta la velocidad de escaneo + Configurar acciones de interruptores + Personaliza las acciones asignadas a cada interruptor de entrada + ECU 1 / Adelante + ECU 2 / Reversa + ECU 3 / Izquierda + ECU 4 / Derecha + Interruptor 1 + Interruptor 2 + Acción Tecla de ECU 1 / Adelante + Acción Tecla de ECU 2 / Reversa + Acción Tecla de ECU 3 / Izquierda + Acción Tecla de ECU 4 / Derecha + Acción Tecla de Interruptor 1 + Acción Tecla de Interruptor 2 + Acción Morse de ECU 1 / Adelante + Acción Morse de ECU 2 / Reversa + Acción Morse de ECU 3 / Izquierda + Acción Morse de ECU 4 / Derecha + Acción Morse de Interruptor 1 + Acción Morse de Interruptor 2 + Restablecer las acciones predeterminadas + Asignar valores predeterminados a las acciones de interruptores + Restablecer acciones de interruptores + Configuración avanzada + Conectando al Tecla Shield + No se puede conectar el Tecla Shield + Conexión al Tecla Shield cancelada + No hay ningún Tecla Shield en el radio de alcance + Buscando Tecla Shields. Espere por favor… + Método de entrada Morse habilitado + Método de entrada Morse deshabilitado + Interruptor de pantalla completa activado + Interruptor de pantalla completa desactivado + Por favor seleccione Tecla Access como su método de entrada por defecto antes de ajustar la configuración. + ¡No hay aplicaciones de reconocimiento de voz disponibles! + Voice Search no está instalado! + Entrada de voz de Tecla + Configurando Tecla… + Acerca de Tecla Access + El equipo + Los que hicieron de Tecla Acces una realidad + Equipo básico + Jan Richards + Manager & User Experience + Jorge Silva + Programador Principal + Mauricio Meza + Experiencia de usuario + Eric Wan + Programador Junior + Programadores + Eric Ma + Voluntario + Elyas Bhy + Voluntario + Rishab Garg + Voluntario + Jeroen Teunissen + Teunissen Enabling + Mejoras + Mats Lundalv + Cancelación automática de escaneo + Traductores + + + "Ninguno" + "Básico" + "Avanzado" + + + @string/prediction_none + @string/prediction_basic + @string/prediction_full + + + Inmediatamente + Después de 4 segundos + Después de 8 segundos + Después de 15 segundos + Después de 30 segundos + Después de 60 segundos + Nunca + + + Nunca + 1000 ms + 950 ms + 900 ms + 850 ms + 800 ms + 750 ms + 700 ms + 650 ms + 600 ms + 550 ms + 500 ms + + + Ninguno + Escanea siguiente + Escanea anterior + Salir, cancelar + Selecciona elemento destacado + + + Ninguno + Punto (Morse) + Raya (Morse) + Final de caracter Morse + Retroceso (Morse) + Ocultar teclado Morse + + + Modo de triple interruptor + Mode de doble interruptor + Modo de interruptor único + + + 3 segundos + 6 segundos + 9 segundos + 12 segundos + 16 segundos + 20 segundos + 25 segundos + 32 segundos + 40 segundos + + + \ No newline at end of file diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml index 1d71bba..818cb89 100644 --- a/java/res/values-fr/strings.xml +++ b/java/res/values-fr/strings.xml @@ -1,248 +1,253 @@ - + - Vibrer à chaque touche - Son à chaque touche - Corriger les fautes de frappe - "Activer la correction des erreurs de saisie" - Fautes de frappe en mode paysage - "Activer la correction des erreurs de saisie" - Saisie prédictive - Corriger automatiquement le mot précédent - Suggestion de mots - "Paramètres de la saisie prédictive" - Activer la saisie semi-automatique - Saisie semi-automatique - Agrandir le champ de texte - Masquer la saisie prédictive en mode paysage - Majuscules automatiques - Mettre en majuscule la première lettre de chaque phrase - Ponctuation automatique - Corrections rapides - Corrige les fautes de frappe courantes - Afficher les suggestions - Afficher les suggestions de termes lors de la saisie - Saisie semi-automatique - La barre d\'espace et la ponctuation insèrent automatiquement le mot surligné - 0 - 1 - 2 - %s : Enregistré - àâæ - èéêë - îï - ôœ - ùûü - §ß - "ñ" - ç - "ýÿ" - i - Maintenir une touche enfoncée pour afficher les accents (à, é, etc.) - Appuyez sur la touche Retour ↶ pour fermer le clavier à tout moment - Accéder aux chiffres et aux symboles - Appuyer et maintenir le doigt sur le mot le plus à gauche pour l\'ajouter au dictionnaire - Touchez ce conseil pour continuer - Touchez ici pour fermer ce conseil et commencer à saisir votre texte ! - Le clavier s\'affiche à chaque fois que vous touchez une zone de texte - Maintenez & une touche enfoncée pour afficher les accents\n(ø, ö, ô, ó, etc.)" - Appuyez sur cette touche pour basculer vers les chiffres et les symboles - Retourner aux lettres en appuyant de nouveau sur cette touche - Maintenez cette touche enfoncée afin de modifier les paramètres du clavier, tels que la saisie semi-automatique - Essayez ! - Go - Suivant - Terminé - Envoyer - \?123 - 123 - ABC - ALT - Ouvrir le clavier\n\nAppuyez sur un champ de texte. - Fermer le clavier\n\nAppuyez sur la touche Retour. - Appuyer sur une touche de manière prolongée pour accéder aux options\n\nAccédez à la ponctuation et aux accents. - Paramètres du clavier\n\nAppuyez et maintenez la touche\?123\. - ".com" - ".net" - ".org" - ".gov" - ".edu" - Tecla Access - Paramètres de Tecla Access - Méthode d\'entrée - Activer la reconnaissance vocale - Ajoute une touche pour un accès rapide aux commandes vocales et à la reconnaissance vocale - Montrer les touches des accents - Ajoute une touche rémanente qui active les caractères accentués et les caractères spéciaux - Paramètres des entrées alternatives - Se connecter au Tecla Shield - Bluetooth n\'est pas pris en charge - Bluetooth est désactivé - Tente une connexion à un Tecla Shield à proximité - Déconnecter temporairement le Tecla Shield - Cocher pour permettre à un autre appareil de se connecter au Tecla Shield - Interrupteur en mode plein écran - Utiliser l\'écran entier comme un seul interrupteur - Toujours utiliser le téléphone en mode haut-parleur - Pour les appels vocaux, les commandes vocales et les entrées vocales, utiliser le téléphone en mode haut-parleur. - Montrer le clavier de navigation - Montre un petit clavier de navigation quand aucun texte n\'est introduit - Temps avant disparition du clavier de Navigation - Ajuste le délai avant que le clavier de navigation ne se masque automatiquement - Masquer le clavier de navigation - Enfoncer pour afficher les symboles - Appuyer pour saisir des lettres et des chiffres - Paramètres d\'entrée de morse - Régler les préférences du mode d\'entrée Morse - Activer le mode d\'entrée Morse - Fournit un mode d\'entrée de morse qui remplace le clavier standard - Voir le guide du mode d\'entrée Morse - Affiche un ensemble de clés/valeurs Morse au-dessus du clavier - Mode d\'entrée Morse - Unité de temps Morse - Sélectionnez votre unité de temps Morse - Configurer la fréquence de répétition - Ajuster la fréquence de répétition d\'un dit/dah lorsqu\'un commutateur est enfoncé - Configurer la fréquence de répétition - Délai de réinitialisation avec pression longue - Ajuster le délai de la pression longue avant de retourner à l\'écran d\'accueil - Êtes-vous sûr de vouloir réinitialiser les actions par défaut ? - Oui - Non - Plus rapide - Plus lent - Terminé - Paramètres de numérisation - Régler la vitesse ainsi que le mode de balayage - Activer le self-scanning - Scanne le clavier automatiquement - Activer le scan inverse - Scanner lorsque l\'interrupteur est pressé et sélectionner quand il est relâché - Vitesse de scan - Ajuste la vitesse de scan - Configurer les actions des commutateurs - Personnaliser les actions assignées à chaque commutateur - ECU 1 / Avant - ECU 2 / Inverse - ECU 3 / Gauche - ECU 4 / Droite - Commutateur 1 - Commutateur 2 - ECU 1 / Action de Tecla en avant - ECU 2 / Action de Tecla en inverse - ECU 3 / Action de Tecla à gauche - ECU 4 / Action de Tecla à droite - Action Tecla pour Commutateur 1 - Action Tecla pour Commutateur 2 - ECU 1 / Action du morse en avant - ECU 2 / Action du morse en inverse - ECU 3 / Action du morse à gauche - ECU 4 / Action du morse à droite - Action Morse pour Commutateur 1 - Action Morse pour Commutateur 2 - Rétablir les actions par défaut - Réinitialisation des actions des commutateurs aux valeurs par défaut - Réinitialisation des actions des commutateurs - Paramètres d\'entrées avancés - Connexion au Tecla Shield - Impossible de se connecter au Tecla Shield - Connexion au Tecla Shield annulé - Pas de Tecla Shield à portée - Recherche de Tecla Shields. Veuillez patienter… - Méthode d\'entrée Morse activé - Méthode d\'entrée Morse désactivé - Interrupteur en mode plein écran activé - Interrupteur en mode plein écran désactivé - Sélectionnez Tecla Access comme votre mode d\'entrée par défaut avant de régler les paramètres. - Aucune application de reconnaissance vocale disponible ! - Voice Search n\'est pas installé! - Entrée vocale Tecla - Configuration de Tecla… - À propos de Tecla Access - L\'équipe - En savoir plus à propos des créateurs de Tecla - L\'équipe de base - Jan Richards - Manager & User Experience - Jorge Silva - Developpeur sénior - Mauricio Meza - L\'expérience utilisateur - Eric Wan - Développeur junior - Programmeurs - Eric Ma - Bénévoles - Eric Ma - Bénévoles - Eric Ma - Bénévoles - Améliorations - Mats Lundalv - Auto-annuler le balayage - Traducteurs - - Aucun - Basique - Avancé - - - @string/prediction_none - @string/prediction_basic - @string/prediction_full - - - Immédiatement - Après 4 secondes - Après 8 secondes - Après 15 secondes - Après 30 secondes - Après 60 secondes - Jamais - - - Jamais - 1000 ms - 950 ms - 900 ms - 850 ms - 800 ms - 750 ms - 700 ms - 650 ms - 600 ms - 550 ms - 500 ms - - - Aucun - Step-scan suivant - Step-scan précédent - Annuler - Sélectionnez le surligné - - - Aucun - Dit Morse - Dah Morse - Charactère de fin Morse - Retour arrière Morse - Cacher la vue de l\'IME Morse - - - Mode triple-touche - Mode double-touche - Mode touche unique - - - 3 secondes - 6 secondes - 9 secondes - 12 secondes - 16 secondes - 20 secondes - 25 secondes - 32 secondes - 40 secondes - - + + Vibrer à chaque touche + Son à chaque touche + Corriger les fautes de frappe + "Activer la correction des erreurs de saisie" + Fautes de frappe en mode paysage + "Activer la correction des erreurs de saisie" + Saisie prédictive + Corriger automatiquement le mot précédent + Suggestion de mots + "Paramètres de la saisie prédictive" + Activer la saisie semi-automatique + Saisie semi-automatique + Agrandir le champ de texte + Masquer la saisie prédictive en mode paysage + Majuscules automatiques + Mettre en majuscule la première lettre de chaque phrase + Ponctuation automatique + Corrections rapides + Corrige les fautes de frappe courantes + Afficher les suggestions + Afficher les suggestions de termes lors de la saisie + Saisie semi-automatique + La barre d\'espace et la ponctuation insèrent automatiquement le mot surligné + 0 + 1 + 2 + %s : Enregistré + àâæ + èéêë + îï + ôœ + ùûü + §ß + "ñ" + ç + "ýÿ" + i + Maintenir une touche enfoncée pour afficher les accents (à, é, etc.) + Appuyez sur la touche Retour ↶ pour fermer le clavier à tout moment + Accéder aux chiffres et aux symboles + Appuyer et maintenir le doigt sur le mot le plus à gauche pour l\'ajouter au dictionnaire + Touchez ce conseil pour continuer + Touchez ici pour fermer ce conseil et commencer à saisir votre texte ! + Le clavier s\'affiche à chaque fois que vous touchez une zone de texte + Maintenez & une touche enfoncée pour afficher les accents\n(ø, ö, ô, ó, etc.)" + Appuyez sur cette touche pour basculer vers les chiffres et les symboles + Retourner aux lettres en appuyant de nouveau sur cette touche + Maintenez cette touche enfoncée afin de modifier les paramètres du clavier, tels que la saisie semi-automatique + Essayez ! + Go + Suivant + Terminé + Envoyer + \?123 + 123 + ABC + ALT + Ouvrir le clavier\n\nAppuyez sur un champ de texte. + Fermer le clavier\n\nAppuyez sur la touche Retour. + Appuyer sur une touche de manière prolongée pour accéder aux options\n\nAccédez à la ponctuation et aux accents. + Paramètres du clavier\n\nAppuyez et maintenez la touche\?123\. + ".com" + ".net" + ".org" + ".gov" + ".edu" + Tecla Access + Paramètres de Tecla Access + Méthode d\'entrée + Activer la reconnaissance vocale + Ajoute une touche pour un accès rapide aux commandes vocales et à la reconnaissance vocale + Montrer les touches des accents + Ajoute une touche rémanente qui active les caractères accentués et les caractères spéciaux + Paramètres des entrées alternatives + Se connecter au Tecla Shield + Bluetooth n\'est pas pris en charge + Bluetooth est désactivé + Tente une connexion à un Tecla Shield à proximité + Déconnecter temporairement le Tecla Shield + Cocher pour permettre à un autre appareil de se connecter au Tecla Shield + Interrupteur en mode plein écran + Utiliser l\'écran entier comme un seul interrupteur + Toujours utiliser le téléphone en mode haut-parleur + Pour les appels vocaux, les commandes vocales et les entrées vocales, utiliser le téléphone en mode haut-parleur. + Montrer le clavier de navigation + Montre un petit clavier de navigation quand aucun texte n\'est introduit + Temps avant disparition du clavier de Navigation + Ajuste le délai avant que le clavier de navigation ne se masque automatiquement + Masquer le clavier de navigation + Enfoncer pour afficher les symboles + Appuyer pour saisir des lettres et des chiffres + Paramètres d\'entrée de morse + Régler les préférences du mode d\'entrée Morse + Activer le mode d\'entrée Morse + Fournit un mode d\'entrée de morse qui remplace le clavier standard + Voir le guide du mode d\'entrée Morse + Affiche un ensemble de clés/valeurs Morse au-dessus du clavier + Mode d\'entrée Morse + Unité de temps Morse + Sélectionnez votre unité de temps Morse + Configurer la fréquence de répétition + Ajuster la fréquence de répétition d\'un dit/dah lorsqu\'un commutateur est enfoncé + Configurer la fréquence de répétition + Délai de réinitialisation avec pression longue + Ajuster le délai de la pression longue avant de retourner à l\'écran d\'accueil + Êtes-vous sûr de vouloir réinitialiser les actions par défaut ? + Oui + Non + Plus rapide + Plus lent + Terminé + Paramètres de numérisation + Régler la vitesse ainsi que le mode de balayage + Activer le self-scanning + Scanne le clavier automatiquement + Activer le scan inverse + Scanner lorsque l\'interrupteur est pressé et sélectionner quand il est relâché + Vitesse de scan + Ajuste la vitesse de scan + Configurer les actions des commutateurs + Personnaliser les actions assignées à chaque commutateur + ECU 1 / Avant + ECU 2 / Inverse + ECU 3 / Gauche + ECU 4 / Droite + Commutateur 1 + Commutateur 2 + ECU 1 / Action de Tecla en avant + ECU 2 / Action de Tecla en inverse + ECU 3 / Action de Tecla à gauche + ECU 4 / Action de Tecla à droite + Action Tecla pour Commutateur 1 + Action Tecla pour Commutateur 2 + ECU 1 / Action du morse en avant + ECU 2 / Action du morse en inverse + ECU 3 / Action du morse à gauche + ECU 4 / Action du morse à droite + Action Morse pour Commutateur 1 + Action Morse pour Commutateur 2 + Rétablir les actions par défaut + Réinitialisation des actions des commutateurs aux valeurs par défaut + Réinitialisation des actions des commutateurs + Paramètres d\'entrées avancés + Connexion au Tecla Shield + Impossible de se connecter au Tecla Shield + Connexion au Tecla Shield annulé + Pas de Tecla Shield à portée + Recherche de Tecla Shields. Veuillez patienter… + Méthode d\'entrée Morse activé + Méthode d\'entrée Morse désactivé + Interrupteur en mode plein écran activé + Interrupteur en mode plein écran désactivé + Sélectionnez Tecla Access comme votre mode d\'entrée par défaut avant de régler les paramètres. + Aucune application de reconnaissance vocale disponible ! + Voice Search n\'est pas installé! + Entrée vocale Tecla + Configuration de Tecla… + À propos de Tecla Access + L\'équipe + En savoir plus à propos des créateurs de Tecla + L\'équipe de base + Jan Richards + Manager & User Experience + Jorge Silva + Developpeur sénior + Mauricio Meza + L\'expérience utilisateur + Eric Wan + Développeur junior + Programmeurs + Eric Ma + Bénévoles + Elyas Bhy + Bénévoles + Rishab Garg + Bénévoles + Jeroen Teunissen + Teunissen Enabling + Améliorations + Mats Lundalv + Auto-annuler le balayage + Traducteurs + + + Aucun + Basique + Avancé + + + @string/prediction_none + @string/prediction_basic + @string/prediction_full + + + Immédiatement + Après 4 secondes + Après 8 secondes + Après 15 secondes + Après 30 secondes + Après 60 secondes + Jamais + + + Jamais + 1000 ms + 950 ms + 900 ms + 850 ms + 800 ms + 750 ms + 700 ms + 650 ms + 600 ms + 550 ms + 500 ms + + + Aucun + Step-scan suivant + Step-scan précédent + Annuler + Sélectionnez le surligné + + + Aucun + Dit Morse + Dah Morse + Charactère de fin Morse + Retour arrière Morse + Cacher la vue de l\'IME Morse + + + Mode triple-touche + Mode double-touche + Mode touche unique + + + 3 secondes + 6 secondes + 9 secondes + 12 secondes + 16 secondes + 20 secondes + 25 secondes + 32 secondes + 40 secondes + + + \ No newline at end of file diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml index d946871..16d28c3 100644 --- a/java/res/values-nl/strings.xml +++ b/java/res/values-nl/strings.xml @@ -1,248 +1,279 @@ - + - "Trillen bij druk op een toets" - "Geluid bij druk op een toets" - "Typefouten corrigeren" - "Foutcorrectie tijdens invoer inschakelen" - "Invoerfouten in liggende weergave" - "Foutcorrectie tijdens invoer inschakelen" - "Woordsuggesties" - "Het vorige woord automatisch corrigeren" - "Woordsuggesties" - "Instellingen voor woordsuggesties" - "Automatisch voltooien tijdens typen inschakelen" - "Automatisch voltooien" - "Tekstveld vergroten" - "Woordsuggesties verbergen in liggende weergave" - "Automatisch hoofdlettergebruik" - "Hoofdletter gebruiken aan het begin van een zin" - "Automatische interpunctie" - "Snelle oplossingen" - "Hiermee worden veelvoorkomende typefouten gecorrigeerd" - "Suggesties weergeven" - "Voorgestelde woorden weergeven tijdens typen" - "Auto-aanvullen" - "Gemarkeerd woord automatisch invoegen met spatiebalk en interpunctie" - "0" - "1" - "2" - "%s : Opgeslagen" - "àáâãäåæ" - "èéêë" - "ìíîï" - "òóöø" - "ùúûü" - "§ß" - "" - "" - "" - "i" - "Houd een toets ingedrukt om diakritische tekens weer te geven (ø, ö, enzovoort)" - "Druk op elk gewenst moment op de toets Terug ↶ om het toetsenbord te sluiten" - "Toegang tot cijfers en symbolen" - Houd het meest linkse woord ingedrukt om het toe te voegen aan het woordenboek - "Raak deze tip aan om door te gaan »" - "Raak dit punt aan om deze tip te sluiten en te beginnen met typen." - "Het toetsenbord wordt geopend wanneer u een tekstveld aanraakt" - Raak de sleutel aan en hou het ingedrukt om accenten te zien (ø, ö, ô, ó, enz.) - "Schakel over naar cijfers en symbolen door deze toets aan te raken" - "Ga terug naar letters door deze toets nogmaals aan te raken" - "Blijf deze toets aanraken om toetsenbordinstellingen te wijzigen, zoals auto-aanvullen" - "Probeer het zelf!" - "Beginnen" - "Volgende" - "Gereed" - "Verzenden" - "?123" - "123" - "ABC" - "Alt" - "Het toetsenbord openen"\n\n\"Raak een tekstveld aan.\" - "Het toetsenbord sluiten"\n\n\"Druk op de terugtoets.\" - "Een toets blijven aanraken voor opties"\n\n\"Toegang tot interpunctie en diakritische tekens.\" - "Toetsenbordinstellingen"\n\n"Blijf de toets "\"?123\"\" aanraken.\" - ".com" - ".net" - ".org" - ".gov" - ".edu" - "Tecla-toetsenbord" - Tecla Access instellingen - Invoer methode - Maak stem ingave mogelijk - Voegt een toets toe voor snelle toegang tot gesproken commando\'s en spraakherkenning - Toon accenten toets - Laat sticky key zien waarmee tekens met accenten en andere varianten worden toegevoegd - Alternatieve invoer instellingen - Verbinding maken met Tecla Shield - Bluetooth is niet ondersteund - Bluetooth is uitgeschakeld - Probeert een verbinding met een nabijgelegen Tecla Shield te maken - Tijdelijk verbinding verbreken met Tecla Shield - Aanvinken om een ander apparaat te laten verbinden met Tecla Shield - Volledig scherm schakelaar instelling - Gebruikt het volledige scherm als één enkele schakelaar - Altijd speakerphone gebruiken - Speaker voor spraakoproepen, spraakopdrachten en stem input inschakelen. - Toon altijd toetsenbord - Toont een klein navigatie toetsenbord wanneer geen tekst wordt ingevoerd - Toetsenbord navigatie time-out - Pas de vertraging aan vóór de toetsenbord navigatie automatisch verdwijnt - Verberg toetsenbord navigatie - Tik voor symbolen - Druk voor letters en cijfers - Morse invoer instellingen - Morse mode en voorkeuren aanpassen - Morse invoer activeren - Biedt een Morse invoermethode die het standaard toetsenbord vervangt - Toon Morse HUD - Laat een aantal Morse sleutels/waarden boven het toetsenbord zien - Morse invoermethode - Morse tijdseenheid - Selecteer uw Morse tijdseenheid - Configureren herhaal frequentie - Stel de herhaal frequentie van een dit/dah in wanneer u een schakelaar indrukt - Herhaalfrequentie configureren - Lang indrukken resetvertraging - Pas het lang indrukken met vertraging aan alvorens terug te keren naar Home - Weet u zeker dat u alle instellingen op standaardwaarden terug wilt zetten? - Ja - Neen - Sneller - Trager - "Gereed" - Scaninstellingen - Scan modus en snelheid aanpassen - Activeer zelf-scanning - Scant het toetsenbord automatisch - Laat inverse scanning toe - Start het scannen bij het drukken en selecteer bij het loslaten - Scansnelheid - Pas de scansnelheid aan - Configureren schakelaar acties - Pas de acties aan die toegewezen zijn aan elke invoerschakelaar - ECU 1 / Vooruit - ECU 2 / Achteruit - ECU 3 / Links - ECU 4 / Rechts - Schakelaar 1 - Schakelaar 2 - ECU 1 / Tecla actie Vooruit - ECU 2 / Tecla actie Achteruit - ECU 3 / Tecla actie Links - ECU 4 / Tecla actie Rechts - Knop 1 Tecla Aktie - Knop 2 Tecla Aktie - ECU 1 / Voorwaarts Morse actie - ECU 2 / Terug Morse actie - ECU 3 / links Morse actie - ECU 4 / rechts Morse actie - Schakelaar 1 Morse actie - Schakelaar 2 Morse actie - Herstel standaard acties - Reset schakelaar acties op standaardwaarden - Reset schakelaar acties - Geavanceerde invoer instellingen - Verbinding maken met Tecla Shield - Kon geen verbinding maken met Tecla Shield - Verbinding met Tecla Shield geannuleerd - Geen Tecla Shield beschikbaar - Op zoek naar Tecla Shields. Een ogenblik geduld… - Morse invoermethode ingeschakeld - Morse invoermethode uitgeschakeld - Volledig scherm schakelaar modus ingeschakeld - Volledig scherm schakelaar modus uitgeschakeld - Selecteer Tecla toegang als uw standaard invoermethode voordat u uw instellingen aanpast. - Geen spraakherkenning applicaties beschikbaar! - Voice Search is niet geïnstalleerd! - Tecla Stem ingave - Tecla instellen ... - About Tecla Access - The Team - Learn who made Tecla a reality - Core Team - Jan Richards - Manager & User Experience - Jorge Silva - Lead Developer - Mauricio Meza - User Experience - Eric Wan - Junior Developer - Coders - Eric Ma - Volunter - Eric Ma - Volunter - Eric Ma - Volunter - Enhancements - Mats Lundalv - Auto-cancel scan - Translators - - "Geen" - "Basis" - "Geavanceerd" - - - @string/prediction_none - @string/prediction_basic - @string/prediction_full - - - Onmiddellijk - Na 4 seconden - Na 8 seconden - Na 15 seconden - Na 30 seconden - Na 60 seconden - Nooit - - - Nooit - 1000 ms - 950 ms - 900 ms - 850 ms - 800 ms - 750 ms - 700 ms - 650 ms - 600 ms - 550 ms - 500 ms - - - "Geen" - Stap-scan volgende - Stap-scan vorige - Annuleren - Selecteer de gemaarkeerde - - - "Geen" - Morse dit - Morse dah - Morse einde van karakter - Morse backspace - Morse IME weergave verbergen - - - Drievoudige toets-modus - Dubbel-toets modus - Eén toets modus - - - 3 seconden - 6 seconden - 9 seconden - 12 seconden - 16 seconden - 20 seconden - 25 seconden - 32 seconden - 40 seconden - - + + "Trillen bij druk op een toets" + "Geluid bij druk op een toets" + "Typefouten corrigeren" + "Foutcorrectie tijdens invoer inschakelen" + "Invoerfouten in liggende weergave" + "Foutcorrectie tijdens invoer inschakelen" + "Woordsuggesties" + "Het vorige woord automatisch corrigeren" + "Woordsuggesties" + "Instellingen voor woordsuggesties" + "Automatisch voltooien tijdens typen inschakelen" + "Automatisch voltooien" + "Tekstveld vergroten" + "Woordsuggesties verbergen in liggende weergave" + "Automatisch hoofdlettergebruik" + "Hoofdletter gebruiken aan het begin van een zin" + "Automatische interpunctie" + "Snelle oplossingen" + "Hiermee worden veelvoorkomende typefouten gecorrigeerd" + "Suggesties weergeven" + "Voorgestelde woorden weergeven tijdens typen" + "Auto-aanvullen" + "Gemarkeerd woord automatisch invoegen met spatiebalk en interpunctie" + "0" + "1" + "2" + "%s : Opgeslagen" + "àáâãäåæ" + "èéêë" + "ìíîï" + "òóöø" + "ùúûü" + "§ß" + "" + "" + "" + "i" + "Houd een toets ingedrukt om diakritische tekens weer te geven (ø, ö, enzovoort)" + "Druk op elk gewenst moment op de toets Terug ↶ om het toetsenbord te sluiten" + "Toegang tot cijfers en symbolen" + Houd het meest linkse woord ingedrukt om het toe te voegen aan het woordenboek + "Raak deze tip aan om door te gaan »" + "Raak dit punt aan om deze tip te sluiten en te beginnen met typen." + "Het toetsenbord wordt geopend wanneer u een tekstveld aanraakt" + Raak de sleutel aan en hou het ingedrukt om accenten te zien (ø, ö, ô, ó, enz.) + "Schakel over naar cijfers en symbolen door deze toets aan te raken" + "Ga terug naar letters door deze toets nogmaals aan te raken" + "Blijf deze toets aanraken om toetsenbordinstellingen te wijzigen, zoals auto-aanvullen" + "Probeer het zelf!" + "Beginnen" + "Volgende" + "Gereed" + "Verzenden" + "?123" + "123" + "ABC" + "Alt" + "Het toetsenbord openen"\n\n\"Raak een tekstveld aan.\" + "Het toetsenbord sluiten"\n\n\"Druk op de terugtoets.\" + "Een toets blijven aanraken voor opties"\n\n\"Toegang tot interpunctie en diakritische tekens.\" + "Toetsenbordinstellingen"\n\n"Blijf de toets "\"?123\"\" aanraken.\" + ".com" + ".net" + ".org" + ".gov" + ".edu" + "Tecla-toetsenbord" + Tecla Access instellingen + Invoer methode + Maak stem ingave mogelijk + Voegt een toets toe voor snelle toegang tot gesproken commando\'s en spraakherkenning + Toon accenten toets + Laat sticky key zien waarmee tekens met accenten en andere varianten worden toegevoegd + Alternatieve invoer instellingen + Verbinding maken met Tecla Shield + Bluetooth is niet ondersteund + Bluetooth is uitgeschakeld + Probeert een verbinding met een nabijgelegen Tecla Shield te maken + Tijdelijk verbinding verbreken met Tecla Shield + Aanvinken om een ander apparaat te laten verbinden met Tecla Shield + Volledig scherm schakelaar instelling + Gebruikt het volledige scherm als één enkele schakelaar + Altijd speakerphone gebruiken + Speaker voor spraakoproepen, spraakopdrachten en stem input inschakelen. + Toon altijd toetsenbord + Toont een klein navigatie toetsenbord wanneer geen tekst wordt ingevoerd + Toetsenbord navigatie time-out + Pas de vertraging aan vóór de toetsenbord navigatie automatisch verdwijnt + Verberg toetsenbord navigatie + Tik voor symbolen + Druk voor letters en cijfers + Morse invoer instellingen + Morse mode en voorkeuren aanpassen + Morse invoer activeren + Biedt een Morse invoermethode die het standaard toetsenbord vervangt + Toon Morse HUD + Laat een aantal Morse sleutels/waarden boven het toetsenbord zien + Morse invoermethode + Morse tijdseenheid + Selecteer uw Morse tijdseenheid + Configureren herhaal frequentie + Stel de herhaal frequentie van een dit/dah in wanneer u een schakelaar indrukt + Herhaalfrequentie configureren + Lang indrukken resetvertraging + Pas het lang indrukken met vertraging aan alvorens terug te keren naar Home + Weet u zeker dat u alle instellingen op standaardwaarden terug wilt zetten? + Ja + Neen + Sneller + Trager + "Gereed" + Scaninstellingen + Scan modus en snelheid aanpassen + Activeer zelf-scanning + Scant het toetsenbord automatisch + Laat inverse scanning toe + Start het scannen bij het drukken en selecteer bij het loslaten + Scansnelheid + Pas de scansnelheid aan + Configureren schakelaar acties + Pas de acties aan die toegewezen zijn aan elke invoerschakelaar + ECU 1 / Vooruit + ECU 2 / Achteruit + ECU 3 / Links + ECU 4 / Rechts + Schakelaar 1 + Schakelaar 2 + ECU 1 / Tecla actie Vooruit + ECU 2 / Tecla actie Achteruit + ECU 3 / Tecla actie Links + ECU 4 / Tecla actie Rechts + Knop 1 Tecla Aktie + Knop 2 Tecla Aktie + ECU 1 / Voorwaarts Morse actie + ECU 2 / Terug Morse actie + ECU 3 / links Morse actie + ECU 4 / rechts Morse actie + Schakelaar 1 Morse actie + Schakelaar 2 Morse actie + Herstel standaard acties + Reset schakelaar acties op standaardwaarden + Reset schakelaar acties + Geavanceerde invoer instellingen + Verbinding maken met Tecla Shield + Kon geen verbinding maken met Tecla Shield + Verbinding met Tecla Shield geannuleerd + Geen Tecla Shield beschikbaar + Op zoek naar Tecla Shields. Een ogenblik geduld… + Morse invoermethode ingeschakeld + Morse invoermethode uitgeschakeld + Volledig scherm schakelaar modus ingeschakeld + Volledig scherm schakelaar modus uitgeschakeld + Selecteer Tecla toegang als uw standaard invoermethode voordat u uw instellingen aanpast. + Geen spraakherkenning applicaties beschikbaar! + Voice Search is niet geïnstalleerd! + Tecla Stem ingave + + + Nog niet geimplementeerd + + + Noodoproep configuratie + Telefonisch noodnummer + Telefoon noodnummer instellen + Geef telefoonnummer voor noodgevallen: + Telefoon noodnummer + SMS Noodnummer + SMS noodnummer instellen + Geef SMS-nummer voor noodgevallen: + SMS Noodnummer + GPS-locatie doormelden + Geef GPS-locatie door in SMS (GPS moet hiervoor altijd AAN staan!) + Noodoproep! Gaarne meteen aktie ondernemen, geen kaart beschikbaar. + Noodoproep! Klik voor locatie: + Wijze van peiling: + Ouderdom van peiling: + sec + + + Tecla instellen … + + + Over Tecla Access + The Team + Kijk wie Tecla mogelijk gemaakt hebben + Hoofd Team + Jan Richards + Manager & User Experience + Jorge Silva + Lead Developer + Mauricio Meza + User Experience + Eric Wan + Junior Developer + Programmeurs + Eric Ma + Vrijwilliger + Elyas Bhy + Vrjwilliger + Rishab Garg + Vrijwilliger + Jeroen Teunissen + Teunissen Enabling + Uitbreidingen + Mats Lundalv + Auto-cancel scan + Vertalers + + + "Geen" + "Basis" + "Geavanceerd" + + + @string/prediction_none + @string/prediction_basic + @string/prediction_full + + + Onmiddellijk + Na 4 seconden + Na 8 seconden + Na 15 seconden + Na 30 seconden + Na 60 seconden + Nooit + + + Nooit + 1000 ms + 950 ms + 900 ms + 850 ms + 800 ms + 750 ms + 700 ms + 650 ms + 600 ms + 550 ms + 500 ms + + + "Geen" + Stap-scan volgende + Stap-scan vorige + Annuleren + Selecteer de gemaarkeerde + Noodnummer bellen & bericht versturen + + + "Geen" + Morse dit + Morse dah + Morse einde van karakter + Morse backspace + Morse IME weergave verbergen + + + Drievoudige toets-modus + Dubbel-toets modus + Eén toets modus + + + 3 seconden + 6 seconden + 9 seconden + 12 seconden + 16 seconden + 20 seconden + 25 seconden + 32 seconden + 40 seconden + + + \ No newline at end of file diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index a6592d7..9b1c91d 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -228,10 +228,10 @@ Bluetooth is disabled Attempts a connection to a nearby Tecla Shield - - Temporarily Disconnect Tecla Shield - Check to allow another device to connect to Tecla Shield - + + Temporarily Disconnect Tecla Shield + Check to allow another device to connect to Tecla Shield + Fullscreen switch mode Uses the entire screen as a single switch @@ -247,8 +247,8 @@ Navigation keyboard timeout Adjust the delay before the navigation keyboard automatically hides - Hide navigation keyboard - + Hide navigation keyboard + Immediately After 4 seconds @@ -258,7 +258,6 @@ After 60 seconds Never - Never 1000 ms @@ -273,13 +272,13 @@ 550 ms 500 ms - None Step-scan next Step-scan previous Step out, cancel Select highlighted + Emergency callout None @@ -294,7 +293,7 @@ Double-key mode Single-key mode - + Tap for symbols Tap for letters & numbers @@ -302,23 +301,23 @@ Morse input settings Adjust Morse input mode and preferences - + Enable Morse input Provides a Morse input method that replaces the standard keyboard - + Show Morse HUD Displays a set of Morse keys/values above the keyboard - + - Morse input method - - - Morse time unit - Select your Morse time unit - - + Morse input method + + + Morse time unit + Select your Morse time unit + + Configure repeat frequency Adjust the repeat frequency of a dit/dah when holding down a switch Configure the repeat frequency @@ -338,7 +337,7 @@ 32 seconds 40 seconds - + Are you sure you want to reset to default actions? Yes @@ -352,7 +351,7 @@ Scanning settings Adjust the scanning mode and speed - + Enable self-scanning Scans the keyboard automatically @@ -391,9 +390,8 @@ Restore default actions Reset switch actions to default values Reset Switch Actions - Advanced input settings - + Connecting to Tecla Shield Could not connect to Tecla Shield @@ -411,34 +409,53 @@ Tecla Voice Input Configuring Tecla… + + + Not yet implemented - + + Emergency call settings + Emergency phone # + Configure emergency phone number + Emergency telephone number + Enter emergency telephone number + Emergency SMS # + Configure emergency SMS number + Emergency SMS number + Enter emergency SMS number + Enable GPS tracking + Forward GPS location in SMS (GPS should always be turned ON for this feature!) + Emergency call! No location available. + Emergency call! Click for map: + Provider: + Age of localization: + sec + + About Tecla Access The Team Learn who made Tecla a reality - Core Team - Jan Richards - Manager & User Experience - Jorge Silva - Lead Developer - Mauricio Meza - User Experience - Eric Wan - Junior Developer - + Jan Richards + Manager & User Experience + Jorge Silva + Lead Developer + Mauricio Meza + User Experience + Eric Wan + Junior Developer Coders - Eric Ma - Volunter - Elyas Bhy - Summer Intern - Rishab Garg - Summer Intern - + Eric Ma + Volunter + Elyas Bhy + Summer Intern + Rishab Garg + Summer Intern + Jeroen Teunissen + Teunissen Enabling Enhancements - Mats Lundalv - Auto-cancel scan - - Translators + Mats Lundalv + Auto-cancel scan + Translators - + \ No newline at end of file diff --git a/java/src/ca/idi/tekla/TeclaApp.java b/java/src/ca/idi/tekla/TeclaApp.java index 38b2c63..05a9bda 100644 --- a/java/src/ca/idi/tekla/TeclaApp.java +++ b/java/src/ca/idi/tekla/TeclaApp.java @@ -14,13 +14,13 @@ import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.media.AudioManager; import android.os.Handler; import android.os.SystemClock; import android.preference.PreferenceManager; import android.speech.RecognizerIntent; import android.util.Log; import ca.idi.tecla.framework.TeclaStatic; +import ca.idi.tekla.ime.EmergencyCallout; import ca.idi.tekla.util.Highlighter; import ca.idi.tekla.util.Persistence; import ca.idi.tekla.util.TeclaDesktopClient; @@ -57,11 +57,12 @@ public class TeclaApp extends ca.idi.tecla.framework.TeclaApp { private static TeclaApp instance; public static Persistence persistence; public static Highlighter highlighter; + public static EmergencyCallout emergencyCallout; public static String password="Tecla123"; public static boolean sendflag=false,connect_to_desktop=false; - public static TeclaDesktopClient desktop; + public static TeclaDesktopClient desktop; public static Object dictation_lock=new Object(); public static boolean dict_lock=false,mSendToPC; @@ -79,11 +80,10 @@ public void onCreate() { } private void init() { - instance = this; persistence = new Persistence(this); highlighter = new Highlighter(this); - + emergencyCallout = new EmergencyCallout(); mPackageManager = getPackageManager(); mHandler = new Handler(); diff --git a/java/src/ca/idi/tekla/TeclaPrefs.java b/java/src/ca/idi/tekla/TeclaPrefs.java index 922c63f..0b4aef5 100644 --- a/java/src/ca/idi/tekla/TeclaPrefs.java +++ b/java/src/ca/idi/tekla/TeclaPrefs.java @@ -41,7 +41,6 @@ import android.app.AlertDialog; import android.app.Dialog; -import android.R.bool; import android.app.ProgressDialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; @@ -57,7 +56,6 @@ import android.os.Handler; import android.preference.CheckBoxPreference; import android.preference.Preference; -import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceActivity; import android.preference.PreferenceCategory; @@ -70,8 +68,6 @@ import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; -import android.widget.TextView; -import android.view.Gravity; import android.view.KeyEvent; import android.view.View; diff --git a/java/src/ca/idi/tekla/ime/EmergencyCallout.java b/java/src/ca/idi/tekla/ime/EmergencyCallout.java new file mode 100644 index 0000000..587113e --- /dev/null +++ b/java/src/ca/idi/tekla/ime/EmergencyCallout.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2008-2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package ca.idi.tekla.ime; + +import java.util.concurrent.ExecutionException; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.media.MediaPlayer; +import ca.idi.tecla.framework.TeclaStatic; +import ca.idi.tekla.TeclaApp; + +public class EmergencyCallout extends TeclaIME { + + public void Callout(Context context) { + + Boolean didPhoneCall = false; + String phoneNumber = emergency_phone_number(); + String smsNumber = emergency_SMS_number(); + + // does this device has telephone capabilities i.e. it is NOT a tablet + // ?!?! + if (context.getPackageManager().hasSystemFeature( + PackageManager.FEATURE_TELEPHONY)) { + if (phoneNumber.length() > 0) { + try { + if (new EmergencyPhoneCall().execute(context, phoneNumber) + .get()) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, + "Phone call succesfully initiated"); + didPhoneCall = true; + } else { + TeclaStatic.logD(TeclaApp.CLASS_TAG, + "Phonecall not initiatd?"); + } + } catch (InterruptedException e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "Phone call error: " + + e); + } catch (ExecutionException e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "Phone call error: " + + e); + } + } + + if (smsNumber.length() > 0) { + try { + if (new EmergencySMS().execute(context, smsNumber).get()) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, + "SMS msg succesfully initiated"); + /* + * sound to ack something happened when no phonecall is + * made, otherwise user does not get any signal anything + * happened. + */ + if (!didPhoneCall) { + MediaPlayer mPlay = MediaPlayer.create(context, + ca.idi.tekla.R.raw.emergency_succes); + mPlay.start(); + Thread.sleep(500); + mPlay.stop(); + mPlay.reset(); + mPlay.release(); + mPlay = null; + } + } else { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "SMS not send?"); + } + } catch (InterruptedException e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "SMS error: " + e); + } catch (ExecutionException e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "SMS error: " + e); + } + } + } else { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "No TELEPHONY capabilities"); + try { + MediaPlayer mPlay = MediaPlayer.create(context, + ca.idi.tekla.R.raw.emergency_error); + mPlay.start(); + Thread.sleep(500); + mPlay.stop(); + mPlay.reset(); + mPlay.release(); + mPlay = null; + } catch (InterruptedException e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, "Could not play error sound."); + } finally { + + } + } + } + + private String emergency_phone_number() { + return TeclaApp.persistence.getEmergencyPhoneNumber().toString(); + } + + private String emergency_SMS_number() { + return TeclaApp.persistence.getEmergencySMSNumber().toString(); + } + + /* + * Google maps link explanation + * http://maps.google.com/maps?&z=14&ll=39.211374,-82.978277 z for zoom ll + * for lat/lon + */ +} diff --git a/java/src/ca/idi/tekla/ime/EmergencyLocation.java b/java/src/ca/idi/tekla/ime/EmergencyLocation.java new file mode 100644 index 0000000..34e81ba --- /dev/null +++ b/java/src/ca/idi/tekla/ime/EmergencyLocation.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2008-2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + + +package ca.idi.tekla.ime; + +import java.util.Timer; +import java.util.TimerTask; +import android.content.Context; +import android.location.Location; +import android.location.LocationListener; +import android.location.LocationManager; +import android.os.Bundle; + +public class EmergencyLocation { + Timer timer1; + LocationManager lm; + LocationResult locationResult; + boolean gps_enabled=false; + boolean network_enabled=false; + public final int timerTreshold = 20000; + + public boolean getLocation(Context context, LocationResult result) + { + //I use LocationResult callback class to pass location value from MyLocation to user code. + locationResult=result; + if(lm==null) + lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); + + //exceptions will be thrown if provider is not permitted. + try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){} + try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){} + + //don't start listeners if no provider is enabled + if(!gps_enabled && !network_enabled) + return false; + + if(gps_enabled) + lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps); + if(network_enabled) + lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork); + timer1=new Timer(); + timer1.schedule(new GetLastLocation(), timerTreshold); + return true; + } + + LocationListener locationListenerGps = new LocationListener() { + public void onLocationChanged(Location location) { + timer1.cancel(); + locationResult.gotLocation(location); + lm.removeUpdates(this); + lm.removeUpdates(locationListenerNetwork); + } + public void onProviderDisabled(String provider) {} + public void onProviderEnabled(String provider) {} + public void onStatusChanged(String provider, int status, Bundle extras) {} + }; + + LocationListener locationListenerNetwork = new LocationListener() { + public void onLocationChanged(Location location) { + timer1.cancel(); + locationResult.gotLocation(location); + lm.removeUpdates(this); + lm.removeUpdates(locationListenerGps); + } + public void onProviderDisabled(String provider) {} + public void onProviderEnabled(String provider) {} + public void onStatusChanged(String provider, int status, Bundle extras) {} + }; + + class GetLastLocation extends TimerTask { + @Override + public void run() { + lm.removeUpdates(locationListenerGps); + lm.removeUpdates(locationListenerNetwork); + + Location net_loc=null, gps_loc=null; + if(gps_enabled) + gps_loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); + if(network_enabled) + net_loc=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); + + //if there are both values use the latest one + if(gps_loc!=null && net_loc!=null){ + if(gps_loc.getTime()>net_loc.getTime()) + locationResult.gotLocation(gps_loc); + else + locationResult.gotLocation(net_loc); + return; + } + + if(gps_loc!=null){ + locationResult.gotLocation(gps_loc); + return; + } + if(net_loc!=null){ + locationResult.gotLocation(net_loc); + return; + } + locationResult.gotLocation(null); + } + } + + public static abstract class LocationResult{ + public abstract void gotLocation(Location location); + } +} \ No newline at end of file diff --git a/java/src/ca/idi/tekla/ime/EmergencyPhoneCall.java b/java/src/ca/idi/tekla/ime/EmergencyPhoneCall.java new file mode 100644 index 0000000..4f7fbe3 --- /dev/null +++ b/java/src/ca/idi/tekla/ime/EmergencyPhoneCall.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008-2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package ca.idi.tekla.ime; + +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.AsyncTask; +import ca.idi.tecla.framework.TeclaStatic; +import ca.idi.tekla.TeclaApp; + +public class EmergencyPhoneCall extends AsyncTask { + + @Override + protected Boolean doInBackground(Object... params) { + Context context = (Context) params[0]; + String phoneNumber = (String) params[1]; + Boolean succes = false; + try { + Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:" + phoneNumber)); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + succes = true; + } catch (Exception e) { + TeclaStatic.logD(TeclaApp.CLASS_TAG, " doInBackground error: " + e); + } + return succes; + } + +} \ No newline at end of file diff --git a/java/src/ca/idi/tekla/ime/EmergencySMS.java b/java/src/ca/idi/tekla/ime/EmergencySMS.java new file mode 100644 index 0000000..8cca431 --- /dev/null +++ b/java/src/ca/idi/tekla/ime/EmergencySMS.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2008-2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package ca.idi.tekla.ime; + +import android.content.Context; +import android.os.AsyncTask; +import android.os.Looper; +import ca.idi.tecla.framework.TeclaStatic; +import ca.idi.tekla.R; +import ca.idi.tekla.TeclaApp; +import ca.idi.tekla.ime.EmergencyLocation.LocationResult; +import android.telephony.SmsManager; +import android.location.Location; +import android.location.LocationManager; + +public class EmergencySMS extends AsyncTask { + public static final String TAG = "EmergencySMS"; + + @Override + protected Boolean doInBackground(Object... params) { + final Context context = (Context) params[0]; + final String smsNumber = (String) params[1]; + + Looper.prepare(); + Looper.getMainLooper(); + + LocationResult locationResult = new LocationResult() { + @Override + public void gotLocation(Location location) { + // Got the location! + // start SMS messaging! + String message = null; + if (emergency_GPS_setting(context)) { + message = context + .getString(ca.idi.tekla.R.string.emergency_SMS_text_withLoc) + + " http://maps.google.com/maps?&z=17&t=h&q=loc:" + + String.valueOf(location.getLatitude()) + + "+" + + String.valueOf(location.getLongitude()) + + " " + + context + .getString(R.string.emergency_location_provider) + + " " + + location.getProvider() + + ". " + + context + .getString(R.string.emergency_location_age) + + " " + + String.valueOf((System.currentTimeMillis() - location + .getTime()) / 60000) + + " " + + context + .getString(R.string.emergency_location_age_unit) + + "."; + } else { + message = context + .getString(ca.idi.tekla.R.string.emergency_SMS_text_withoutLoc); + } + SmsManager smsManager = SmsManager.getDefault(); + smsManager + .sendTextMessage(smsNumber, null, message, null, null); + TeclaStatic.logD(TAG, message); + } + }; + + EmergencyLocation myLocation = new EmergencyLocation(); + myLocation.getLocation(context, locationResult); // this + + // not crashed? we did our job. + return true; + } + + private boolean emergency_GPS_setting(Context context) { + Boolean gpsActive = false; + if (TeclaApp.persistence.getEmergencyGPSSetting()) { + LocationManager locMan = (LocationManager) context + .getSystemService(Context.LOCATION_SERVICE); + // check wether any useable location service is turned on + if (locMan.isProviderEnabled(LocationManager.GPS_PROVIDER)) + gpsActive = true; + if (locMan.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) + gpsActive = true; + } + return gpsActive; + } +} \ No newline at end of file diff --git a/java/src/ca/idi/tekla/ime/TeclaIME.java b/java/src/ca/idi/tekla/ime/TeclaIME.java index 40d19f3..16ac134 100644 --- a/java/src/ca/idi/tekla/ime/TeclaIME.java +++ b/java/src/ca/idi/tekla/ime/TeclaIME.java @@ -74,8 +74,8 @@ /** * Input method implementation for Qwerty'ish keyboard. */ -public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService - implements KeyboardView.OnKeyboardActionListener { +public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService implements + KeyboardView.OnKeyboardActionListener { static final boolean TRACE = false; private static final String PREF_VIBRATE_ON = "vibrate_on"; @@ -96,9 +96,11 @@ public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService private static final int QUICK_PRESS = 200; // Weight added to a user picking a new word from the suggestion strip static final int FREQUENCY_FOR_PICKED = 3; - // Weight added to a user typing a new word that doesn't get corrected (or is reverted) + // Weight added to a user typing a new word that doesn't get corrected (or + // is reverted) static final int FREQUENCY_FOR_TYPED = 1; - // A word that is frequently typed and get's promoted to the user dictionary, uses this + // A word that is frequently typed and get's promoted to the user + // dictionary, uses this // frequency. static final int FREQUENCY_FOR_AUTO_ADD = 250; @@ -108,7 +110,7 @@ public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService // Contextual menu positions private static final int POS_SETTINGS = 0; private static final int POS_METHOD = 1; - + private TeclaKeyboardView mIMEView; private CandidateViewContainer mCandidateViewContainer; private CandidateView mCandidateView; @@ -118,21 +120,21 @@ public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService private AlertDialog mOptionsDialog; KeyboardSwitcher mKeyboardSwitcher; - - // Morse variables + + // Morse variables private TeclaMorse mTeclaMorse; private Keyboard.Key mSpaceKey; private Keyboard.Key mSendtoPCKey; private int mSpaceKeyIndex; private int mRepeatedKey; private long mMorseStartTime; - - //Morse key modes + + // Morse key modes public static final int TRIPLE_KEY_MODE = 0; public static final int DOUBLE_KEY_MODE = 1; public static final int SINGLE_KEY_MODE = 2; - - //Morse typing error margin (single-key mode) + + // Morse typing error margin (single-key mode) private static final float ERROR_MARGIN = 1.15f; private UserDictionary mUserDictionary; @@ -156,16 +158,14 @@ public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService private boolean mAutoCap; private boolean mQuickFixes; private boolean mShowSuggestions; - - - private int mCorrectionMode; - private int mOrientation; - - + + private int mCorrectionMode; + private int mOrientation; + // Keycode of the key which is on repeat private int mRepeatingKeyCode; private boolean wasAutoRepeating; - + // Indicates whether the suggestion strip is to be on in landscape private boolean mJustAccepted; private CharSequence mJustRevertedSeparator; @@ -181,23 +181,21 @@ public class TeclaIME extends ca.idi.tecla.framework.TeclaIMEService // Align sound effect volume on music volume private final float FX_VOLUME = -1.0f; private boolean mSilentMode; - private ToneGenerator mTone = new ToneGenerator(AudioManager.STREAM_DTMF, 100); + private ToneGenerator mTone = new ToneGenerator(AudioManager.STREAM_DTMF, + 100); private int mToneType = ToneGenerator.TONE_CDMA_DIAL_TONE_LITE; private String mWordSeparators; private String mSentenceSeparators; - - - private int wifi_ping_count=0; + private int wifi_ping_count = 0; private Thread wifisearcherthread; private static TeclaIME instance; - - public static TeclaIME getInstance(){ + + public static TeclaIME getInstance() { return instance; } - - + Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { @@ -212,7 +210,8 @@ public void handleMessage(Message msg) { mTutorial.start(); } else { // Try again soon if the view is not yet showing - sendMessageDelayed(obtainMessage(MSG_START_TUTORIAL), 100); + sendMessageDelayed(obtainMessage(MSG_START_TUTORIAL), + 100); } } break; @@ -222,32 +221,34 @@ public void handleMessage(Message msg) { } } }; - + @Override public void onCreate() { - + super.onCreate(); mTeclaMorse = new TeclaMorse(this); - instance=this; + instance = this; // Setup Debugging - //if (TeclaApp.DEBUG) android.os.Debug.waitForDebugger(); + // if (TeclaApp.DEBUG) android.os.Debug.waitForDebugger(); TeclaStatic.logD(CLASS_TAG, "Creating IME..."); - //setStatusIcon(R.drawable.ime_qwerty); + // setStatusIcon(R.drawable.ime_qwerty); mKeyboardSwitcher = new KeyboardSwitcher(this); final Configuration conf = getResources().getConfiguration(); initSuggest(conf.locale.toString()); mOrientation = conf.orientation; - mVibrateDuration = getResources().getInteger(R.integer.vibrate_duration_ms); + mVibrateDuration = getResources().getInteger( + R.integer.vibrate_duration_ms); // register to receive ringer mode changes for silent mode - registerReceiver(mReceiver, new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION)); + registerReceiver(mReceiver, new IntentFilter( + AudioManager.RINGER_MODE_CHANGED_ACTION)); initTeclaA11y(); -// initDesktop(); + // initDesktop(); } - + private void initSuggest(String locale) { mLocale = locale; mSuggest = new Suggest(this, R.raw.main); @@ -259,16 +260,18 @@ private void initSuggest(String locale) { mSuggest.setContactsDictionary(mContactsDictionary); mSuggest.setAutoDictionary(mAutoDictionary); mWordSeparators = getResources().getString(R.string.word_separators); - mSentenceSeparators = getResources().getString(R.string.sentence_separators); - } - -/* private void initDesktop(){ - TeclaApp.mSendToPC=false; - wifisearcherthread=new Thread(desktopsearcher); - + mSentenceSeparators = getResources().getString( + R.string.sentence_separators); } -*/ - @Override public void onDestroy() { + + /* + * private void initDesktop(){ TeclaApp.mSendToPC=false; + * wifisearcherthread=new Thread(desktopsearcher); + * + * } + */ + @Override + public void onDestroy() { super.onDestroy(); mUserDictionary.close(); mContactsDictionary.close(); @@ -277,7 +280,6 @@ private void initSuggest(String locale) { TeclaShieldManager.disconnect(this); } - @Override public void onConfigurationChanged(Configuration conf) { if (!TextUtils.equals(conf.locale.toString(), mLocale)) { @@ -287,10 +289,12 @@ public void onConfigurationChanged(Configuration conf) { if (conf.orientation != mOrientation) { commitTyped(getCurrentInputConnection()); mOrientation = conf.orientation; - - // If the fullscreen switch is enabled, change its size to match screen - if(isFullScreenShowing()) { - TeclaStatic.logD(CLASS_TAG, "Changing size of fullscreen overlay."); + + // If the fullscreen switch is enabled, change its size to match + // screen + if (isFullScreenShowing()) { + TeclaStatic.logD(CLASS_TAG, + "Changing size of fullscreen overlay."); Display display = getDisplay(); mSwitchPopup.update(display.getWidth(), display.getHeight()); } @@ -299,9 +303,9 @@ public void onConfigurationChanged(Configuration conf) { mKeyboardSwitcher = new KeyboardSwitcher(this); } mKeyboardSwitcher.makeKeyboards(true); - + super.onConfigurationChanged(conf); - + if (mKeyboardSwitcher.isMorseMode()) { updateSpaceKey(); mIMEView.invalidate(); @@ -310,19 +314,19 @@ public void onConfigurationChanged(Configuration conf) { @Override public View onCreateInputView() { - mIMEView = (TeclaKeyboardView) getLayoutInflater().inflate( - R.xml.input, null); + mIMEView = (TeclaKeyboardView) getLayoutInflater().inflate(R.xml.input, + null); mKeyboardSwitcher.setInputView(mIMEView); mKeyboardSwitcher.makeKeyboards(true); mIMEView.setOnKeyboardActionListener(this); mIMEView.setTeclaMorse(mTeclaMorse); mIMEView.setService(this); - + if (TeclaApp.persistence.isMorseModeEnabled()) mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, 0); else mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NAV, 0); - + TeclaStatic.logD(CLASS_TAG, "Soft IME view created."); TeclaApp.highlighter.setIMEView(mIMEView); return mIMEView; @@ -333,25 +337,27 @@ public View onCreateCandidatesView() { // No candidates view in Morse mode if (!TeclaApp.persistence.isMorseModeEnabled()) { mKeyboardSwitcher.makeKeyboards(true); - mCandidateViewContainer = (CandidateViewContainer) getLayoutInflater().inflate( - R.layout.candidates, null); + mCandidateViewContainer = (CandidateViewContainer) getLayoutInflater() + .inflate(R.layout.candidates, null); mCandidateViewContainer.initViews(); - mCandidateView = (CandidateView) mCandidateViewContainer.findViewById(R.id.candidates); + mCandidateView = (CandidateView) mCandidateViewContainer + .findViewById(R.id.candidates); mCandidateView.setService(this); setCandidatesViewShown(true); // TODO: Tecla - uncomment to enable suggestions - //return mCandidateViewContainer; + // return mCandidateViewContainer; } return null; } - @Override + @Override public void onStartInputView(EditorInfo attribute, boolean restarting) { - // In landscape mode, this method gets called without the input view being created. + // In landscape mode, this method gets called without the input view + // being created. if (mIMEView == null) { return; } - + mKeyboardSwitcher.makeKeyboards(false); TextEntryState.newSession(this); @@ -361,32 +367,39 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { mCompletionOn = false; mCompletions = null; mCapsLock = false; - - switch (attribute.inputType&EditorInfo.TYPE_MASK_CLASS) { + + switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) { case EditorInfo.TYPE_CLASS_NUMBER: case EditorInfo.TYPE_CLASS_DATETIME: if (TeclaApp.persistence.isMorseModeEnabled()) - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, + attribute.imeOptions); else - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_SYMBOLS, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode( + KeyboardSwitcher.MODE_SYMBOLS, attribute.imeOptions); break; case EditorInfo.TYPE_CLASS_PHONE: if (TeclaApp.persistence.isMorseModeEnabled()) - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, + attribute.imeOptions); else - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_PHONE, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_PHONE, + attribute.imeOptions); break; case EditorInfo.TYPE_CLASS_TEXT: if (TeclaApp.persistence.isMorseModeEnabled()) - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, + attribute.imeOptions); else { - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, attribute.imeOptions); - //startPrediction(); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, + attribute.imeOptions); + // startPrediction(); mPredictionOn = true; // Make sure that passwords are not displayed in candidate view - int variation = attribute.inputType & EditorInfo.TYPE_MASK_VARIATION; - if (variation == EditorInfo.TYPE_TEXT_VARIATION_PASSWORD || - variation == EditorInfo.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD ) { + int variation = attribute.inputType + & EditorInfo.TYPE_MASK_VARIATION; + if (variation == EditorInfo.TYPE_TEXT_VARIATION_PASSWORD + || variation == EditorInfo.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) { mPredictionOn = false; } if (variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS @@ -397,16 +410,20 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { } if (variation == EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) { mPredictionOn = false; - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_EMAIL, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode( + KeyboardSwitcher.MODE_EMAIL, attribute.imeOptions); } else if (variation == EditorInfo.TYPE_TEXT_VARIATION_URI) { mPredictionOn = false; - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_URL, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode( + KeyboardSwitcher.MODE_URL, attribute.imeOptions); } else if (variation == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE) { - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_IM, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_IM, + attribute.imeOptions); } else if (variation == EditorInfo.TYPE_TEXT_VARIATION_FILTER) { mPredictionOn = false; } else if (variation == EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT) { - // If it's a browser edit field and auto correct is not ON explicitly, then + // If it's a browser edit field and auto correct is not ON + // explicitly, then // disable auto correction, but keep suggestions on. if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0) { disableAutoCorrect = true; @@ -418,12 +435,13 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { mPredictionOn = false; disableAutoCorrect = true; } - // If it's not multiline and the autoCorrect flag is not set, then don't correct - if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0 && - (attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) == 0) { + // If it's not multiline and the autoCorrect flag is not set, + // then don't correct + if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0 + && (attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) == 0) { disableAutoCorrect = true; } - if ((attribute.inputType&EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) { + if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) { mPredictionOn = false; mCompletionOn = true && isFullscreenMode(); } @@ -431,14 +449,17 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { } break; case EditorInfo.TYPE_NULL: - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NAV, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NAV, + attribute.imeOptions); updateShiftKeyState(attribute); break; default: if (TeclaApp.persistence.isMorseModeEnabled()) - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_MORSE, + attribute.imeOptions); else - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, attribute.imeOptions); + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, + attribute.imeOptions); updateShiftKeyState(attribute); } mIMEView.closing(); @@ -446,7 +467,8 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { mPredicting = false; mDeleteCount = 0; setCandidatesViewShown(false); - if (mCandidateView != null) mCandidateView.setSuggestions(null, false, false, false); + if (mCandidateView != null) + mCandidateView.setSuggestions(null, false, false, false); loadSettings(); // Override auto correct if (disableAutoCorrect) { @@ -461,16 +483,17 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) { } mPredictionOn = mPredictionOn && mCorrectionMode > 0; checkTutorial(attribute.privateImeOptions); - if (TRACE) Debug.startMethodTracing("/data/trace/latinime"); + if (TRACE) + Debug.startMethodTracing("/data/trace/latinime"); int thisKBMode = mKeyboardSwitcher.getKeyboardMode(); - if(mLastKeyboardMode != thisKBMode) { + if (mLastKeyboardMode != thisKBMode) { mLastKeyboardMode = thisKBMode; evaluateStartScanning(); } evaluateNavKbdTimeout(); } - + @Override public void onFinishInput() { super.onFinishInput(); @@ -482,8 +505,8 @@ public void onFinishInput() { @Override public void onUpdateSelection(int oldSelStart, int oldSelEnd, - int newSelStart, int newSelEnd, - int candidatesStart, int candidatesEnd) { + int newSelStart, int newSelEnd, int candidatesStart, + int candidatesEnd) { super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd); @@ -493,8 +516,9 @@ public void onUpdateSelection(int oldSelStart, int oldSelEnd, } else { // If the current selection in the text view changes, we should // clear whatever candidate text we have. - if (mComposing.length() > 0 && mPredicting && (newSelStart != candidatesEnd - || newSelEnd != candidatesEnd)) { + if (mComposing.length() > 0 + && mPredicting + && (newSelStart != candidatesEnd || newSelEnd != candidatesEnd)) { mComposing.setLength(0); mPredicting = false; updateSuggestions(); @@ -503,7 +527,8 @@ public void onUpdateSelection(int oldSelStart, int oldSelEnd, if (ic != null) { ic.finishComposingText(); } - } else if (!mPredicting && !mJustAccepted + } else if (!mPredicting + && !mJustAccepted && TextEntryState.getState() == TextEntryState.STATE_ACCEPTED_DEFAULT) { TextEntryState.reset(); } @@ -518,7 +543,8 @@ public void hideWindow() { TeclaApp.highlighter.stopSelfScanning(); TeclaApp.highlighter.clear(); } - if (TRACE) Debug.stopMethodTracing(); + if (TRACE) + Debug.stopMethodTracing(); if (mOptionsDialog != null && mOptionsDialog.isShowing()) { mOptionsDialog.dismiss(); mOptionsDialog = null; @@ -534,18 +560,19 @@ public void hideWindow() { @Override public boolean onEvaluateFullscreenMode() { // never go to fullscreen mode - //return super.onEvaluateFullscreenMode(); + // return super.onEvaluateFullscreenMode(); return false; } @Override public void onDisplayCompletions(CompletionInfo[] completions) { - if (false) { - Log.i("foo", "Received completions:"); - for (int i=0; i<(completions != null ? completions.length : 0); i++) { - Log.i("foo", " #" + i + ": " + completions[i]); - } - } + // if (false) { + // Log.i("foo", "Received completions:"); + // for (int i=0; i<(completions != null ? completions.length : 0); i++) + // { + // Log.i("foo", " #" + i + ": " + completions[i]); + // } + // } if (mCompletionOn) { mCompletions = completions; if (completions == null) { @@ -554,11 +581,12 @@ public void onDisplayCompletions(CompletionInfo[] completions) { } List stringList = new ArrayList(); - for (int i=0; i<(completions != null ? completions.length : 0); i++) { + for (int i = 0; i < (completions != null ? completions.length : 0); i++) { CompletionInfo ci = completions[i]; - if (ci != null) stringList.add(ci.getText()); + if (ci != null) + stringList.add(ci.getText()); } - //CharSequence typedWord = mWord.getTypedWord(); + // CharSequence typedWord = mWord.getTypedWord(); mCandidateView.setSuggestions(stringList, true, true, true); mBestWord = null; setCandidatesViewShown(isCandidateStripVisible() || mCompletionOn); @@ -581,25 +609,20 @@ public void onComputeInsets(TeclaIMEService.Insets outInsets) { } } - /** * Hardware key down! */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { - switch (keyCode) { case KeyEvent.KEYCODE_BACK: - // FIXME: Tecla - Prevent soft input method from consuming the back key - /*if (event.getRepeatCount() == 0 && mInputView != null) { - if (mInputView.handleBack()) { - return true; - } else if (mTutorial != null) { - mTutorial.close(); - mTutorial = null; - } - } - break;*/ + // FIXME: Tecla - Prevent soft input method from consuming the back + // key + /* + * if (event.getRepeatCount() == 0 && mInputView != null) { if + * (mInputView.handleBack()) { return true; } else if (mTutorial != + * null) { mTutorial.close(); mTutorial = null; } } break; + */ return false; case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_UP: @@ -627,12 +650,14 @@ public boolean onKeyUp(int keyCode, KeyEvent event) { } // Enable shift key and DPAD to do selections if (TeclaApp.highlighter.isSoftIMEShowing() && mIMEView.isShifted()) { - event = new KeyEvent(event.getDownTime(), event.getEventTime(), - event.getAction(), event.getKeyCode(), event.getRepeatCount(), - event.getDeviceId(), event.getScanCode(), - KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON); + event = new KeyEvent(event.getDownTime(), event.getEventTime(), + event.getAction(), event.getKeyCode(), + event.getRepeatCount(), event.getDeviceId(), + event.getScanCode(), KeyEvent.META_SHIFT_LEFT_ON + | KeyEvent.META_SHIFT_ON); InputConnection ic = getCurrentInputConnection(); - if (ic != null) ic.sendKeyEvent(event); + if (ic != null) + ic.sendKeyEvent(event); return true; } break; @@ -657,15 +682,14 @@ public void onWindowHidden() { @Override public boolean onEvaluateInputViewShown() { - return shouldShowIME()? - true:super.onEvaluateInputViewShown(); + return shouldShowIME() ? true : super.onEvaluateInputViewShown(); } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); - + if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) // receive ringer mode changes to detect silent mode updateRingerMode(); @@ -674,14 +698,18 @@ public void onReceive(Context context, Intent intent) { handleSwitchEvent(new SwitchEvent(intent.getExtras())); } if (action.equals(TeclaShieldService.ACTION_SHIELD_CONNECTED)) { - TeclaStatic.logD(CLASS_TAG, "Received Shield connected intent."); - if (!mShieldConnected) mShieldConnected = true; + TeclaStatic + .logD(CLASS_TAG, "Received Shield connected intent."); + if (!mShieldConnected) + mShieldConnected = true; showIMEView(); evaluateStartScanning(); } if (action.equals(TeclaShieldService.ACTION_SHIELD_DISCONNECTED)) { - TeclaStatic.logD(CLASS_TAG, "Received Shield disconnected intent."); - if (mShieldConnected) mShieldConnected = false; + TeclaStatic.logD(CLASS_TAG, + "Received Shield disconnected intent."); + if (mShieldConnected) + mShieldConnected = false; evaluateStartScanning(); } if (action.equals(TeclaApp.ACTION_SHOW_IME)) { @@ -689,31 +717,36 @@ public void onReceive(Context context, Intent intent) { showIMEView(); evaluateStartScanning(); evaluateNavKbdTimeout(); - //TODO: Assume/force persistent keyboard preference + // TODO: Assume/force persistent keyboard preference } if (action.equals(TeclaApp.ACTION_HIDE_IME)) { TeclaStatic.logD(CLASS_TAG, "Received hide IME intent."); hideSoftIME(); } if (action.equals(TeclaApp.ACTION_START_FS_SWITCH_MODE)) { - TeclaStatic.logD(CLASS_TAG, "Received start fullscreen switch mode intent."); + TeclaStatic.logD(CLASS_TAG, + "Received start fullscreen switch mode intent."); startFullScreenSwitchMode(500); } if (action.equals(TeclaApp.ACTION_STOP_FS_SWITCH_MODE)) { - TeclaStatic.logD(CLASS_TAG, "Received stop fullscreen switch mode intent."); + TeclaStatic.logD(CLASS_TAG, + "Received stop fullscreen switch mode intent."); stopFullScreenSwitchMode(); } if (action.equals(Highlighter.ACTION_START_SCANNING)) { - TeclaStatic.logD(CLASS_TAG, "Received start scanning IME intent."); + TeclaStatic.logD(CLASS_TAG, + "Received start scanning IME intent."); evaluateStartScanning(); } if (action.equals(Highlighter.ACTION_STOP_SCANNING)) { - TeclaStatic.logD(CLASS_TAG, "Received stop scanning IME intent."); + TeclaStatic.logD(CLASS_TAG, + "Received stop scanning IME intent."); evaluateStartScanning(); } if (action.equals(TeclaApp.ACTION_INPUT_STRING)) { TeclaStatic.logD(CLASS_TAG, "Received input string intent."); - String input_string = intent.getExtras().getString(TeclaApp.EXTRA_INPUT_STRING); + String input_string = intent.getExtras().getString( + TeclaApp.EXTRA_INPUT_STRING); typeInputString(input_string); } if (action.equals(TeclaApp.ACTION_ENABLE_MORSE)) { @@ -732,7 +765,7 @@ public void onReceive(Context context, Intent intent) { } } }; - + private void commitTyped(InputConnection inputConnection) { if (mPredicting) { mPredicting = false; @@ -742,7 +775,8 @@ private void commitTyped(InputConnection inputConnection) { } mCommittedLength = mComposing.length(); TextEntryState.acceptedTyped(mComposing); - mAutoDictionary.addWord(mComposing.toString(), FREQUENCY_FOR_TYPED); + mAutoDictionary.addWord(mComposing.toString(), + FREQUENCY_FOR_TYPED); } updateSuggestions(); } @@ -750,13 +784,14 @@ private void commitTyped(InputConnection inputConnection) { private void postUpdateShiftKeyState(int delay) { mHandler.removeMessages(MSG_UPDATE_SHIFT_STATE); - mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_UPDATE_SHIFT_STATE), delay); + mHandler.sendMessageDelayed( + mHandler.obtainMessage(MSG_UPDATE_SHIFT_STATE), delay); } public void updateShiftKeyState(EditorInfo attr) { InputConnection ic = getCurrentInputConnection(); - if (attr != null && mIMEView != null && mKeyboardSwitcher.isAlphabetMode() - && ic != null) { + if (attr != null && mIMEView != null + && mKeyboardSwitcher.isAlphabetMode() && ic != null) { int caps = 0; EditorInfo ei = getCurrentInputEditorInfo(); if (mAutoCap && ei != null && ei.inputType != EditorInfo.TYPE_NULL) { @@ -768,10 +803,12 @@ public void updateShiftKeyState(EditorInfo attr) { private void swapPunctuationAndSpace() { final InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; + if (ic == null) + return; CharSequence lastTwo = ic.getTextBeforeCursor(2, 0); if (lastTwo != null && lastTwo.length() == 2 - && lastTwo.charAt(0) == KEYCODE_SPACE && isSentenceSeparator(lastTwo.charAt(1))) { + && lastTwo.charAt(0) == KEYCODE_SPACE + && isSentenceSeparator(lastTwo.charAt(1))) { ic.beginBatchEdit(); ic.deleteSurroundingText(2, 0); ic.commitText(lastTwo.charAt(1) + " ", 1); @@ -781,14 +818,17 @@ private void swapPunctuationAndSpace() { } private void doubleSpace() { - //if (!mAutoPunctuate) return; - if (mCorrectionMode == Suggest.CORRECTION_NONE) return; + // if (!mAutoPunctuate) return; + if (mCorrectionMode == Suggest.CORRECTION_NONE) + return; final InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; + if (ic == null) + return; CharSequence lastThree = ic.getTextBeforeCursor(3, 0); if (lastThree != null && lastThree.length() == 3 && Character.isLetterOrDigit(lastThree.charAt(0)) - && lastThree.charAt(1) == KEYCODE_SPACE && lastThree.charAt(2) == KEYCODE_SPACE) { + && lastThree.charAt(1) == KEYCODE_SPACE + && lastThree.charAt(2) == KEYCODE_SPACE) { ic.beginBatchEdit(); ic.deleteSurroundingText(2, 0); ic.commitText(". ", 1); @@ -816,55 +856,52 @@ public void onKey(int primaryCode, int[] keyCodes) { if (TeclaApp.persistence.isRepeatingKey() && primaryCode != TeclaKeyboard.KEYCODE_REPEAT_LOCK - && !TeclaApp.persistence.isFullscreenSwitchEnabled()) stopRepeatingKey(); + && !TeclaApp.persistence.isFullscreenSwitchEnabled()) + stopRepeatingKey(); if (keyCodes != null && keyCodes.length > 0) { TeclaStatic.logD(CLASS_TAG, "Keycode: " + keyCodes[0]); } - - if (primaryCode != Keyboard.KEYCODE_DELETE || - when > mLastKeyTime + QUICK_PRESS) { + + if (primaryCode != Keyboard.KEYCODE_DELETE + || when > mLastKeyTime + QUICK_PRESS) { mDeleteCount = 0; } mLastKeyTime = when; /** - * Primary code processed with if-else statements for non constant comparisons, - * otherwise switch-case is used. + * Primary code processed with if-else statements for non constant + * comparisons, otherwise switch-case is used. */ if (primaryCode == TeclaKeyboardView.KEYCODE_STEPOUT) { TeclaApp.highlighter.externalstepOut(); TeclaStatic.logD(CLASS_TAG, "Hidden key.Stepping out..."); - }/* else if (primaryCode == TeclaKeyboardView.KEYCODE_DICTATION) { - //TODO: Add dictation actions here - if(TeclaApp.desktop==null) - TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); - - if(!TeclaApp.desktop.isConnected()&& !wifisearcherthread.isAlive()) { - wifisearcherthread=new Thread(desktopsearcher); - wifisearcherthread.start(); - } - TeclaApp.dict_lock=TeclaApp.mSendToPC; - TeclaApp.mSendToPC=false; - if (TeclaApp.DEBUG) Log.d ("mSendToPC",""+TeclaApp.mSendToPC); - TeclaApp.dictation_lock=new Object(); - TeclaApp.getInstance().startVoiceDictation(RecognizerIntent.EXTRA_LANGUAGE_MODEL); - } else if (primaryCode == TeclaKeyboardView.KEYCODE_SEND_TO_PC) { - //TODO: Add send to pc handling here - if(TeclaApp.desktop==null) - TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); - TeclaApp.mSendToPC=!TeclaApp.mSendToPC; - if (TeclaApp.DEBUG) - Log.d("voice","" + TeclaApp.desktop.isConnected() + " " + TeclaApp.mSendToPC + " " - + wifisearcherthread.isAlive() + " " + TeclaApp.connect_to_desktop); - if(TeclaApp.mSendToPC && TeclaApp.connect_to_desktop && !TeclaApp.desktop.isConnected()&& !wifisearcherthread.isAlive()) { - if (TeclaApp.DEBUG) Log.d("connection","entering new thread"); - wifisearcherthread=new Thread(wificonnector); - wifisearcherthread.start(); - } - else if(TeclaApp.desktop != null &&!TeclaApp.mSendToPC && TeclaApp.desktop.isConnected()){ - TeclaApp.desktop.disconnect(); - } - }*/ else { + }/* + * else if (primaryCode == TeclaKeyboardView.KEYCODE_DICTATION) { + * //TODO: Add dictation actions here if(TeclaApp.desktop==null) + * TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); + * + * if(!TeclaApp.desktop.isConnected()&& !wifisearcherthread.isAlive()) { + * wifisearcherthread=new Thread(desktopsearcher); + * wifisearcherthread.start(); } TeclaApp.dict_lock=TeclaApp.mSendToPC; + * TeclaApp.mSendToPC=false; if (TeclaApp.DEBUG) Log.d + * ("mSendToPC",""+TeclaApp.mSendToPC); TeclaApp.dictation_lock=new + * Object(); + * TeclaApp.getInstance().startVoiceDictation(RecognizerIntent. + * EXTRA_LANGUAGE_MODEL); } else if (primaryCode == + * TeclaKeyboardView.KEYCODE_SEND_TO_PC) { //TODO: Add send to pc + * handling here if(TeclaApp.desktop==null) TeclaApp.desktop=new + * TeclaDesktopClient(TeclaApp.getInstance()); + * TeclaApp.mSendToPC=!TeclaApp.mSendToPC; if (TeclaApp.DEBUG) + * Log.d("voice","" + TeclaApp.desktop.isConnected() + " " + + * TeclaApp.mSendToPC + " " + wifisearcherthread.isAlive() + " " + + * TeclaApp.connect_to_desktop); if(TeclaApp.mSendToPC && + * TeclaApp.connect_to_desktop && !TeclaApp.desktop.isConnected()&& + * !wifisearcherthread.isAlive()) { if (TeclaApp.DEBUG) + * Log.d("connection","entering new thread"); wifisearcherthread=new + * Thread(wificonnector); wifisearcherthread.start(); } else + * if(TeclaApp.desktop != null &&!TeclaApp.mSendToPC && + * TeclaApp.desktop.isConnected()){ TeclaApp.desktop.disconnect(); } } + */else { switch (primaryCode) { case Keyboard.KEYCODE_DELETE: handleBackspace(); @@ -901,7 +938,7 @@ else if(TeclaApp.desktop != null &&!TeclaApp.mSendToPC && TeclaApp.desktop.isCon handleSeparator(primaryCode); } else if (isSpecialKey(primaryCode)) { handleSpecialKey(primaryCode); - } else { + } else { handleCharacter(primaryCode, keyCodes); } // Cancel the just reverted state @@ -914,9 +951,9 @@ else if(TeclaApp.desktop != null &&!TeclaApp.mSendToPC && TeclaApp.desktop.isCon evaluateNavKbdTimeout(); } - /** * Handles key input on the Morse Code keyboard + * * @param primaryCode */ public void onKeyMorse(int primaryCode) { @@ -924,11 +961,12 @@ public void onKeyMorse(int primaryCode) { case TeclaKeyboard.KEYCODE_MORSE_DIT: case TeclaKeyboard.KEYCODE_MORSE_DAH: - + // Set a limit to the Morse sequence length - if (mTeclaMorse.getCurrentChar().length() < mTeclaMorse.getMorseDictionary().getMaxCodeLength()) { + if (mTeclaMorse.getCurrentChar().length() < mTeclaMorse + .getMorseDictionary().getMaxCodeLength()) { - if(primaryCode == TeclaKeyboard.KEYCODE_MORSE_DIT) + if (primaryCode == TeclaKeyboard.KEYCODE_MORSE_DIT) mTeclaMorse.addDit(); else mTeclaMorse.addDah(); @@ -949,37 +987,36 @@ public void onKeyMorse(int primaryCode) { updateSpaceKey(); mIMEView.invalidate(); } - + private void clearCharInProgress() { mTeclaMorse.clearCharInProgress(); } - + /** * Handles the space / end-of-character event (Morse keyboard only) - */ + */ private void handleMorseSpaceKey() { String currentChar = mTeclaMorse.getCurrentChar(); String curCharMatch = mTeclaMorse.morseToChar(currentChar); clearCharInProgress(); - + if (currentChar.length() == 0) { getCurrentInputConnection().commitText(" ", 1); - - } - else { + + } else { if (curCharMatch != null) { if (curCharMatch.contentEquals("↵")) { sendDownUpKeyEvents(KeyEvent.KEYCODE_ENTER); } else if (curCharMatch.contentEquals("DEL")) { - handleMorseBackspace(false); + handleMorseBackspace(false); } else if (curCharMatch.contentEquals("✓")) { updateSpaceKey(); handleSpecialKey(Keyboard.KEYCODE_DONE); } else if (curCharMatch.contentEquals("space")) { getCurrentInputConnection().commitText(" ", 1); } else if (curCharMatch.contentEquals("⇪")) { - int[] shift = {Keyboard.KEYCODE_SHIFT}; + int[] shift = { Keyboard.KEYCODE_SHIFT }; emulateKeyPress(shift); } else if (curCharMatch.contentEquals("↶")) { updateSpaceKey(); @@ -992,7 +1029,8 @@ private void handleMorseSpaceKey() { curCharMatch = curCharMatch.toUpperCase(); } - getCurrentInputConnection().commitText(curCharMatch, curCharMatch.length()); + getCurrentInputConnection().commitText(curCharMatch, + curCharMatch.length()); } } } @@ -1000,6 +1038,7 @@ private void handleMorseSpaceKey() { /** * Handles the backspace event (Morse keyboard only) + * * @param clearEnabled */ private void handleMorseBackspace(boolean clearEnabled) { @@ -1007,13 +1046,13 @@ private void handleMorseBackspace(boolean clearEnabled) { // otherwise, send through a backspace keypress if (mTeclaMorse.getCurrentChar().length() > 0 && clearEnabled) { clearCharInProgress(); - }else { + } else { sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL); clearCharInProgress(); updateSpaceKey(); } } - + /** * Updates the state of the Space key (Morse keyboard only) */ @@ -1022,28 +1061,30 @@ private void updateSpaceKey() { String charac = mTeclaMorse.morseToChar(sequence); mSpaceKey = mIMEView.getKeyboard().getMorseSpaceKey(); mSpaceKeyIndex = mIMEView.getKeyboard().getMorseSpaceKeyIndex(); - + if (mSpaceKey == null) return; if (charac == null && sequence.length() > 0) mSpaceKey.label = sequence; - else if (!sequence.equals("") && - sequence.length() <= mTeclaMorse.getMorseDictionary().getMaxCodeLength()) { - //Update the key label according the current character + else if (!sequence.equals("") + && sequence.length() <= mTeclaMorse.getMorseDictionary() + .getMaxCodeLength()) { + // Update the key label according the current character if (mIMEView.getKeyboard().isShifted()) { charac = charac.toUpperCase(); } mSpaceKey.label = charac + " " + sequence; mSpaceKey.icon = null; } - + else { - //Icon should take precedence over label, but it does not work, - //so set label to null + // Icon should take precedence over label, but it does not work, + // so set label to null mSpaceKey.label = null; - mSpaceKey.icon = TeclaApp.getInstance().getResources().getDrawable(R.drawable.sym_keyboard_space); + mSpaceKey.icon = TeclaApp.getInstance().getResources() + .getDrawable(R.drawable.sym_keyboard_space); } mIMEView.invalidateKey(mSpaceKeyIndex); @@ -1051,7 +1092,8 @@ else if (!sequence.equals("") && public void onText(CharSequence text) { InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; + if (ic == null) + return; ic.beginBatchEdit(); if (mPredicting) { commitTyped(ic); @@ -1065,7 +1107,8 @@ public void onText(CharSequence text) { private void handleBackspace() { boolean deleteChar = false; InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; + if (ic == null) + return; if (mPredicting) { final int length = mComposing.length(); if (length > 0) { @@ -1097,7 +1140,7 @@ private void handleBackspace() { } private void handleShift() { - //Keyboard currentKeyboard = mIMEView.getKeyboard(); + // Keyboard currentKeyboard = mIMEView.getKeyboard(); if (mKeyboardSwitcher.isAlphabetMode()) { // Alphabet keyboard checkToggleCapsLock(); @@ -1112,8 +1155,10 @@ private void handleCharacter(int primaryCode, int[] keyCodes) { CharSequence variants = null; TeclaKeyboard keyboard = mIMEView.getKeyboard(); Key key = keyboard.getKeyFromKeyCode(primaryCode); - if (key != null) variants = key.popupCharacters; - if (TeclaApp.persistence.isVariantsKeyOn() && variants != null && variants.length() > 0) { + if (key != null) + variants = key.popupCharacters; + if (TeclaApp.persistence.isVariantsKeyOn() && variants != null + && variants.length() > 0) { // Key has variants! mWasSymbols = mKeyboardSwitcher.isSymbols(); mWasShifted = keyboard.isShifted(); @@ -1148,7 +1193,8 @@ private void handleCharacter(int primaryCode, int[] keyCodes) { mIMEView.getKeyboard().setShifted(mWasShifted); evaluateStartScanning(); } else { - if (isAlphabet(primaryCode) && isPredictionOn() && !isCursorTouchingWord()) { + if (isAlphabet(primaryCode) && isPredictionOn() + && !isCursorTouchingWord()) { if (!mPredicting) { mPredicting = true; mComposing.setLength(0); @@ -1156,12 +1202,14 @@ private void handleCharacter(int primaryCode, int[] keyCodes) { } } if (mIMEView.isShifted()) { - // TODO: This doesn't work with ß, need to fix it in the next release. + // TODO: This doesn't work with ß, need to fix it in the next + // release. if (keyCodes == null || keyCodes[0] < Character.MIN_CODE_POINT || keyCodes[0] > Character.MAX_CODE_POINT) { return; } - primaryCode = new String(keyCodes, 0, 1).toUpperCase().charAt(0); + primaryCode = new String(keyCodes, 0, 1).toUpperCase() + .charAt(0); } if (mPredicting) { if (mIMEView.isShifted() && mComposing.length() == 0) { @@ -1175,18 +1223,19 @@ private void handleCharacter(int primaryCode, int[] keyCodes) { } postUpdateSuggestions(); } else { - sendKeyChar((char)primaryCode); + sendKeyChar((char) primaryCode); } updateShiftKeyState(getCurrentInputEditorInfo()); measureCps(); - TextEntryState.typedCharacter((char) primaryCode, isWordSeparator(primaryCode)); + TextEntryState.typedCharacter((char) primaryCode, + isWordSeparator(primaryCode)); if (mKeyboardSwitcher.isVariants()) { doVariantsExit(primaryCode); evaluateStartScanning(); } } } - + private void handleSeparator(int primaryCode) { boolean pickedDefault = false; // Handle separator @@ -1195,27 +1244,30 @@ private void handleSeparator(int primaryCode) { ic.beginBatchEdit(); } if (mPredicting) { - // In certain languages where single quote is a separator, it's better - // not to auto correct, but accept the typed word. For instance, - // in Italian dov' should not be expanded to dove' because the elision + // In certain languages where single quote is a separator, it's + // better + // not to auto correct, but accept the typed word. For instance, + // in Italian dov' should not be expanded to dove' because the + // elision // requires the last vowel to be removed. - if (mAutoCorrectOn && primaryCode != '\'' && - (mJustRevertedSeparator == null - || mJustRevertedSeparator.length() == 0 - || mJustRevertedSeparator.charAt(0) != primaryCode)) { + if (mAutoCorrectOn + && primaryCode != '\'' + && (mJustRevertedSeparator == null + || mJustRevertedSeparator.length() == 0 || mJustRevertedSeparator + .charAt(0) != primaryCode)) { pickDefaultSuggestion(); pickedDefault = true; } else { commitTyped(ic); } } - sendKeyChar((char)primaryCode); + sendKeyChar((char) primaryCode); TextEntryState.typedCharacter((char) primaryCode, true); - if (TextEntryState.getState() == TextEntryState.STATE_PUNCTUATION_AFTER_ACCEPTED + if (TextEntryState.getState() == TextEntryState.STATE_PUNCTUATION_AFTER_ACCEPTED && primaryCode != KEYCODE_ENTER) { swapPunctuationAndSpace(); - } else if (isPredictionOn() && primaryCode == ' ') { - //else if (TextEntryState.STATE_SPACE_AFTER_ACCEPTED) { + } else if (isPredictionOn() && primaryCode == ' ') { + // else if (TextEntryState.STATE_SPACE_AFTER_ACCEPTED) { doubleSpace(); } if (pickedDefault && mBestWord != null) { @@ -1249,12 +1301,13 @@ private void toggleCapsLock() { private void postUpdateSuggestions() { mHandler.removeMessages(MSG_UPDATE_SUGGESTIONS); - mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_UPDATE_SUGGESTIONS), 100); + mHandler.sendMessageDelayed( + mHandler.obtainMessage(MSG_UPDATE_SUGGESTIONS), 100); } private boolean isPredictionOn() { boolean predictionOn = mPredictionOn; - //if (isFullscreenMode()) predictionOn &= mPredictionLandscape; + // if (isFullscreenMode()) predictionOn &= mPredictionLandscape; return predictionOn; } @@ -1273,9 +1326,10 @@ private void updateSuggestions() { return; } - List stringList = mSuggest.getSuggestions(mIMEView, mWord, false); + List stringList = mSuggest.getSuggestions(mIMEView, + mWord, false); boolean correctionAvailable = mSuggest.hasMinimalCorrection(); - //|| mCorrectionMode == mSuggest.CORRECTION_FULL; + // || mCorrectionMode == mSuggest.CORRECTION_FULL; CharSequence typedWord = mWord.getTypedWord(); // If we're in basic correct boolean typedWordValid = mSuggest.isValidWord(typedWord); @@ -1285,7 +1339,8 @@ private void updateSuggestions() { // Don't auto-correct words with multiple capital letter correctionAvailable &= !mWord.isMostlyCaps(); - mCandidateView.setSuggestions(stringList, false, typedWordValid, correctionAvailable); + mCandidateView.setSuggestions(stringList, false, typedWordValid, + correctionAvailable); if (stringList.size() > 0) { if (correctionAvailable && !typedWordValid && stringList.size() > 1) { mBestWord = stringList.get(1); @@ -1332,25 +1387,28 @@ public void pickSuggestionManually(int index, CharSequence suggestion) { if (mAutoSpace) { sendSpace(); } - // Fool the state watcher so that a subsequent backspace will not do a revert + // Fool the state watcher so that a subsequent backspace will not do a + // revert TextEntryState.typedCharacter((char) KEYCODE_SPACE, true); } private void pickSuggestion(CharSequence suggestion) { if (mCapsLock) { suggestion = suggestion.toString().toUpperCase(); - } else if (preferCapitalization() + } else if (preferCapitalization() || (mKeyboardSwitcher.isAlphabetMode() && mIMEView.isShifted())) { suggestion = suggestion.toString().toUpperCase().charAt(0) - + suggestion.subSequence(1, suggestion.length()).toString(); + + suggestion.subSequence(1, suggestion.length()).toString(); } InputConnection ic = getCurrentInputConnection(); if (ic != null) { ic.commitText(suggestion, 1); } // Add the word to the auto dictionary if it's not a known word - if (mAutoDictionary.isValidWord(suggestion) || !mSuggest.isValidWord(suggestion)) { - mAutoDictionary.addWord(suggestion.toString(), FREQUENCY_FOR_PICKED); + if (mAutoDictionary.isValidWord(suggestion) + || !mSuggest.isValidWord(suggestion)) { + mAutoDictionary + .addWord(suggestion.toString(), FREQUENCY_FOR_PICKED); } mPredicting = false; mCommittedLength = suggestion.length(); @@ -1362,15 +1420,14 @@ private void pickSuggestion(CharSequence suggestion) { private boolean isCursorTouchingWord() { InputConnection ic = getCurrentInputConnection(); - if (ic == null) return false; + if (ic == null) + return false; CharSequence toLeft = ic.getTextBeforeCursor(1, 0); CharSequence toRight = ic.getTextAfterCursor(1, 0); - if (!TextUtils.isEmpty(toLeft) - && !isWordSeparator(toLeft.charAt(0))) { + if (!TextUtils.isEmpty(toLeft) && !isWordSeparator(toLeft.charAt(0))) { return true; } - if (!TextUtils.isEmpty(toRight) - && !isWordSeparator(toRight.charAt(0))) { + if (!TextUtils.isEmpty(toRight) && !isWordSeparator(toRight.charAt(0))) { return true; } return false; @@ -1383,10 +1440,12 @@ public void revertLastWord(boolean deleteChar) { mPredicting = true; ic.beginBatchEdit(); mJustRevertedSeparator = ic.getTextBeforeCursor(1, 0); - if (deleteChar) ic.deleteSurroundingText(1, 0); + if (deleteChar) + ic.deleteSurroundingText(1, 0); int toDelete = mCommittedLength; - CharSequence toTheLeft = ic.getTextBeforeCursor(mCommittedLength, 0); - if (toTheLeft != null && toTheLeft.length() > 0 + CharSequence toTheLeft = ic + .getTextBeforeCursor(mCommittedLength, 0); + if (toTheLeft != null && toTheLeft.length() > 0 && isWordSeparator(toTheLeft.charAt(0))) { toDelete--; } @@ -1407,17 +1466,17 @@ protected String getWordSeparators() { public boolean isWordSeparator(int code) { String separators = getWordSeparators(); - return separators.contains(String.valueOf((char)code)); + return separators.contains(String.valueOf((char) code)); } public boolean isSentenceSeparator(int code) { - return mSentenceSeparators.contains(String.valueOf((char)code)); + return mSentenceSeparators.contains(String.valueOf((char) code)); } private void sendSpace() { - sendKeyChar((char)KEYCODE_SPACE); + sendKeyChar((char) KEYCODE_SPACE); updateShiftKeyState(getCurrentInputEditorInfo()); - //onKey(KEY_SPACE[0], KEY_SPACE); + // onKey(KEY_SPACE[0], KEY_SPACE); } public boolean preferCapitalization() { @@ -1426,7 +1485,7 @@ public boolean preferCapitalization() { public void swipeRight() { if (TeclaKeyboardView.DEBUG_AUTO_PLAY) { - ClipboardManager cm = ((ClipboardManager)getSystemService(CLIPBOARD_SERVICE)); + ClipboardManager cm = ((ClipboardManager) getSystemService(CLIPBOARD_SERVICE)); CharSequence text = cm.getText(); if (!TextUtils.isEmpty(text)) { mIMEView.startPlaying(text.toString()); @@ -1435,7 +1494,7 @@ public void swipeRight() { } public void swipeLeft() { - //handleBackspace(); + // handleBackspace(); } public void swipeDown() { @@ -1443,7 +1502,7 @@ public void swipeDown() { } public void swipeUp() { - //launchSettings(); + // launchSettings(); } public void onPress(int primaryCode) { @@ -1451,8 +1510,7 @@ public void onPress(int primaryCode) { if (TeclaApp.persistence.getMorseKeyMode() == SINGLE_KEY_MODE) { evaluateMorsePress(); } - } - else { + } else { vibrate(); playKeySound(primaryCode); } @@ -1465,7 +1523,7 @@ public void onRelease(int primaryCode) { evaluateEndOfChar(); } } - //vibrate(); + // vibrate(); } // update flags for silent mode @@ -1477,7 +1535,7 @@ private void updateRingerMode() { mSilentMode = (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL); } } - + private void checkRingerMode() { // if mAudioManager is null, we don't have the ringer state yet // mAudioManager will be set by updateRingerMode @@ -1499,7 +1557,7 @@ private void playKeySound(int primaryCode) { duration = 100; else duration = TeclaApp.persistence.getMorseTimeUnit(); - + switch (primaryCode) { case Keyboard.KEYCODE_DELETE: sound = AudioManager.FX_KEYPRESS_DELETE; @@ -1513,7 +1571,7 @@ private void playKeySound(int primaryCode) { sound = AudioManager.FX_KEYPRESS_SPACEBAR; mAudioManager.playSoundEffect(sound, FX_VOLUME); break; - + case TeclaKeyboard.KEYCODE_MORSE_DIT: mTone.startTone(mToneType, duration); break; @@ -1535,10 +1593,13 @@ private void vibrate() { } private void checkTutorial(String privateImeOptions) { - if (privateImeOptions == null) return; + if (privateImeOptions == null) + return; if (privateImeOptions.equals("com.android.setupwizard:ShowTutorial")) { - if (mTutorial == null) startTutorial(); - } else if (privateImeOptions.equals("com.android.setupwizard:HideTutorial")) { + if (mTutorial == null) + startTutorial(); + } else if (privateImeOptions + .equals("com.android.setupwizard:HideTutorial")) { if (mTutorial != null) { if (mTutorial.close()) { mTutorial = null; @@ -1548,7 +1609,8 @@ private void checkTutorial(String privateImeOptions) { } private void startTutorial() { - mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_START_TUTORIAL), 500); + mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_START_TUTORIAL), + 500); } void tutorialDone() { @@ -1556,7 +1618,8 @@ void tutorialDone() { } void promoteToUserDictionary(String word, int frequency) { - if (mUserDictionary.isValidWord(word)) return; + if (mUserDictionary.isValidWord(word)) + return; mUserDictionary.addWord(word, frequency); } @@ -1570,24 +1633,30 @@ private void launchSettings() { private void loadSettings() { // Get the settings preferences - SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); + SharedPreferences sp = PreferenceManager + .getDefaultSharedPreferences(this); mVibrateOn = sp.getBoolean(PREF_VIBRATE_ON, false); mSoundOn = sp.getBoolean(PREF_SOUND_ON, false); mAutoCap = sp.getBoolean(PREF_AUTO_CAP, true); mQuickFixes = sp.getBoolean(PREF_QUICK_FIXES, true); - // If there is no auto text data, then quickfix is forced to "on", so that the other options + // If there is no auto text data, then quickfix is forced to "on", so + // that the other options // will continue to work - if (AutoText.getSize(mIMEView) < 1) mQuickFixes = true; - //TODO: Tecla - changed default show_suggestions to false - // need to change back when the dictionary is ready! - //mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, true) & mQuickFixes; - mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, false) & mQuickFixes; - boolean autoComplete = sp.getBoolean(PREF_AUTO_COMPLETE, - getResources().getBoolean(R.bool.enable_autocorrect)) & mShowSuggestions; + if (AutoText.getSize(mIMEView) < 1) + mQuickFixes = true; + // TODO: Tecla - changed default show_suggestions to false + // need to change back when the dictionary is ready! + // mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, true) & + // mQuickFixes; + mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, false) + & mQuickFixes; + boolean autoComplete = sp.getBoolean(PREF_AUTO_COMPLETE, getResources() + .getBoolean(R.bool.enable_autocorrect)) + & mShowSuggestions; mAutoCorrectOn = mSuggest != null && (autoComplete || mQuickFixes); - mCorrectionMode = autoComplete - ? Suggest.CORRECTION_FULL - : (mQuickFixes ? Suggest.CORRECTION_BASIC : Suggest.CORRECTION_NONE); + mCorrectionMode = autoComplete ? Suggest.CORRECTION_FULL + : (mQuickFixes ? Suggest.CORRECTION_BASIC + : Suggest.CORRECTION_NONE); } private void showOptionsMenu() { @@ -1597,23 +1666,22 @@ private void showOptionsMenu() { builder.setNegativeButton(android.R.string.cancel, null); CharSequence itemSettings = getString(R.string.english_ime_settings); CharSequence itemInputMethod = getString(R.string.inputMethod); - builder.setItems(new CharSequence[] { - itemSettings, itemInputMethod}, + builder.setItems(new CharSequence[] { itemSettings, itemInputMethod }, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface di, int position) { - di.dismiss(); - switch (position) { - case POS_SETTINGS: - launchSettings(); - break; - case POS_METHOD: - ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)) - .showInputMethodPicker(); - break; - } - } - }); + public void onClick(DialogInterface di, int position) { + di.dismiss(); + switch (position) { + case POS_SETTINGS: + launchSettings(); + break; + case POS_METHOD: + ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)) + .showInputMethodPicker(); + break; + } + } + }); builder.setTitle(getResources().getString(R.string.english_ime_name)); mOptionsDialog = builder.create(); Window window = mOptionsDialog.getWindow(); @@ -1634,7 +1702,8 @@ private void changeKeyboardMode() { updateShiftKeyState(getCurrentInputEditorInfo()); } - @Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { + @Override + protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { super.dump(fd, fout, args); final Printer p = new PrintWriterPrinter(fout); @@ -1654,7 +1723,7 @@ private void changeKeyboardMode() { } // Characters per second measurement - + private static final boolean PERF_DEBUG = false; private long mLastCpsTime; private static final int CPS_BUFFER_SIZE = 16; @@ -1662,21 +1731,26 @@ private void changeKeyboardMode() { private int mCpsIndex; private void measureCps() { - if (!TeclaIME.PERF_DEBUG) return; + if (!TeclaIME.PERF_DEBUG) + return; long now = System.currentTimeMillis(); - if (mLastCpsTime == 0) mLastCpsTime = now - 100; // Initial + if (mLastCpsTime == 0) + mLastCpsTime = now - 100; // Initial mCpsIntervals[mCpsIndex] = now - mLastCpsTime; mLastCpsTime = now; mCpsIndex = (mCpsIndex + 1) % CPS_BUFFER_SIZE; long total = 0; - for (int i = 0; i < CPS_BUFFER_SIZE; i++) total += mCpsIntervals[i]; + for (int i = 0; i < CPS_BUFFER_SIZE; i++) + total += mCpsIntervals[i]; System.out.println("CPS = " + ((CPS_BUFFER_SIZE * 1000f) / total)); } class AutoDictionary extends ExpandableDictionary { - // If the user touches a typed word 2 times or more, it will become valid. + // If the user touches a typed word 2 times or more, it will become + // valid. private static final int VALIDITY_THRESHOLD = 2 * FREQUENCY_FOR_PICKED; - // If the user touches a typed word 5 times or more, it will be added to the user dict. + // If the user touches a typed word 5 times or more, it will be added to + // the user dict. private static final int PROMOTION_THRESHOLD = 5 * FREQUENCY_FOR_PICKED; public AutoDictionary(Context context) { @@ -1693,22 +1767,24 @@ public boolean isValidWord(CharSequence word) { public void addWord(String word, int addFrequency) { final int length = word.length(); // Don't add very short or very long words. - if (length < 2 || length > getMaxWordLength()) return; + if (length < 2 || length > getMaxWordLength()) + return; super.addWord(word, addFrequency); final int freq = getWordFrequency(word); if (freq > PROMOTION_THRESHOLD) { - TeclaIME.this.promoteToUserDictionary(word, FREQUENCY_FOR_AUTO_ADD); + TeclaIME.this.promoteToUserDictionary(word, + FREQUENCY_FOR_AUTO_ADD); } } } - //TECLA CONSTANTS AND VARIABLES + // TECLA CONSTANTS AND VARIABLES /** * Tag used for logging in this class */ private static final String CLASS_TAG = "IME: "; - //TODO: Try moving these variables to TeclaApp class + // TODO: Try moving these variables to TeclaApp class private String mVoiceInputString; private int mLastKeyboardMode, mLastFullKeyboardMode; private boolean mShieldConnected; @@ -1722,87 +1798,101 @@ public void addWord(String word, int addFrequency) { private void initTeclaA11y() { // register to receive switch events from Tecla shield - registerReceiver(mReceiver, new IntentFilter(TeclaShieldService.ACTION_SHIELD_CONNECTED)); - registerReceiver(mReceiver, new IntentFilter(TeclaShieldService.ACTION_SHIELD_DISCONNECTED)); - registerReceiver(mReceiver, new IntentFilter(SwitchEvent.ACTION_SWITCH_EVENT_RECEIVED)); + registerReceiver(mReceiver, new IntentFilter( + TeclaShieldService.ACTION_SHIELD_CONNECTED)); + registerReceiver(mReceiver, new IntentFilter( + TeclaShieldService.ACTION_SHIELD_DISCONNECTED)); + registerReceiver(mReceiver, new IntentFilter( + SwitchEvent.ACTION_SWITCH_EVENT_RECEIVED)); registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_SHOW_IME)); registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_HIDE_IME)); - registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_ENABLE_MORSE)); - registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_DISABLE_MORSE)); - registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_START_FS_SWITCH_MODE)); - registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_STOP_FS_SWITCH_MODE)); - registerReceiver(mReceiver, new IntentFilter(Highlighter.ACTION_START_SCANNING)); - registerReceiver(mReceiver, new IntentFilter(Highlighter.ACTION_STOP_SCANNING)); - registerReceiver(mReceiver, new IntentFilter(TeclaApp.ACTION_INPUT_STRING)); - - mLastFullKeyboardMode = TeclaApp.persistence.isMorseModeEnabled() ? KeyboardSwitcher.MODE_MORSE : KeyboardSwitcher.MODE_TEXT; - mTeclaHandler = new Handler(); - mShieldConnected = false; - mWasSymbols = false; - mWasShifted = false; - + registerReceiver(mReceiver, new IntentFilter( + TeclaApp.ACTION_ENABLE_MORSE)); + registerReceiver(mReceiver, new IntentFilter( + TeclaApp.ACTION_DISABLE_MORSE)); + registerReceiver(mReceiver, new IntentFilter( + TeclaApp.ACTION_START_FS_SWITCH_MODE)); + registerReceiver(mReceiver, new IntentFilter( + TeclaApp.ACTION_STOP_FS_SWITCH_MODE)); + registerReceiver(mReceiver, new IntentFilter( + Highlighter.ACTION_START_SCANNING)); + registerReceiver(mReceiver, new IntentFilter( + Highlighter.ACTION_STOP_SCANNING)); + registerReceiver(mReceiver, new IntentFilter( + TeclaApp.ACTION_INPUT_STRING)); + + mLastFullKeyboardMode = TeclaApp.persistence.isMorseModeEnabled() ? KeyboardSwitcher.MODE_MORSE + : KeyboardSwitcher.MODE_TEXT; + mTeclaHandler = new Handler(); + mShieldConnected = false; + mWasSymbols = false; + mWasShifted = false; + if (TeclaApp.persistence.isPersistentKeyboardEnabled()) { TeclaApp.getInstance().queueSplash(); } } - + private void typeInputString(String input_string) { - Log.d(TeclaApp.TAG, CLASS_TAG + "Received input string: " + input_string); + Log.d(TeclaApp.TAG, CLASS_TAG + "Received input string: " + + input_string); mVoiceInputString = input_string; mTeclaHandler.removeCallbacks(mAutoPlayRunnable); mTeclaHandler.postDelayed(mAutoPlayRunnable, 1000); } - + public Runnable mAutoPlayRunnable = new Runnable() { public void run() { - //mIMEView.startPlaying(mVoiceInputString); + // mIMEView.startPlaying(mVoiceInputString); onText(mVoiceInputString); } - + }; - - //Used to track the duration of a single-key press + + // Used to track the duration of a single-key press private void startTimer() { mMorseStartTime = System.currentTimeMillis(); } - + /** * Starts the Morse repeat runnable + * * @param delay */ public void evaluateRepeating(long delay) { pauseMorseRepeating(); mTeclaHandler.postDelayed(mStartMorseRepeatRunnable, delay); } - + /** * Evaluates a Morse key press, based on the current key mode */ public void evaluateMorsePress() { - switch(TeclaApp.persistence.getMorseKeyMode()) { + switch (TeclaApp.persistence.getMorseKeyMode()) { case TRIPLE_KEY_MODE: evaluateRepeating(0); break; - + case DOUBLE_KEY_MODE: - int[] key = {mRepeatedKey}; + int[] key = { mRepeatedKey }; emulateKeyPress(key); break; - + case SINGLE_KEY_MODE: startTimer(); - //Play audio feedback while key is pressed + // Play audio feedback while key is pressed checkRingerMode(); if (mSoundOn && !mSilentMode) mTone.startTone(mToneType); break; } } - + /** * Handles a Morse key-up event in single-key mode + * * @return true if a dit/dah has been added, false otherwise */ private boolean handleSingleKeyUp() { @@ -1810,18 +1900,21 @@ private boolean handleSingleKeyUp() { mTone.stopTone(); long duration = System.currentTimeMillis() - mMorseStartTime; - if (mTeclaMorse.getCurrentChar().length() < mTeclaMorse.getMorseDictionary().getMaxCodeLength()) { - if (duration < TeclaApp.persistence.getMorseTimeUnit() * ERROR_MARGIN) { + if (mTeclaMorse.getCurrentChar().length() < mTeclaMorse + .getMorseDictionary().getMaxCodeLength()) { + if (duration < TeclaApp.persistence.getMorseTimeUnit() + * ERROR_MARGIN) { mTeclaMorse.addDit(); addedDitDah = true; } - else if (duration < (TeclaApp.persistence.getMorseTimeUnit() * 3) * ERROR_MARGIN) { + else if (duration < (TeclaApp.persistence.getMorseTimeUnit() * 3) + * ERROR_MARGIN) { mTeclaMorse.addDah(); addedDitDah = true; } } - + updateSpaceKey(); mIMEView.invalidate(); return addedDitDah; @@ -1835,32 +1928,33 @@ public void pauseMorseRepeating() { mTeclaHandler.removeCallbacks(mStartMorseRepeatRunnable); mTeclaHandler.removeCallbacks(mMorseEndOfCharRunnable); } - + /** * Runnable used to repeat an occurence of a Morse key */ private Runnable mRepeatMorseRunnable = new Runnable() { public void run() { final long start = SystemClock.uptimeMillis(); - int[] key = {mRepeatedKey}; + int[] key = { mRepeatedKey }; emulateKeyPress(key); - mTeclaHandler.postAtTime(this, start + TeclaApp.persistence.getRepeatFrequency()); + mTeclaHandler.postAtTime(this, + start + TeclaApp.persistence.getRepeatFrequency()); } }; - + /** * Runnable used to start the Morse key repetition process */ private Runnable mStartMorseRepeatRunnable = new Runnable() { public void run() { - int[] key = {mRepeatedKey}; + int[] key = { mRepeatedKey }; emulateKeyPress(key); int frequency = TeclaApp.persistence.getRepeatFrequency(); if (frequency != Persistence.NEVER_REPEAT) mTeclaHandler.postDelayed(mRepeatMorseRunnable, frequency); } }; - + /** * Runnable used to process a Morse end-of-character event */ @@ -1871,7 +1965,7 @@ public void run() { mIMEView.invalidate(); } }; - + /** * Evalutes the Morse end-of-character event, based on the current key mode */ @@ -1879,32 +1973,34 @@ private void evaluateEndOfChar() { switch (TeclaApp.persistence.getMorseKeyMode()) { case TRIPLE_KEY_MODE: break; - case DOUBLE_KEY_MODE: mTeclaHandler.removeCallbacks(mMorseEndOfCharRunnable); - mTeclaHandler.postDelayed(mMorseEndOfCharRunnable, 3 * TeclaApp.persistence.getMorseTimeUnit()); + mTeclaHandler.postDelayed(mMorseEndOfCharRunnable, + 3 * TeclaApp.persistence.getMorseTimeUnit()); break; case SINGLE_KEY_MODE: if (handleSingleKeyUp() == true) { mTeclaHandler.removeCallbacks(mMorseEndOfCharRunnable); - mTeclaHandler.postDelayed(mMorseEndOfCharRunnable, 3 * TeclaApp.persistence.getMorseTimeUnit()); + mTeclaHandler.postDelayed(mMorseEndOfCharRunnable, + 3 * TeclaApp.persistence.getMorseTimeUnit()); } break; } } - + /** * Handler of Morse switch events + * * @param switchEvent * @param action */ private void handleMorseSwitch(SwitchEvent switchEvent, int action) { - switch(action) { + switch (action) { case 1: - //Add a dit to the current Morse sequence (repeatable) + // Add a dit to the current Morse sequence (repeatable) if (switchEvent.isPressed(switchEvent.getSwitchChanges())) { mRepeatedKey = TeclaKeyboard.KEYCODE_MORSE_DIT; evaluateMorsePress(); @@ -1916,7 +2012,7 @@ private void handleMorseSwitch(SwitchEvent switchEvent, int action) { break; case 2: - //Add a dah to the current Morse sequence (repeatable) + // Add a dah to the current Morse sequence (repeatable) if (switchEvent.isPressed(switchEvent.getSwitchChanges())) { mRepeatedKey = TeclaKeyboard.KEYCODE_MORSE_DAH; evaluateMorsePress(); @@ -1928,15 +2024,15 @@ private void handleMorseSwitch(SwitchEvent switchEvent, int action) { break; case 3: - //Send through a space key event + // Send through a space key event if (switchEvent.isPressed(switchEvent.getSwitchChanges())) { - int[] key = {TeclaKeyboard.KEYCODE_MORSE_SPACEKEY}; + int[] key = { TeclaKeyboard.KEYCODE_MORSE_SPACEKEY }; emulateKeyPress(key); } break; case 4: - //Send through a backspace event (repeatable) + // Send through a backspace event (repeatable) if (switchEvent.isPressed(switchEvent.getSwitchChanges())) { mRepeatedKey = TeclaKeyboard.KEYCODE_MORSE_DELKEY; evaluateMorsePress(); @@ -1947,9 +2043,9 @@ private void handleMorseSwitch(SwitchEvent switchEvent, int action) { break; case 5: - //Hide the Morse IME view + // Hide the Morse IME view if (switchEvent.isPressed(switchEvent.getSwitchChanges())) { - int[] key = {Keyboard.KEYCODE_DONE}; + int[] key = { Keyboard.KEYCODE_DONE }; emulateKeyPress(key); } break; @@ -1957,41 +2053,51 @@ private void handleMorseSwitch(SwitchEvent switchEvent, int action) { break; } } - + /** * Switch events are processed here + * * @param switchEvent */ + @SuppressWarnings("static-access") private void handleSwitchEvent(SwitchEvent switchEvent) { if (switchEvent.isAnyPressed()) { - if (TeclaApp.persistence.isRepeatingKey()) stopRepeatingKey(); + if (TeclaApp.persistence.isRepeatingKey()) + stopRepeatingKey(); } - - //Emulator issue (temporary fix): if typing too fast, or holding a long press - //while in auto-release mode, some switch events are null + + // Emulator issue (temporary fix): if typing too fast, or holding a long + // press + // while in auto-release mode, some switch events are null if (switchEvent.toString() == null) { Log.w(TeclaApp.TAG, "Captured null switch event"); return; } cancelNavKbdTimeout(); - if (!TeclaApp.highlighter.isSoftIMEShowing() && TeclaApp.persistence.isPersistentKeyboardEnabled()) { + if (!TeclaApp.highlighter.isSoftIMEShowing() + && TeclaApp.persistence.isPersistentKeyboardEnabled()) { showIMEView(); evaluateStartScanning(); } else { - - //Collect the mapped actions of the current switch - String[] switchActions = TeclaApp.persistence.getSwitchMap().get(switchEvent.toString()); - + + // Collect the mapped actions of the current switch + String[] switchActions = TeclaApp.persistence.getSwitchMap().get( + switchEvent.toString()); + if (mKeyboardSwitcher.isMorseMode()) { - //Switches have different actions when Morse keyboard is showing - handleMorseSwitch(switchEvent, Integer.parseInt(switchActions[1])); + // Switches have different actions when Morse keyboard is + // showing + handleMorseSwitch(switchEvent, + Integer.parseInt(switchActions[1])); } - + else { String action_tecla = switchActions[0]; - switch(Integer.parseInt(action_tecla)) { + TeclaStatic.logI(TeclaApp.TAG, CLASS_TAG + "action_tecla: " + + action_tecla.toString()); + switch (Integer.parseInt(action_tecla)) { case SwitchEvent.ACTION_NEXT: if (switchEvent.isPressed(switchEvent.getSwitchChanges())) @@ -2019,9 +2125,13 @@ private void handleSwitchEvent(SwitchEvent switchEvent) { if (switchEvent.isReleased(switchEvent.getSwitchChanges())) { if (TeclaApp.persistence.isInverseScanningEnabled()) { if (TeclaApp.persistence.isInverseScanningChanged()) { - //Ignore event right after Inverse Scanning is Enabled - TeclaApp.persistence.unsetInverseScanningChanged(); - Log.w(TeclaApp.TAG, CLASS_TAG + "Ignoring switch event because Inverse Scanning was just enabled"); + // Ignore event right after Inverse Scanning is + // Enabled + TeclaApp.persistence + .unsetInverseScanningChanged(); + Log.w(TeclaApp.TAG, + CLASS_TAG + + "Ignoring switch event because Inverse Scanning was just enabled"); } else { selectHighlighted(false); } @@ -2029,27 +2139,41 @@ private void handleSwitchEvent(SwitchEvent switchEvent) { } break; + case SwitchEvent.ACTION_EMERGENCY: + if (switchEvent.isPressed(switchEvent.getSwitchChanges())) + TeclaApp.emergencyCallout.Callout(this); + break; + default: break; } } - - TeclaStatic.logD(CLASS_TAG, "Switch event received: " + - TeclaApp.getInstance().byte2Hex(switchEvent.getSwitchChanges()) + ":" + - TeclaApp.getInstance().byte2Hex(switchEvent.getSwitchStates())); - - TeclaStatic.logD(CLASS_TAG, "Byte handled: " + - TeclaApp.getInstance().byte2Hex(switchEvent.getSwitchStates()) + " at " + SystemClock.uptimeMillis()); + + TeclaStatic.logD( + CLASS_TAG, + "Switch event received: " + + TeclaApp.getInstance().byte2Hex( + switchEvent.getSwitchChanges()) + + ":" + + TeclaApp.getInstance().byte2Hex( + switchEvent.getSwitchStates())); + + TeclaStatic.logD( + CLASS_TAG, + "Byte handled: " + + TeclaApp.getInstance().byte2Hex( + switchEvent.getSwitchStates()) + " at " + + SystemClock.uptimeMillis()); } - - evaluateNavKbdTimeout(); + + evaluateNavKbdTimeout(); } - + /** * Determine weather the current keyboard should auto-hide. */ private void evaluateNavKbdTimeout() { - if(mKeyboardSwitcher.isNavigation()) { + if (mKeyboardSwitcher.isNavigation()) { resetNavKbdTimeout(); } else { cancelNavKbdTimeout(); @@ -2070,7 +2194,8 @@ private void cancelNavKbdTimeout() { private void resetNavKbdTimeout() { cancelNavKbdTimeout(); int navKbdTimeout = TeclaApp.persistence.getNavigationKeyboardTimeout(); - TeclaStatic.logD(CLASS_TAG, "Navigation keyboard timeout in: " + navKbdTimeout + " seconds"); + TeclaStatic.logD(CLASS_TAG, "Navigation keyboard timeout in: " + + navKbdTimeout + " seconds"); if (navKbdTimeout != Persistence.NEVER_AUTOHIDE) mTeclaHandler.postDelayed(hideNavKbdRunnable, navKbdTimeout * 1000); } @@ -2085,15 +2210,17 @@ public void run() { /** * Select the currently highlighted item. - * @param repeat true if a key should be repeated on hold, false otherwise. + * + * @param repeat + * true if a key should be repeated on hold, false otherwise. */ private void selectHighlighted(Boolean repeat) { - //FIXME: Repeat key has been implemented only for navigation keys... + // FIXME: Repeat key has been implemented only for navigation keys... // will disable it here for now. repeat = false; TeclaApp.highlighter.pauseSelfScanning(); if (TeclaApp.highlighter.getScanDepth() == Highlighter.DEPTH_KEY) { - //Selected item is a key + // Selected item is a key mKeyCodes = TeclaApp.highlighter.getCurrentKey().codes; if (repeat && isRepeatableWithTecla(mKeyCodes[0])) { mTeclaHandler.post(mRepeatKeyRunnable); @@ -2102,11 +2229,11 @@ private void selectHighlighted(Boolean repeat) { TeclaApp.highlighter.doSelectKey(mKeyCodes[0]); } } else { - //Selected item is a row + // Selected item is a row TeclaApp.highlighter.doSelectRow(); } } - + private boolean isMorseKeyboardKey(int keycode) { return (keycode == TeclaKeyboard.KEYCODE_MORSE_DIT) || (keycode == TeclaKeyboard.KEYCODE_MORSE_DAH) @@ -2115,8 +2242,7 @@ private boolean isMorseKeyboardKey(int keycode) { } private boolean isSpecialKey(int keycode) { - return ((keycode>=KeyEvent.KEYCODE_DPAD_UP) - && (keycode<=KeyEvent.KEYCODE_DPAD_CENTER)) + return ((keycode >= KeyEvent.KEYCODE_DPAD_UP) && (keycode <= KeyEvent.KEYCODE_DPAD_CENTER)) || (keycode == KeyEvent.KEYCODE_BACK) || (keycode == KeyEvent.KEYCODE_SEARCH) || (keycode == KeyEvent.KEYCODE_VOLUME_DOWN) @@ -2135,7 +2261,8 @@ private void handleSpecialKey(int keyEventCode) { hideAltNavKeyboard(); } if (keyEventCode == Keyboard.KEYCODE_DONE) { - if (!mKeyboardSwitcher.isNavigation() && !mKeyboardSwitcher.isVariants()) { + if (!mKeyboardSwitcher.isNavigation() + && !mKeyboardSwitcher.isVariants()) { // Closing mLastFullKeyboardMode = mKeyboardSwitcher.getKeyboardMode(); mWasShifted = keyboard.isShifted(); @@ -2148,7 +2275,7 @@ private void handleSpecialKey(int keyEventCode) { mKeyboardSwitcher.setKeyboardMode(mLastFullKeyboardMode); keyboard.setShifted(mWasShifted); } - + evaluateStartScanning(); } } else if (keyEventCode == KeyEvent.KEYCODE_BACK) { @@ -2156,14 +2283,14 @@ private void handleSpecialKey(int keyEventCode) { hideSoftIME(); } keyDownUp(keyEventCode); - } else if (keyEventCode == TeclaKeyboard.KEYCODE_REPEAT_LOCK) { + } else if (keyEventCode == TeclaKeyboard.KEYCODE_REPEAT_LOCK) { if (TeclaApp.persistence.isRepeatLockOn()) { stopRepeatingKey(); } else { TeclaApp.persistence.setRepeatLockOn(); redrawKeyboard(); } - } else if (keyEventCode == TeclaKeyboard.KEYCODE_VARIANTS) { + } else if (keyEventCode == TeclaKeyboard.KEYCODE_VARIANTS) { if (TeclaApp.persistence.isVariantsKeyOn()) { TeclaApp.persistence.setVariantsKeyOff(); } else { @@ -2174,21 +2301,25 @@ private void handleSpecialKey(int keyEventCode) { if (mKeyboardSwitcher.isNavigation()) { TeclaApp.getInstance().startVoiceActions(); } else { - TeclaApp.getInstance().startVoiceInput(RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); + TeclaApp.getInstance().startVoiceInput( + RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); } - } else if (keyEventCode == TeclaKeyboard.KEYCODE_ALTNAV) { - TeclaApp.persistence.setAltNavKeyboardOn(!TeclaApp.persistence.isAltNavKeyboardOn()); + } else if (keyEventCode == TeclaKeyboard.KEYCODE_ALTNAV) { + TeclaApp.persistence.setAltNavKeyboardOn(!TeclaApp.persistence + .isAltNavKeyboardOn()); redrawKeyboard(); } else { - if (TeclaApp.persistence.isRepeatLockOn() && !TeclaApp.persistence.isRepeatingKey() && isRepeatableWithTecla(keyEventCode)) { + if (TeclaApp.persistence.isRepeatLockOn() + && !TeclaApp.persistence.isRepeatingKey() + && isRepeatableWithTecla(keyEventCode)) { startRepeatingKey(keyEventCode); } else { keyDownUp(keyEventCode); } } } - - private void redrawKeyboard () { + + private void redrawKeyboard() { mLastKeyboardMode = mKeyboardSwitcher.getKeyboardMode(); mKeyboardSwitcher.setKeyboardMode(mLastKeyboardMode); TeclaKeyboard keyboard = mIMEView.getKeyboard(); @@ -2196,7 +2327,7 @@ private void redrawKeyboard () { keyboard.updateRepeatLockState(); mIMEView.invalidateAllKeys(); } - + private void hideAltNavKeyboard() { if (TeclaApp.persistence.isAltNavKeyboardOn()) { TeclaApp.persistence.setAltNavKeyboardOn(false); @@ -2215,21 +2346,21 @@ private void keyDownUp(int keyEventCode) { } private boolean isRepeatableWithTecla(int code) { - if (code == TeclaKeyboard.KEYCODE_DONE || - code == TeclaKeyboard.KEYCODE_VOICE || - code == TeclaKeyboard.KEYCODE_VARIANTS) { + if (code == TeclaKeyboard.KEYCODE_DONE + || code == TeclaKeyboard.KEYCODE_VOICE + || code == TeclaKeyboard.KEYCODE_VARIANTS) { return false; } return true; } - + private void startRepeatingKey(int keycode) { mTeclaHandler.removeCallbacks(mRepeatKeyRunnable); mRepeatingKeyCode = keycode; TeclaApp.persistence.setRepeatingKey(true); mTeclaHandler.post(mRepeatKeyRunnable); } - + private void stopRepeatingKey() { mTeclaHandler.removeCallbacks(mRepeatKeyRunnable); TeclaApp.persistence.setRepeatingKey(false); @@ -2240,7 +2371,8 @@ private void stopRepeatingKey() { private Runnable mRepeatKeyRunnable = new Runnable() { public void run() { keyDownUp(mRepeatingKeyCode); - mTeclaHandler.postDelayed(mRepeatKeyRunnable, TeclaApp.persistence.getScanDelay()); + mTeclaHandler.postDelayed(mRepeatKeyRunnable, + TeclaApp.persistence.getScanDelay()); } }; @@ -2251,30 +2383,32 @@ private void emulateKeyPress(int[] key_codes) { playKeySound(key_codes[0]); } - private void startFullScreenSwitchMode(int delay) { mTeclaHandler.removeCallbacks(mCreateSwitchRunnable); mTeclaHandler.postDelayed(mCreateSwitchRunnable, delay); - TeclaStatic.logD(CLASS_TAG, "Sent delayed broadcast to show fullscreen switch"); + TeclaStatic.logD(CLASS_TAG, + "Sent delayed broadcast to show fullscreen switch"); } - + /** * Runnable used to create full-screen switch overlay */ - private Runnable mCreateSwitchRunnable = new Runnable () { + private Runnable mCreateSwitchRunnable = new Runnable() { public void run() { if (TeclaApp.highlighter.isSoftIMEShowing()) { Display display = getDisplay(); if (mSwitchPopup == null) { - //Create single-switch pop-up - mSwitch = getLayoutInflater().inflate(R.layout.popup_fullscreen_transparent, null); + // Create single-switch pop-up + mSwitch = getLayoutInflater().inflate( + R.layout.popup_fullscreen_transparent, null); mSwitch.setOnTouchListener(mSwitchTouchListener); mSwitch.setOnClickListener(mSwitchClickListener); mSwitch.setOnLongClickListener(mSwitchLongPressListener); mSwitchPopup = new PopupWindow(mSwitch); } - if (mSwitchPopup.isShowing()) mSwitchPopup.dismiss(); + if (mSwitchPopup.isShowing()) + mSwitchPopup.dismiss(); mSwitchPopup.setWidth(display.getWidth()); mSwitchPopup.setHeight(display.getHeight()); mSwitchPopup.showAtLocation(mIMEView, Gravity.NO_GRAVITY, 0, 0); @@ -2291,11 +2425,12 @@ public void run() { * Listener for full-screen single switch long press */ private View.OnLongClickListener mSwitchLongPressListener = new View.OnLongClickListener() { - + public boolean onLongClick(View v) { if (!TeclaApp.persistence.isInverseScanningEnabled()) { launchSettings(); - //Doing this here again because the ACTION_UP event in the onTouch listener doesn't always work. + // Doing this here again because the ACTION_UP event in the + // onTouch listener doesn't always work. mSwitch.setBackgroundResource(R.drawable.screen_switch_background_normal); mSwitchPopup.setBackgroundDrawable(null); return true; @@ -2308,20 +2443,21 @@ public boolean onLongClick(View v) { * Listener for full-screen switch actions */ private View.OnTouchListener mSwitchTouchListener = new View.OnTouchListener() { - + public boolean onTouch(View v, MotionEvent event) { int changes = SwitchEvent.MASK_SWITCH_E1; int states = SwitchEvent.SWITCH_STATES_DEFAULT; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: states &= ~changes; - injectSwitchEvent(changes, states); //Primary switch pressed + injectSwitchEvent(changes, states); // Primary switch pressed TeclaStatic.logD(CLASS_TAG, "Fullscreen switch down!"); - mSwitchPopup.setBackgroundDrawable(new ColorDrawable(R.color.switch_pressed)); + mSwitchPopup.setBackgroundDrawable(new ColorDrawable( + R.color.switch_pressed)); mSwitch.setBackgroundResource(R.drawable.screen_switch_background_pressed); break; case MotionEvent.ACTION_UP: - injectSwitchEvent(changes, states); //Primary switch released + injectSwitchEvent(changes, states); // Primary switch released TeclaStatic.logD(CLASS_TAG, "Fullscreen switch up!"); mSwitch.setBackgroundResource(R.drawable.screen_switch_background_normal); mSwitchPopup.setBackgroundDrawable(null); @@ -2333,10 +2469,11 @@ public boolean onTouch(View v, MotionEvent event) { } }; - private View.OnClickListener mSwitchClickListener = new View.OnClickListener() { - + private View.OnClickListener mSwitchClickListener = new View.OnClickListener() { + public void onClick(View v) { - //Doing this here again because the ACTION_UP event in the onTouch listener doesn't always work. + // Doing this here again because the ACTION_UP event in the onTouch + // listener doesn't always work. mSwitch.setBackgroundResource(R.drawable.screen_switch_background_normal); mSwitchPopup.setBackgroundDrawable(null); } @@ -2349,7 +2486,7 @@ private void stopFullScreenSwitchMode() { evaluateStartScanning(); TeclaApp.getInstance().showToast(R.string.fullscreen_disabled); } - + private boolean isFullScreenShowing() { if (mSwitchPopup != null) { if (mSwitchPopup.isShowing()) @@ -2357,7 +2494,7 @@ private boolean isFullScreenShowing() { } return false; } - + private void evaluateStartScanning() { if (TeclaApp.highlighter.isSoftIMEShowing()) { if (mShieldConnected || isFullScreenShowing()) { @@ -2366,14 +2503,16 @@ private void evaluateStartScanning() { TeclaApp.highlighter.stopSelfScanning(); } } else { - Log.w(TeclaApp.TAG, CLASS_TAG + "Could not reset scanning, InputView is not ready!"); + Log.w(TeclaApp.TAG, CLASS_TAG + + "Could not reset scanning, InputView is not ready!"); } } - + private Display getDisplay() { - return ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); + return ((WindowManager) getSystemService(WINDOW_SERVICE)) + .getDefaultDisplay(); } - + private boolean shouldShowIME() { return TeclaApp.persistence.isPersistentKeyboardEnabled(); } @@ -2384,38 +2523,40 @@ private void showIMEView() { } else { showWindow(true); updateInputViewShown(); - + // Fixes https://github.com/jorgesilva/TeclaAccess/issues/3 if (TeclaApp.highlighter.isSoftIMEShowing()) { mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NAV); } - // This call causes a looped intent call until the IME View is created + // This call causes a looped intent call until the IME View is + // created TeclaApp.getInstance().callShowSoftIMEWatchDog(350); } } - + private void hideSoftIME() { hideAltNavKeyboard(); hideWindow(); updateInputViewShown(); } - + // TODO: Consider moving to TeclaKeyboardView or TeclaKeyboard - private void populateVariants (CharSequence keyLabel, CharSequence popupChars) { + private void populateVariants(CharSequence keyLabel, CharSequence popupChars) { List keyList = mIMEView.getKeyboard().getKeys(); Key key = keyList.get(1); CharSequence sequence; - + key.label = keyLabel; key.codes = new int[1]; key.codes[0] = (int) keyLabel.charAt(0); - for (int i=0; i < popupChars.length(); i++) { - key = keyList.get(i+2); - sequence = popupChars.subSequence(i, i+1); + for (int i = 0; i < popupChars.length(); i++) { + key = keyList.get(i + 2); + sequence = popupChars.subSequence(i, i + 1); key.label = sequence; key.codes = new int[1]; key.codes[0] = (int) sequence.charAt(0); - TeclaStatic.logD(CLASS_TAG, "Populating char: " + sequence.toString()); + TeclaStatic.logD(CLASS_TAG, + "Populating char: " + sequence.toString()); } } @@ -2440,112 +2581,72 @@ private void doVariantsExit(int keyCode) { public KeyboardSwitcher getKeyboardSwitcher() { return mKeyboardSwitcher; } - -/* public void ConnectToDesktop(){ - Log.v("dictation","started connecting"); - if(TeclaApp.desktop ==null) - TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); - - - if(!TeclaApp.desktop.isConnected()&&TeclaApp.connect_to_desktop) - new Thread(desktopsearcher).start(); - } - Runnable desktopsearcher=new Runnable(){ - public void run() { - // TODO Auto-generated method stub - - Log.v("dictation","attempting connection"); - - if(TeclaApp.desktop== null) - TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); - TeclaApp.desktop.connect(); - - if(TeclaApp.desktop.isConnected()){ - Log.v("dictation","connected to Desktop"); - new Thread(wifipinger).start(); - new Thread(wifireceiver).start(); - } - } - - }; - private Runnable wifipinger=new Runnable(){ - - public void run() { - // TODO Auto-generated method stub - while(TeclaApp.desktop.isConnected()){ - TeclaApp.desktop.send("ping"); - try { - Thread.sleep(1000*2); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - wifi_ping_count++; - - Log.v("pinger",""+wifi_ping_count); - if(wifi_ping_count>5){ - TeclaApp.desktop.disconnect(); - } - } - - } - - }; - private Runnable wifireceiver=new Runnable(){ - - public void run() { - // TODO Auto-generated method stub - Log.v("connection","starting receiver"); - while(TeclaApp.desktop.isConnected()) - { - - String rec=TeclaApp.desktop.receive(); - if(rec!=null&&rec.equals("ping")){ - wifi_ping_count=0; - }else if(rec !=null && rec.equals("dictation")){ - onKey(TeclaKeyboardView.KEYCODE_DICTATION,null); - } - - } - } - - }; - - private Runnable wificonnector=new Runnable(){ + /* + * public void ConnectToDesktop(){ Log.v("dictation","started connecting"); + * if(TeclaApp.desktop ==null) TeclaApp.desktop=new + * TeclaDesktopClient(TeclaApp.getInstance()); + * + * + * if(!TeclaApp.desktop.isConnected()&&TeclaApp.connect_to_desktop) new + * Thread(desktopsearcher).start(); } Runnable desktopsearcher=new + * Runnable(){ + * + * public void run() { // TODO Auto-generated method stub + * + * Log.v("dictation","attempting connection"); + * + * if(TeclaApp.desktop== null) TeclaApp.desktop=new + * TeclaDesktopClient(TeclaApp.getInstance()); TeclaApp.desktop.connect(); + * + * if(TeclaApp.desktop.isConnected()){ + * Log.v("dictation","connected to Desktop"); new + * Thread(wifipinger).start(); new Thread(wifireceiver).start(); } } + * + * }; private Runnable wifipinger=new Runnable(){ + * + * public void run() { // TODO Auto-generated method stub + * while(TeclaApp.desktop.isConnected()){ TeclaApp.desktop.send("ping"); try + * { Thread.sleep(1000*2); } catch (InterruptedException e) { // TODO + * Auto-generated catch block e.printStackTrace(); } + * + * wifi_ping_count++; + * + * Log.v("pinger",""+wifi_ping_count); if(wifi_ping_count>5){ + * TeclaApp.desktop.disconnect(); } } + * + * } + * + * }; private Runnable wifireceiver=new Runnable(){ + * + * public void run() { // TODO Auto-generated method stub + * Log.v("connection","starting receiver"); + * while(TeclaApp.desktop.isConnected()) { + * + * String rec=TeclaApp.desktop.receive(); if(rec!=null&&rec.equals("ping")){ + * wifi_ping_count=0; }else if(rec !=null && rec.equals("dictation")){ + * onKey(TeclaKeyboardView.KEYCODE_DICTATION,null); } + * + * } } + * + * }; + * + * private Runnable wificonnector=new Runnable(){ + * + * public void run() { // TODO Auto-generated method stub + * Log.v("dictation","Started WiFiConnector"); if(TeclaApp.desktop!= null) + * TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); while( + * TeclaApp.mSendToPC){ if(TeclaApp.mSendToPC && TeclaApp.connect_to_desktop + * && !TeclaApp.desktop.isConnected()) { + * Log.v("dictation","attempting connection"); TeclaApp.desktop.connect(); + * + * if(TeclaApp.desktop.isConnected()){ + * Log.v("dictation","connected to Desktop"); new + * Thread(wifipinger).start(); new Thread(wifireceiver).start(); // TODO + * :onConnect change the send to pc button to connect state } } else{ try { + * Thread.sleep(10000); } catch (InterruptedException e) { // TODO + * Auto-generated catch block e.printStackTrace(); } } } + * Log.v("dictation",""+wifisearcherthread.isAlive()); } }; + */ - public void run() { - // TODO Auto-generated method stub - Log.v("dictation","Started WiFiConnector"); - if(TeclaApp.desktop!= null) - TeclaApp.desktop=new TeclaDesktopClient(TeclaApp.getInstance()); - while( TeclaApp.mSendToPC){ - if(TeclaApp.mSendToPC && TeclaApp.connect_to_desktop && !TeclaApp.desktop.isConnected()) - { - Log.v("dictation","attempting connection"); - TeclaApp.desktop.connect(); - - if(TeclaApp.desktop.isConnected()){ - Log.v("dictation","connected to Desktop"); - new Thread(wifipinger).start(); - new Thread(wifireceiver).start(); - // TODO :onConnect change the send to pc button to connect state - } - } - else{ - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - Log.v("dictation",""+wifisearcherthread.isAlive()); - } - }; -*/ - } - diff --git a/java/src/ca/idi/tekla/util/Persistence.java b/java/src/ca/idi/tekla/util/Persistence.java index 57f77aa..bbe7b6b 100644 --- a/java/src/ca/idi/tekla/util/Persistence.java +++ b/java/src/ca/idi/tekla/util/Persistence.java @@ -7,10 +7,10 @@ import android.content.Context; public class Persistence extends ca.idi.tecla.framework.Persistence { - + // Deprecated preferences - //public static final String PREF_SCAN_DELAY_STRING = "scan_delay"; -// public static final String PREF_VARIANTS = "variants"; + // public static final String PREF_SCAN_DELAY_STRING = "scan_delay"; + // public static final String PREF_VARIANTS = "variants"; public static final String PREF_VOICE_INPUT = "voice_input"; public static final String PREF_VARIANTS_KEY = "variants_key"; @@ -19,21 +19,27 @@ public class Persistence extends ca.idi.tecla.framework.Persistence { public static final String PREF_MORSE_KEY_MODE = "morse_key_mode"; public static final String PREF_MORSE_TIME_UNIT = "morse_time_unit"; public static final String PREF_PERSISTENT_KEYBOARD = "persistent_keyboard"; - public static final String PREF_AUTOHIDE_TIMEOUT = "autohide_timeout"; - + public static final String PREF_AUTOHIDE_TIMEOUT = "autohide_timeout"; + public static final String PREF_CONFIGURE_INPUT = "configure_input"; - + public static final String PREF_SWITCH_DEFAULT = "switch_default"; - - public static final String PREF_FULL_RESET_TIMEOUT = "full_reset_timeout"; + + public static final String PREF_FULL_RESET_TIMEOUT = "full_reset_timeout"; public static final String PREF_FULLSCREEN_SWITCH = "fullscreen_switch"; public static final String PREF_SPEAKERPHONE_SWITCH = "speakerphone_switch"; public static final String PREF_SELF_SCANNING = "self_scanning"; public static final String PREF_INVERSE_SCANNING = "inverse_scanning"; - public static final String PREF_SCAN_DELAY_INT = "scan_delay_int"; - public static final String PREF_MORSE_REPEAT_INT = "morse_repeat_int"; + public static final String PREF_SCAN_DELAY_INT = "scan_delay_int"; + + public static final String PREF_EMERGENCY_GPS_SETTING = "emergency_GPS_setting"; + public static final String PREF_EMERGENCY_PHONE_NUMBER = "emergency_phone_number"; + public static final String PREF_EMERGENCY_SMS_NUMBER = "emergency_SMS_number"; + public static final String PREF_EMERGENCY_EMAIL_ADDRESS = "emergency_email_address"; + + public static final String PREF_MORSE_REPEAT_INT = "morse_repeat_int"; public static final String DEFAULT_MORSE_KEY_MODE = "0"; - public static final int DEFAULT_MORSE_TIME_UNIT = 150; + public static final int DEFAULT_MORSE_TIME_UNIT = 150; public static final int DEFAULT_FULL_RESET_TIMEOUT = 3; public static final int MIN_FULL_RESET_TIMEOUT = 3; public static final int MAX_FULL_RESET_TIMEOUT = 40; @@ -47,16 +53,17 @@ public class Persistence extends ca.idi.tecla.framework.Persistence { public static final int FULLRESET_NULL = -999; public static final int NEVER_AUTOHIDE = -1; public static final int NEVER_REPEAT = -1; - - public static final String CONNECT_TO_PC="enable_desktop_connectivity"; - public static final String SET_PASSWORD="set_password"; - - private boolean mScreenOn, mInverseScanningChanged, mVariantsKeyOn, mVariantsShowing; + + public static final String CONNECT_TO_PC = "enable_desktop_connectivity"; + public static final String SET_PASSWORD = "set_password"; + + private boolean mScreenOn, mInverseScanningChanged, mVariantsKeyOn, + mVariantsShowing; private boolean mAltNavKeyboardOn, mRepeatLockOn, isRepeatingKey; - + public Persistence(Context context) { super(context); - + mVariantsShowing = false; mAltNavKeyboardOn = false; mVariantsKeyOn = false; @@ -68,15 +75,15 @@ public Persistence(Context context) { public boolean isScreenOn() { return mScreenOn; } - + public void setScreenOn() { mScreenOn = true; } - + public void setScreenOff() { mScreenOn = false; } - + public boolean isVoiceInputEnabled() { return shared_prefs.getBoolean(PREF_VOICE_INPUT, false); } @@ -84,11 +91,11 @@ public boolean isVoiceInputEnabled() { public boolean isVariantsKeyEnabled() { return shared_prefs.getBoolean(PREF_VARIANTS_KEY, false); } - + public boolean isRepeatingKey() { return isRepeatingKey; } - + public void setRepeatingKey(boolean repeat) { isRepeatingKey = repeat; } @@ -96,7 +103,7 @@ public void setRepeatingKey(boolean repeat) { public boolean isRepeatLockOn() { return mRepeatLockOn; } - + public void setRepeatLockOn() { mRepeatLockOn = true; } @@ -104,11 +111,11 @@ public void setRepeatLockOn() { public void setRepeatLockOff() { mRepeatLockOn = false; } - + public boolean isVariantsKeyOn() { return mVariantsKeyOn; } - + public void setVariantsKeyOn() { mVariantsKeyOn = true; } @@ -116,20 +123,20 @@ public void setVariantsKeyOn() { public void setVariantsKeyOff() { mVariantsKeyOn = false; } - - public void setVariantsShowing (boolean showing) { + + public void setVariantsShowing(boolean showing) { mVariantsShowing = showing; } - public boolean isVariantsShowing () { + public boolean isVariantsShowing() { return mVariantsShowing; } - public boolean isAltNavKeyboardOn () { + public boolean isAltNavKeyboardOn() { return mAltNavKeyboardOn; } - public void setAltNavKeyboardOn (boolean state) { + public void setAltNavKeyboardOn(boolean state) { mAltNavKeyboardOn = state; } @@ -141,8 +148,8 @@ public void setNavigationKeyboardTimeout(int timeout) { prefs_editor.putInt(PREF_AUTOHIDE_TIMEOUT, timeout); prefs_editor.commit(); } - - public void setNeverHideNavigationKeyboard () { + + public void setNeverHideNavigationKeyboard() { prefs_editor.putInt(PREF_AUTOHIDE_TIMEOUT, NEVER_AUTOHIDE); prefs_editor.commit(); } @@ -150,20 +157,21 @@ public void setNeverHideNavigationKeyboard () { public int getNavigationKeyboardTimeout() { return shared_prefs.getInt(PREF_AUTOHIDE_TIMEOUT, NEVER_AUTOHIDE); } - + public void setFullResetTimeout(int timeout) { prefs_editor.putInt(PREF_FULL_RESET_TIMEOUT, timeout); prefs_editor.commit(); } - + public int getFullResetTimeout() { - return shared_prefs.getInt(PREF_FULL_RESET_TIMEOUT,DEFAULT_FULL_RESET_TIMEOUT); + return shared_prefs.getInt(PREF_FULL_RESET_TIMEOUT, + DEFAULT_FULL_RESET_TIMEOUT); } public boolean isMorseModeEnabled() { return shared_prefs.getBoolean(PREF_MORSE_MODE, false); } - + public boolean isMorseHudEnabled() { return shared_prefs.getBoolean(PREF_MORSE_SHOW_HUD, true); } @@ -183,17 +191,17 @@ public boolean isInverseScanningEnabled() { public void setInverseScanningChanged() { mInverseScanningChanged = true; } - + public void unsetInverseScanningChanged() { mInverseScanningChanged = false; } - + public boolean isInverseScanningChanged() { return mInverseScanningChanged; } - + public boolean isScanningEnabled() { - return isSelfScanningEnabled() || isInverseScanningEnabled(); + return isSelfScanningEnabled() || isInverseScanningEnabled(); } public boolean isSpeakerphoneEnabled() { @@ -208,7 +216,7 @@ public void setScanDelay(int delay) { public int getScanDelay() { return shared_prefs.getInt(PREF_SCAN_DELAY_INT, DEFAULT_SCAN_DELAY); } - + public void setRepeatFrequency(int delay) { prefs_editor.putInt(PREF_MORSE_REPEAT_INT, delay); prefs_editor.commit(); @@ -217,20 +225,34 @@ public void setRepeatFrequency(int delay) { public int getRepeatFrequency() { return shared_prefs.getInt(PREF_MORSE_REPEAT_INT, DEFAULT_REPEAT_FREQ); } - + public int getMorseKeyMode() { - //getInt does not work with ListPreference and string type arrays, - //so use getString instead - return Integer.parseInt(shared_prefs.getString(PREF_MORSE_KEY_MODE, DEFAULT_MORSE_KEY_MODE)); + // getInt does not work with ListPreference and string type arrays, + // so use getString instead + return Integer.parseInt(shared_prefs.getString(PREF_MORSE_KEY_MODE, + DEFAULT_MORSE_KEY_MODE)); } public void setMorseTimeUnit(int speed) { prefs_editor.putInt(PREF_MORSE_TIME_UNIT, speed); prefs_editor.commit(); } - + public int getMorseTimeUnit() { - return shared_prefs.getInt(PREF_MORSE_TIME_UNIT, DEFAULT_MORSE_TIME_UNIT); + return shared_prefs.getInt(PREF_MORSE_TIME_UNIT, + DEFAULT_MORSE_TIME_UNIT); + } + + public Boolean getEmergencyGPSSetting() { + return shared_prefs.getBoolean(PREF_EMERGENCY_GPS_SETTING, false); + } + + public String getEmergencyPhoneNumber() { + return shared_prefs.getString(PREF_EMERGENCY_PHONE_NUMBER, ""); + } + + public String getEmergencySMSNumber() { + return shared_prefs.getString(PREF_EMERGENCY_SMS_NUMBER, ""); } } diff --git a/tags/TeclaAccess_versioncode26_hotfix126.apk b/tags/TeclaAccess_versioncode26_hotfix126.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode27_hotfix126.apk b/tags/TeclaAccess_versioncode27_hotfix126.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode28_20130305.apk b/tags/TeclaAccess_versioncode28_20130305.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode29_20130306.apk b/tags/TeclaAccess_versioncode29_20130306.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode32_20130410.apk b/tags/TeclaAccess_versioncode32_20130410.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode33_20130410.apk b/tags/TeclaAccess_versioncode33_20130410.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode33_20130411.apk b/tags/TeclaAccess_versioncode33_20130411.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode34_20130411.apk b/tags/TeclaAccess_versioncode34_20130411.apk old mode 100644 new mode 100755 diff --git a/tags/TeclaAccess_versioncode35_20130415.apk b/tags/TeclaAccess_versioncode35_20130415.apk old mode 100644 new mode 100755