r50 - in trunk: . res res/drawable res/values res/xml src/org/chorem/android/saymytexts src/site/fr/rst src/site/rst
Author: kmorin Date: 2014-05-14 19:52:04 +0200 (Wed, 14 May 2014) New Revision: 50 Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/50 Log: add doc + remove widget code (it has been moved to a branch) Removed: trunk/res/drawable-hdpi-v14/ trunk/res/drawable-hdpi/ trunk/res/drawable-mdpi-v14/ trunk/res/drawable-mdpi/ trunk/res/drawable-xhdpi-v14/ trunk/res/drawable/appwidget_dark_bg_clickable.xml trunk/res/layout/ trunk/res/xml/say_my_texts_widget_info.xml trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java Modified: trunk/AndroidManifest.xml trunk/res/values/strings.xml trunk/src/site/fr/rst/dev.rst trunk/src/site/fr/rst/index.rst trunk/src/site/fr/rst/user.rst trunk/src/site/rst/dev.rst trunk/src/site/rst/index.rst trunk/src/site/rst/user.rst Modified: trunk/AndroidManifest.xml =================================================================== --- trunk/AndroidManifest.xml 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/AndroidManifest.xml 2014-05-14 17:52:04 UTC (rev 50) @@ -57,13 +57,5 @@ android:finishOnTaskLaunch="true" android:configChanges="orientation|screenSize|keyboardHidden"/> - <receiver android:name=".SayMyTextsWidgetProvider" > - <intent-filter> - <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> - </intent-filter> - <meta-data android:name="android.appwidget.provider" - android:resource="@xml/say_my_texts_widget_info" /> - </receiver> - </application> </manifest> Deleted: trunk/res/drawable/appwidget_dark_bg_clickable.xml =================================================================== --- trunk/res/drawable/appwidget_dark_bg_clickable.xml 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/res/drawable/appwidget_dark_bg_clickable.xml 2014-05-14 17:52:04 UTC (rev 50) @@ -1,24 +0,0 @@ -<!-- - Copyright 2011 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. - --> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/appwidget_bg_pressed" android:state_pressed="true" /> - <item android:drawable="@drawable/appwidget_dark_bg_focused" - android:state_focused="true" - android:state_enabled="true" - android:state_window_focused="true" /> - <item android:drawable="@drawable/appwidget_dark_bg" /> -</selector> Modified: trunk/res/values/strings.xml =================================================================== --- trunk/res/values/strings.xml 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/res/values/strings.xml 2014-05-14 17:52:04 UTC (rev 50) @@ -36,7 +36,7 @@ <string name="send_sms_confirmation">You dictated: %s. Would you like to confirm, modify ou cancel?</string> <string name="call_action">call</string> - <string name="answer_action">answer</string> + <string name="answer_action">reply</string> <string name="quit_action">nothing</string> <string name="confirm_action">confirm</string> Deleted: trunk/res/xml/say_my_texts_widget_info.xml =================================================================== --- trunk/res/xml/say_my_texts_widget_info.xml 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/res/xml/say_my_texts_widget_info.xml 2014-05-14 17:52:04 UTC (rev 50) @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" - android:minWidth="40dp" - android:minHeight="40dp" - android:updatePeriodMillis="0" - android:initialLayout="@layout/say_my_texts_widget" - android:resizeMode="none"> -</appwidget-provider> \ No newline at end of file Deleted: trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java =================================================================== --- trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java 2014-05-14 17:52:04 UTC (rev 50) @@ -1,111 +0,0 @@ -package org.chorem.android.saymytexts; - -/* - * #%L - * Say My Texts - * $Id:$ - * $HeadURL:$ - * %% - * Copyright (C) 2014 Code Lutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import android.app.PendingIntent; -import android.appwidget.AppWidgetManager; -import android.appwidget.AppWidgetProvider; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; -import android.util.Log; -import android.widget.RemoteViews; - -/** - * @author Kevin Morin (Code Lutin) - * @since x.x - */ -public class SayMyTextsWidgetProvider extends AppWidgetProvider { - - private static final String TAG = "SayMyTextsWidgetProvider"; - - protected static final String CLICK_ACTION = "org.chorem.android.saymytexts.action.APPWIDGET_CLICKED"; - - @Override - public void onUpdate(final Context context, final AppWidgetManager appWidgetManager, int[] appWidgetIds) { - final int N = appWidgetIds.length; - - // Perform this loop procedure for each App Widget that belongs to this provider - for (int i = 0; i < N; i++) { - final int appWidgetId = appWidgetIds[i]; - - // Create an Intent to call this onReceive method - Intent intent = new Intent(context, getClass()); - intent.setAction(CLICK_ACTION); - PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0); - - // Get the layout for the App Widget and attach an on-click listener - // to the button - RemoteViews views = updateButtonState(context); - views.setOnClickPendingIntent(R.id.say_my_texts_widget, pendingIntent); - - //TODO - PreferenceManager.getDefaultSharedPreferences(context) - .registerOnSharedPreferenceChangeListener(new SharedPreferences.OnSharedPreferenceChangeListener() { - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { -// String enableReadingKey = context.getString(R.string.preference_enable_reading_key); -// if (key.equals(enableReadingKey)) { -// RemoteViews views = updateButtonState(context); -// appWidgetManager.updateAppWidget(appWidgetId, views); -// } - } - }); - - // Tell the AppWidgetManager to perform an update on the current app widget - appWidgetManager.updateAppWidget(appWidgetId, views); - } - } - - @Override - public void onReceive(Context context, Intent intent) { - super.onReceive(context, intent); - Log.d(TAG, "on receive " + intent.getAction()); - if (CLICK_ACTION.equals(intent.getAction())) { - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context); -// String key = context.getString(R.string.preference_enable_reading_key); -// boolean enabled = sharedPref.getBoolean(key, true); -// Log.d(TAG, "enabled " + enabled); -// sharedPref.edit().putBoolean(key, !enabled).commit(); - } - } - - protected RemoteViews updateButtonState(Context context) { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); -// String key = context.getString(R.string.preference_enable_reading_key); -// -// boolean enabled = sharedPreferences.getBoolean(key, true); -// int drawableId = enabled ? -// android.R.drawable.button_onoff_indicator_on : -// android.R.drawable.button_onoff_indicator_off; -// -// RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.say_my_texts_widget); -// views.setImageViewResource(R.id.say_my_texts_widget_onoff_icon, drawableId); - -// return views; - return null; - } -} Modified: trunk/src/site/fr/rst/dev.rst =================================================================== --- trunk/src/site/fr/rst/dev.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/fr/rst/dev.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -27,7 +27,9 @@ L'application est composée : -- d'un service qui lit les SMS à voix haute +- d'un service qui lit les SMS à voix haute et gère les commandes vocales - d'une activité de configuration - d'un *BroadcastReceiver* qui reçoit les SMS et écoute les connexions bluetooth +- d'un *BroadcastReceiver* qui reçoit les commandes vocales +- d'un *BroadcastReceiver* qui reçoit le texte dicté en réponse - d'une application pour configurer le rapporteur de plantage \ No newline at end of file Modified: trunk/src/site/fr/rst/index.rst =================================================================== --- trunk/src/site/fr/rst/index.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/fr/rst/index.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -25,6 +25,6 @@ Bienvenue sur le site de Say My Texts ##################################### -Say My Texts est une application Android qui permet de lire à haute voix les SMS que vous recevez -quand des écouteurs sont branchés ou que le téléphone est connecté à un kit mains-libres bluetooth. -Ceci est particulièrement utile en vélo, quand on court ou en voiture. \ No newline at end of file +Say My Texts est une application Android qui permet de lire à haute voix les SMS que vous recevez. +Ceci est particulièrement utile en vélo, quand on court ou en voiture. +Vous pouvez également répondre à l'expéditeur soit en l'appelant soit en dictant la réponse. \ No newline at end of file Modified: trunk/src/site/fr/rst/user.rst =================================================================== --- trunk/src/site/fr/rst/user.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/fr/rst/user.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -52,6 +52,10 @@ pour trouver le nom du contact à partir du numéro de l'envoyeur :BLUETOOTH: pour accéder aux appareils bluetooth connectés +:RECORD_AUDIO: + pour les commandes vocales et dicter la réponse +:CALL_PHONE: + pour rappeler l'expéditeur Configuration ~~~~~~~~~~~~~ @@ -59,7 +63,9 @@ Le lancement de l'application depuis le menu ouvre la configuration de l'application. Vous pouvez : -- activer ou désactiver la lecture +- activer ou désactiver la lecture en fonction du branchement ou non d'un casque ou de la connexion d'un appareil bluetooth +- activer l'intéraction à la réception d'un message +- si l'intéraction est activée, vous pouvez choisir le nombre d'essais de reconnaissance des commandes vocales (3 par défaut) - activer ou désactiver le `mode Heisendroid`_. - vous envoyer un SMS pour tester la lecture @@ -75,7 +81,20 @@ .. _mode Heisendroid: #Mode_Heisendroid -Widget -~~~~~~ +Intéractions +~~~~~~~~~~~~ -Le widget vous permet d'activer ou désactiver la lecture depuis l'écran d'accueil. \ No newline at end of file +Si l'intéraction est activée, lorsque vous recevez un SMS, l'application vous propose 3 possibilités : + +- appeler l'expéditeur (dîtes "appeler") +- répondre par SMS en dictant la réponse (dîtes "répondre") +- ne rien faire (dîtes "rien") + +Si vous choisissez de répondre par SMS, vous devrez alors dicter la réponse. L'application vous énoncera ce qu'elle a compris. +Vous pourrez alors : + +- confirmer et envoyer la réponse (dîtes "confirmer") +- redicter le SMS (dîtes "corriger") +- annuler la réponse et quitter (dîtes "annuler") + +Si l'application ne comprend pas ce que vous avez dit (ce qui arrive malheureusement), elle vous demandera de répéter. \ No newline at end of file Modified: trunk/src/site/rst/dev.rst =================================================================== --- trunk/src/site/rst/dev.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/rst/dev.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -27,7 +27,9 @@ The application is composed of: -- a service which reads the SMS out loud +- a service which reads the SMS out loud and manage the vocal commands - an activity for the settings - a *BroadcastReceiver* which receives the SMS and listens to the bluetooth connections +- a *BroadcastReceiver* which receives the vocal commands +- a *BroadcastReceiver* which receives the dictated reply - an application to setup the crash report \ No newline at end of file Modified: trunk/src/site/rst/index.rst =================================================================== --- trunk/src/site/rst/index.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/rst/index.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -25,6 +25,6 @@ Welcome to Say My Texts website ############################### -Say My Texts is an Android application which reads out loud the SMS you receive while a headset is plugged -or a bluetooth handfree is connected. -This is particulary useful when you are riding, running or driving. \ No newline at end of file +Say My Texts is an Android application which reads out loud the SMS you receive. +This is particulary useful when you are riding, running or driving. +You also can reply to the sender by calling him or by dictating the reply. \ No newline at end of file Modified: trunk/src/site/rst/user.rst =================================================================== --- trunk/src/site/rst/user.rst 2014-05-08 20:47:27 UTC (rev 49) +++ trunk/src/site/rst/user.rst 2014-05-14 17:52:04 UTC (rev 50) @@ -47,6 +47,10 @@ :MODIFY_AUDIO_SETTINGS: the voice synthetizer needs it :READ_CONTACTS: to match the phone number of the sender with the contact name :BLUETOOTH: to get the connected devices +:RECORD_AUDIO: + pour les commandes vocales et dicter la réponse +:CALL_PHONE: + pour rappeler l'expéditeur Settings @@ -55,7 +59,9 @@ When you launch the application from the menu, the settings open. You can: -- enable or disable the reading +- enable or disable the reading depending if a headset is plugged or not or if a bluetooth device is connected +- enable or disable the interaction with the received messages +- if the interaction is enabled, you can configure the maximum number of tries to understand the vocal commands (3 by default) - enable or disable the `Heisendroid mode`_. - send a SMS to yourself to test the reading @@ -71,8 +77,20 @@ .. _Heisendroid mode: #Heisendroid_mode +Interactions +~~~~~~~~~~~~ -Widget -~~~~~~ +If the interaction is on, when you receive an SMS, the app offers you 3 choices: -The widget permits you to enable or disable the reading from the home screen. \ No newline at end of file +- call the sender (say "call") +- reply by SMS by dictating the message (say "repy") +- do nothing (say "nothing") + +If you choose to reply by SMS, you can then dictate the message. The application will tell what it understands. +You can then: + +- confirm and send the reply (say "confirm") +- dictate the text again (say "modify") +- cancel the reply and quit (say "cancel") + +If the app does not understand what you said (it happens), you will be asked to repeat. \ No newline at end of file
participants (1)
-
kmorin@users.chorem.org