Say-my-texts-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
March 2014
- 3 participants
- 42 discussions
r13 - in trunk: . res res/drawable res/drawable-hdpi res/drawable-hdpi-v14 res/drawable-mdpi res/drawable-mdpi-v14 res/drawable-xhdpi-v14 res/layout
by kmorin@users.chorem.org 29 Mar '14
by kmorin@users.chorem.org 29 Mar '14
29 Mar '14
Author: kmorin
Date: 2014-03-29 15:05:10 +0100 (Sat, 29 Mar 2014)
New Revision: 13
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/13
Log:
add forgotten files
Added:
trunk/res/drawable-hdpi-v14/
trunk/res/drawable-hdpi-v14/appwidget_bg_pressed.9.png
trunk/res/drawable-hdpi-v14/appwidget_dark_bg.9.png
trunk/res/drawable-hdpi-v14/appwidget_dark_bg_focused.9.png
trunk/res/drawable-hdpi/
trunk/res/drawable-hdpi/appwidget_bg_pressed.9.png
trunk/res/drawable-hdpi/appwidget_dark_bg.9.png
trunk/res/drawable-hdpi/appwidget_dark_bg_focused.9.png
trunk/res/drawable-mdpi-v14/
trunk/res/drawable-mdpi-v14/appwidget_bg_pressed.9.png
trunk/res/drawable-mdpi-v14/appwidget_dark_bg.9.png
trunk/res/drawable-mdpi-v14/appwidget_dark_bg_focused.9.png
trunk/res/drawable-mdpi/
trunk/res/drawable-mdpi/appwidget_bg_pressed.9.png
trunk/res/drawable-mdpi/appwidget_dark_bg.9.png
trunk/res/drawable-mdpi/appwidget_dark_bg_focused.9.png
trunk/res/drawable-xhdpi-v14/
trunk/res/drawable-xhdpi-v14/appwidget_bg_pressed.9.png
trunk/res/drawable-xhdpi-v14/appwidget_dark_bg.9.png
trunk/res/drawable-xhdpi-v14/appwidget_dark_bg_focused.9.png
trunk/res/drawable/appwidget_dark_bg_clickable.xml
Modified:
trunk/pom.xml
trunk/res/layout/say_my_texts_widget.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-29 14:04:11 UTC (rev 12)
+++ trunk/pom.xml 2014-03-29 14:05:10 UTC (rev 13)
@@ -33,7 +33,7 @@
<groupId>org.chorem.android</groupId>
<artifactId>saymytexts</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
<name>Say My Texts</name>
<description>
Added: trunk/res/drawable/appwidget_dark_bg_clickable.xml
===================================================================
--- trunk/res/drawable/appwidget_dark_bg_clickable.xml (rev 0)
+++ trunk/res/drawable/appwidget_dark_bg_clickable.xml 2014-03-29 14:05:10 UTC (rev 13)
@@ -0,0 +1,24 @@
+<!--
+ 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>
Added: trunk/res/drawable-hdpi/appwidget_bg_pressed.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi/appwidget_bg_pressed.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-hdpi/appwidget_dark_bg.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi/appwidget_dark_bg.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-hdpi/appwidget_dark_bg_focused.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi/appwidget_dark_bg_focused.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-hdpi-v14/appwidget_bg_pressed.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi-v14/appwidget_bg_pressed.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-hdpi-v14/appwidget_dark_bg.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi-v14/appwidget_dark_bg.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-hdpi-v14/appwidget_dark_bg_focused.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-hdpi-v14/appwidget_dark_bg_focused.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi/appwidget_bg_pressed.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi/appwidget_bg_pressed.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi/appwidget_dark_bg.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi/appwidget_dark_bg.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi/appwidget_dark_bg_focused.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi/appwidget_dark_bg_focused.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi-v14/appwidget_bg_pressed.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi-v14/appwidget_bg_pressed.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi-v14/appwidget_dark_bg.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi-v14/appwidget_dark_bg.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-mdpi-v14/appwidget_dark_bg_focused.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-mdpi-v14/appwidget_dark_bg_focused.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-xhdpi-v14/appwidget_bg_pressed.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-xhdpi-v14/appwidget_bg_pressed.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-xhdpi-v14/appwidget_dark_bg.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-xhdpi-v14/appwidget_dark_bg.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable-xhdpi-v14/appwidget_dark_bg_focused.9.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable-xhdpi-v14/appwidget_dark_bg_focused.9.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/res/layout/say_my_texts_widget.xml
===================================================================
--- trunk/res/layout/say_my_texts_widget.xml 2014-03-29 14:04:11 UTC (rev 12)
+++ trunk/res/layout/say_my_texts_widget.xml 2014-03-29 14:05:10 UTC (rev 13)
@@ -6,7 +6,8 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
- android:background="@drawable/widget_preview_dark">
+ android:padding="2dp"
+ android:background="@drawable/appwidget_dark_bg_clickable">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -16,6 +17,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
- android:src="@android:drawable/button_onoff_indicator_on"/>
+ android:layout_marginBottom="2dp"/>
</LinearLayout>
\ No newline at end of file
1
0
Author: kmorin
Date: 2014-03-29 15:04:11 +0100 (Sat, 29 Mar 2014)
New Revision: 12
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/12
Log:
remove wrong tag
Removed:
tags/say-my-texts-1.0/
1
0
Author: kmorin
Date: 2014-03-29 14:53:12 +0100 (Sat, 29 Mar 2014)
New Revision: 11
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/11
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-29 13:53:08 UTC (rev 10)
+++ trunk/pom.xml 2014-03-29 13:53:12 UTC (rev 11)
@@ -33,7 +33,7 @@
<groupId>org.chorem.android</groupId>
<artifactId>saymytexts</artifactId>
- <version>1.0</version>
+ <version>1.1-SNAPSHOT</version>
<name>Say My Texts</name>
<description>
@@ -65,12 +65,12 @@
</developers>
<scm>
- <url>https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0</url>
+ <url>https://svn.chorem.org/say-my-texts</url>
<connection>
- scm:svn:https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0
+ scm:svn:https://svn.chorem.org/say-my-texts/trunk
</connection>
<developerConnection>
- scm:svn:https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0
+ scm:svn:https://svn.chorem.org/say-my-texts/trunk
</developerConnection>
</scm>
<distributionManagement>
1
0
Author: kmorin
Date: 2014-03-29 14:53:08 +0100 (Sat, 29 Mar 2014)
New Revision: 10
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/10
Log:
[maven-release-plugin] copy for tag say-my-texts-1.0
Added:
tags/say-my-texts-1.0/
1
0
Author: kmorin
Date: 2014-03-29 14:53:04 +0100 (Sat, 29 Mar 2014)
New Revision: 9
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/9
Log:
[maven-release-plugin] prepare release say-my-texts-1.0
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-29 13:49:12 UTC (rev 8)
+++ trunk/pom.xml 2014-03-29 13:53:04 UTC (rev 9)
@@ -33,7 +33,7 @@
<groupId>org.chorem.android</groupId>
<artifactId>saymytexts</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0</version>
<name>Say My Texts</name>
<description>
@@ -65,12 +65,12 @@
</developers>
<scm>
- <url>https://svn.chorem.org/say-my-texts</url>
+ <url>https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0</url>
<connection>
- scm:svn:https://svn.chorem.org/say-my-texts/trunk
+ scm:svn:https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0
</connection>
<developerConnection>
- scm:svn:https://svn.chorem.org/say-my-texts/trunk
+ scm:svn:https://svn.chorem.org/say-my-texts/tags/say-my-texts-1.0
</developerConnection>
</scm>
<distributionManagement>
1
0
r8 - in trunk: res/layout src/org/chorem/android/saymytexts src/site/fr/rst src/site/rst
by kmorin@users.chorem.org 29 Mar '14
by kmorin@users.chorem.org 29 Mar '14
29 Mar '14
Author: kmorin
Date: 2014-03-29 14:49:12 +0100 (Sat, 29 Mar 2014)
New Revision: 8
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/8
Log:
fixes #1000 Widget to activate or deactivate the reading feature
Modified:
trunk/res/layout/say_my_texts_widget.xml
trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java
trunk/src/site/fr/rst/user.rst
trunk/src/site/rst/user.rst
Modified: trunk/res/layout/say_my_texts_widget.xml
===================================================================
--- trunk/res/layout/say_my_texts_widget.xml 2014-03-29 11:26:48 UTC (rev 7)
+++ trunk/res/layout/say_my_texts_widget.xml 2014-03-29 13:49:12 UTC (rev 8)
@@ -1,8 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/say_my_texts_widget_id"
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/say_my_texts_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/logo_small">
+ android:orientation="vertical"
+ android:gravity="center"
+ android:background="@drawable/widget_preview_dark">
-</ImageButton>
\ No newline at end of file
+ <ImageView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/logo_small"/>
+
+ <ImageView android:id="@+id/say_my_texts_widget_onoff_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="2dp"
+ android:src="@android:drawable/button_onoff_indicator_on"/>
+
+</LinearLayout>
\ No newline at end of file
Modified: trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java 2014-03-29 11:26:48 UTC (rev 7)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java 2014-03-29 13:49:12 UTC (rev 8)
@@ -20,12 +20,13 @@
protected static final String CLICK_ACTION = "org.chorem.android.saymytexts.action.APPWIDGET_CLICKED";
- public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+ @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++) {
- int appWidgetId = appWidgetIds[i];
+ 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());
@@ -34,9 +35,21 @@
// Get the layout for the App Widget and attach an on-click listener
// to the button
- RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.say_my_texts_widget);
- views.setOnClickPendingIntent(R.id.say_my_texts_widget_id, pendingIntent);
+ RemoteViews views = updateButtonState(context);
+ views.setOnClickPendingIntent(R.id.say_my_texts_widget, pendingIntent);
+ 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);
}
@@ -54,4 +67,19 @@
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;
+ }
}
Modified: trunk/src/site/fr/rst/user.rst
===================================================================
--- trunk/src/site/fr/rst/user.rst 2014-03-29 11:26:48 UTC (rev 7)
+++ trunk/src/site/fr/rst/user.rst 2014-03-29 13:49:12 UTC (rev 8)
@@ -72,4 +72,9 @@
Lorsque vous activez le mode Heisendroid, la lecture des SMS est précédée par "*Say my text*"
et suivie de "*You're goddamn right!*". Il s'agit là aussi d'une référence à une des répliques cultes de la série.
-.. _mode Heisendroid: #Mode_Heisendroid
\ No newline at end of file
+.. _mode Heisendroid: #Mode_Heisendroid
+
+Widget
+~~~~~~
+
+Le widget vous permet d'activer ou désactiver la lecture depuis l'écran d'accueil.
\ No newline at end of file
Modified: trunk/src/site/rst/user.rst
===================================================================
--- trunk/src/site/rst/user.rst 2014-03-29 11:26:48 UTC (rev 7)
+++ trunk/src/site/rst/user.rst 2014-03-29 13:49:12 UTC (rev 8)
@@ -68,4 +68,10 @@
When you enable the Heisendroid mode, the SMS reading is preceded by "*Say my text*"
and followed by "*You're goddamn right!*". It is also a reference to one of the cult line of the series.
-.. _Heisendroid mode: #Heisendroid_mode
\ No newline at end of file
+.. _Heisendroid mode: #Heisendroid_mode
+
+
+Widget
+~~~~~~
+
+The widget permits you to enable or disable the reading from the home screen.
\ No newline at end of file
1
0
Author: kmorin
Date: 2014-03-29 12:26:48 +0100 (Sat, 29 Mar 2014)
New Revision: 7
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/7
Log:
test
Modified:
trunk/res/layout/say_my_texts_widget.xml
Modified: trunk/res/layout/say_my_texts_widget.xml
===================================================================
--- trunk/res/layout/say_my_texts_widget.xml 2014-03-29 11:23:32 UTC (rev 6)
+++ trunk/res/layout/say_my_texts_widget.xml 2014-03-29 11:26:48 UTC (rev 7)
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/say_my_texts_widget_id"
android:layout_width="wrap_content"
1
0
r6 - in trunk: . res res/layout res/xml src/org/chorem/android/saymytexts src/site src/site/fr/rst src/site/rst
by kmorin@users.chorem.org 29 Mar '14
by kmorin@users.chorem.org 29 Mar '14
29 Mar '14
Author: kmorin
Date: 2014-03-29 12:23:32 +0100 (Sat, 29 Mar 2014)
New Revision: 6
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/6
Log:
test
Added:
trunk/res/layout/
trunk/res/layout/say_my_texts_widget.xml
trunk/res/xml/say_my_texts_widget_info.xml
trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java
Removed:
trunk/project.properties
Modified:
trunk/AndroidManifest.xml
trunk/src/org/chorem/android/saymytexts/SettingsActivity.java
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
trunk/src/site/site_en.xml
trunk/src/site/site_fr.xml
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/AndroidManifest.xml 2014-03-29 11:23:32 UTC (rev 6)
@@ -53,5 +53,13 @@
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true" />
+ <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/project.properties
===================================================================
--- trunk/project.properties 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/project.properties 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-16
Added: trunk/res/layout/say_my_texts_widget.xml
===================================================================
--- trunk/res/layout/say_my_texts_widget.xml (rev 0)
+++ trunk/res/layout/say_my_texts_widget.xml 2014-03-29 11:23:32 UTC (rev 6)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/say_my_texts_widget_id"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/logo_small">
+
+</ImageButton>
\ No newline at end of file
Added: trunk/res/xml/say_my_texts_widget_info.xml
===================================================================
--- trunk/res/xml/say_my_texts_widget_info.xml (rev 0)
+++ trunk/res/xml/say_my_texts_widget_info.xml 2014-03-29 11:23:32 UTC (rev 6)
@@ -0,0 +1,9 @@
+<?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
Added: trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java (rev 0)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextsWidgetProvider.java 2014-03-29 11:23:32 UTC (rev 6)
@@ -0,0 +1,57 @@
+package org.chorem.android.saymytexts;
+
+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";
+
+ public void onUpdate(Context context, 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++) {
+ 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 = new RemoteViews(context.getPackageName(), R.layout.say_my_texts_widget);
+ views.setOnClickPendingIntent(R.id.say_my_texts_widget_id, pendingIntent);
+
+ // 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();
+ }
+ }
+}
Modified: trunk/src/org/chorem/android/saymytexts/SettingsActivity.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SettingsActivity.java 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/org/chorem/android/saymytexts/SettingsActivity.java 2014-03-29 11:23:32 UTC (rev 6)
@@ -28,12 +28,15 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.database.Cursor;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.preference.SwitchPreference;
import android.speech.tts.TextToSpeech;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
@@ -61,7 +64,6 @@
.replace(android.R.id.content, new SettingsFragment())
.commit();
-
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, CHECK_TTS_REQUEST_CODE);
@@ -100,6 +102,23 @@
});
}
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
+
+ String key = getString(R.string.preference_enable_reading_key);
+ SwitchPreference enableReadingPref = (SwitchPreference) getPreferenceScreen().findPreference(key);
+ boolean enabled = sharedPref.getBoolean(key, enableReadingPref.isChecked());
+ enableReadingPref.setChecked(enabled);
+
+ key = getString(R.string.preference_enable_heisendroid_mode_key);
+ enableReadingPref = (SwitchPreference) getPreferenceScreen().findPreference(key);
+ enabled = sharedPref.getBoolean(key, enableReadingPref.isChecked());
+ enableReadingPref.setChecked(enabled);
+ }
+
protected void sendSMS() {
Context context = getActivity();
Modified: trunk/src/site/fr/rst/dev.rst
===================================================================
--- trunk/src/site/fr/rst/dev.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/fr/rst/dev.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
Documentation développeur
#########################
Modified: trunk/src/site/fr/rst/index.rst
===================================================================
--- trunk/src/site/fr/rst/index.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/fr/rst/index.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
Bienvenue sur le site de Say My Texts
#####################################
Modified: trunk/src/site/fr/rst/user.rst
===================================================================
--- trunk/src/site/fr/rst/user.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/fr/rst/user.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
Documentation utilisateur
#########################
Modified: trunk/src/site/rst/dev.rst
===================================================================
--- trunk/src/site/rst/dev.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/rst/dev.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
Developer documentation
#######################
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/rst/index.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
Welcome to Say My Texts website
###############################
Modified: trunk/src/site/rst/user.rst
===================================================================
--- trunk/src/site/rst/user.rst 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/rst/user.rst 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,3 +1,26 @@
+.. -
+.. * #%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%
+.. -
User documentation
##################
Modified: trunk/src/site/site_en.xml
===================================================================
--- trunk/src/site/site_en.xml 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/site_en.xml 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,27 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Pollen
- $Id: site_en.xml 3671 2012-09-04 14:06:07Z tchemit $
- $HeadURL: http://forge.chorem.org/svn-private/pollen/trunk/src/site/site_en.xml $
+ Say My Texts
+ $Id:$
+ $HeadURL:$
%%
- Copyright (C) 2009 - 2012 CodeLutin
+ Copyright (C) 2014 Code Lutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+ 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 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%
-->
+
<project name="${project.name}">
<bannerLeft>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2014-03-28 21:42:08 UTC (rev 5)
+++ trunk/src/site/site_fr.xml 2014-03-29 11:23:32 UTC (rev 6)
@@ -1,27 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Pollen
- $Id: site_fr.xml 3671 2012-09-04 14:06:07Z tchemit $
- $HeadURL: http://forge.chorem.org/svn-private/pollen/trunk/src/site/site_fr.xml $
+ Say My Texts
+ $Id:$
+ $HeadURL:$
%%
- Copyright (C) 2009 - 2012 CodeLutin
+ Copyright (C) 2014 Code Lutin
%%
This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+ 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 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%
-->
+
<project name="${project.name}">
<bannerLeft>
1
0
r5 - in trunk: . res/drawable res/values res/values-fr src src/license src/org/chorem/android/saymytexts src/site src/site/fr src/site/fr/resources src/site/fr/resources/images src/site/fr/resources/images/logos src/site/fr/rst src/site/resources src/site/resources/images src/site/resources/images/logos src/site/rst
by kmorin@users.chorem.org 28 Mar '14
by kmorin@users.chorem.org 28 Mar '14
28 Mar '14
Author: kmorin
Date: 2014-03-28 22:42:08 +0100 (Fri, 28 Mar 2014)
New Revision: 5
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/5
Log:
add doc
Added:
trunk/res/drawable/logo_small.png
trunk/src/license/
trunk/src/license/THIRD-PARTY.properties
trunk/src/site/
trunk/src/site/fr/
trunk/src/site/fr/resources/
trunk/src/site/fr/resources/images/
trunk/src/site/fr/resources/images/logos/
trunk/src/site/fr/resources/images/logos/smt_logo_title.png
trunk/src/site/fr/rst/
trunk/src/site/fr/rst/dev.rst
trunk/src/site/fr/rst/index.rst
trunk/src/site/fr/rst/user.rst
trunk/src/site/resources/
trunk/src/site/resources/images/
trunk/src/site/resources/images/logos/
trunk/src/site/resources/images/logos/smt_logo_title.png
trunk/src/site/rst/
trunk/src/site/rst/dev.rst
trunk/src/site/rst/index.rst
trunk/src/site/rst/user.rst
trunk/src/site/site_en.xml
trunk/src/site/site_fr.xml
Modified:
trunk/AndroidManifest.xml
trunk/pom.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java
trunk/src/org/chorem/android/saymytexts/SayMyTextService.java
trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java
trunk/src/org/chorem/android/saymytexts/SettingsActivity.java
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/AndroidManifest.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -6,10 +6,10 @@
android:description="@string/app_description"
android:installLocation="auto">
- <uses-sdk android:minSdkVersion="16"/>
+ <uses-sdk android:minSdkVersion="15"
+ android:targetSdkVersion="17"/>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
- <uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/pom.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -94,7 +94,7 @@
<projectId>say-my-texts</projectId>
<maven.test.skip>true</maven.test.skip>
<!-- locales for the site generation, by default only french -->
- <locales>en</locales>
+ <locales>en,fr</locales>
<!-- do not relatize links in generated site -->
<relativizeDecorationLinks>false</relativizeDecorationLinks>
@@ -127,21 +127,6 @@
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
-
- <dependency>
<groupId>ch.acra</groupId>
<artifactId>acra</artifactId>
<version>4.5.0</version>
@@ -175,11 +160,9 @@
</executions>
<configuration>
<sdk>
- <!--<path>${env.ANDROID_HOME}</path>-->
<platform>16</platform>
</sdk>
<extractDuplicates>true</extractDuplicates>
- <!--<device>emulator</device>-->
<device>usb</device>
<zipalign>
<verbose>true</verbose>
@@ -196,26 +179,16 @@
</plugin>
<!-- plugin site -->
- <!--<plugin>-->
- <!--<artifactId>maven-site-plugin</artifactId>-->
- <!--<dependencies>-->
- <!--<dependency>-->
- <!--<groupId>org.nuiton.jrst</groupId>-->
- <!--<artifactId>doxia-module-jrst</artifactId>-->
- <!--<version>${jrstPluginVersion}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>hsqldb</groupId>-->
- <!--<artifactId>hsqldb</artifactId>-->
- <!--<version>${jdbc.hsqldb.version}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>org.hibernate</groupId>-->
- <!--<artifactId>hibernate-core</artifactId>-->
- <!--<version>${hibernateVersion}</version>-->
- <!--</dependency>-->
- <!--</dependencies>-->
- <!--</plugin>-->
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jrst</groupId>
+ <artifactId>doxia-module-jrst</artifactId>
+ <version>${jrstPluginVersion}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
@@ -370,23 +343,6 @@
</reportSets>
</plugin>
- <!--<plugin>-->
- <!--<groupId>org.nuiton</groupId>-->
- <!--<artifactId>nuiton-maven-report-plugin</artifactId>-->
- <!--<version>3.0-alpha-1</version>-->
- <!--<inherited>false</inherited>-->
- <!--<reportSets>-->
- <!--<reportSet>-->
- <!--<reports>-->
- <!--<report>aggregate-config-report</report>-->
- <!--</reports>-->
- <!--</reportSet>-->
- <!--</reportSets>-->
- <!--<configuration>-->
- <!--<i18nBundleName>tutti-i18n</i18nBundleName>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</reporting>
@@ -435,38 +391,6 @@
</build>
</profile>
- <profile>
- <id>analyze-dependencies</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <defaultGoal>verify</defaultGoal>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>analyze</id>
- <goals>
- <goal>analyze-only</goal>
- </goals>
- <configuration>
- <usedDependencies>
- <usedDependency>android.support:compatibility-v7-appcompat</usedDependency>
- </usedDependencies>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
</profiles>
</project>
Added: trunk/res/drawable/logo_small.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/logo_small.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/res/values/strings.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -3,7 +3,7 @@
<string name="app_name">Say My Texts</string>
<string name="app_description">Android application which reads out loud the new SMS when the headset is plugged.</string>
- <string name="sms_received">Message received from %1$s: %2$s</string>
+ <string name="sms_received">New message from %1$s: %2$s</string>
<!-- Preferences -->
<string name="preference_enable_reading_label">SMS reading</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/res/values-fr/strings.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -3,7 +3,7 @@
<string name="app_name">Say My Texts</string>
<string name="app_description">Application Android qui lit à voix haute the SMS reçus quand un casque est branché.</string>
- <string name="sms_received">Message reçu de %1$s : %2$s</string>
+ <string name="sms_received">Nouveau message de %1$s : %2$s</string>
<!-- Preferences -->
<string name="preference_enable_reading_label">Lecture des SMS</string>
@@ -13,7 +13,7 @@
<!--ACRA-->
<string name="crash_toast_text">Erreur innatendue, préparation du rapport de bug</string>
- <string name="crash_dialog_title">say My Texts a planté</string>
+ <string name="crash_dialog_title">Say My Texts a planté</string>
<string name="crash_dialog_text">Une erreur inattendue s\'est produite et a forcé l\'application à s\'arrêter.
Si vous voulez nous aider à corriger ce bug, merci de nous envoyer les données par mail en appuyant sur OK.</string>
<string name="crash_dialog_comment_prompt">Vous pouvez ajouter un commentaire ci-dessous:</string>
Added: trunk/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/src/license/THIRD-PARTY.properties (rev 0)
+++ trunk/src/license/THIRD-PARTY.properties 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,22 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - Apache 2.0
+# - Apache Software License, version 1.1
+# - BSD License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Public License Version 1.0
+# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
+# - New BSD License
+# - Public Domain
+# - The Apache Software License, Version 2.0
+# - provided without support or warranty
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Mon Mar 24 22:12:18 CET 2014
+xerces--xmlParserAPIs--2.6.2=The Apache Software License, Version 2.0
Modified: trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java 2014-03-28 21:42:08 UTC (rev 5)
@@ -1,5 +1,29 @@
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.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
@@ -7,6 +31,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
+import android.util.Log;
/**
* Receives the SMSs and if the headset is plugged, start the service to say it out loud.
@@ -16,10 +41,12 @@
*/
public class NewTextBroadcastReceiver extends BroadcastReceiver {
+ private static final String TAG = "NewTextBroadcastReceiver";
+
@Override
public void onReceive(Context context, Intent intent) {
Intent serviceIntent = new Intent(context, SayMyTextService.class);
-
+Log.d(TAG, "received");
String action = intent.getAction();
if ("android.provider.Telephony.SMS_RECEIVED".equals(action)) {
@@ -40,6 +67,7 @@
// Get the Sender Phone Number
String senderPhoneNumber = msgs[0].getDisplayOriginatingAddress();
+ Log.d(TAG,messageReceived);
// start the service to say it out loud
serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_BODY, messageReceived);
serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_SENDER, senderPhoneNumber);
Modified: trunk/src/org/chorem/android/saymytexts/SayMyTextService.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextService.java 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextService.java 2014-03-28 21:42:08 UTC (rev 5)
@@ -1,5 +1,29 @@
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.Service;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
@@ -185,9 +209,7 @@
protected void setCanSpeak(Boolean canSpeak) {
this.canSpeak = canSpeak;
if (canSpeak != null && canSpeak) {
- for (String text : awaitingTexts) {
- requestReading(text);
- }
+ requestReading(awaitingTexts);
awaitingTexts.clear();
}
}
Modified: trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java 2014-03-28 21:42:08 UTC (rev 5)
@@ -1,5 +1,29 @@
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.Application;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
Modified: trunk/src/org/chorem/android/saymytexts/SettingsActivity.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SettingsActivity.java 2014-03-24 21:11:15 UTC (rev 4)
+++ trunk/src/org/chorem/android/saymytexts/SettingsActivity.java 2014-03-28 21:42:08 UTC (rev 5)
@@ -1,5 +1,29 @@
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.Activity;
import android.app.PendingIntent;
import android.content.Context;
@@ -10,9 +34,13 @@
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
+import android.speech.tts.TextToSpeech;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
+import android.util.Log;
+import java.util.Locale;
+
/**
* Activity to set settings
*
@@ -23,6 +51,8 @@
private static final String TAG = "SettingsActivity";
+ protected static final int CHECK_TTS_REQUEST_CODE = 42;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -31,22 +61,23 @@
.replace(android.R.id.content, new SettingsFragment())
.commit();
+
+ Intent checkIntent = new Intent();
+ checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
+ startActivityForResult(checkIntent, CHECK_TTS_REQUEST_CODE);
}
- // Used only for tests - TODO kmorin 20140321 remove when sure we do not need it
- protected void readFirstText() {
- AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
- if (am.isWiredHeadsetOn()) {
- Uri uri = Uri.parse("content://sms/inbox");
- Cursor c = getContentResolver().query(uri, null, null ,null,null);
- // Read the sms data and store it in the list
- if(c.moveToFirst()) {
- Intent serviceIntent = new Intent(this, SayMyTextService.class);
- serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_BODY, c.getString(c.getColumnIndexOrThrow("body")).toString());
- serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_SENDER, c.getString(c.getColumnIndexOrThrow("address")).toString());
- startService(serviceIntent);
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == CHECK_TTS_REQUEST_CODE) {
+
+ if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL) {
+ Intent installIntent = new Intent(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
+ startActivity(installIntent);
}
- c.close();
+
+ } else {
+ super.onActivityResult(requestCode, resultCode, data);
}
}
Added: trunk/src/site/fr/resources/images/logos/smt_logo_title.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/fr/resources/images/logos/smt_logo_title.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/fr/rst/dev.rst
===================================================================
--- trunk/src/site/fr/rst/dev.rst (rev 0)
+++ trunk/src/site/fr/rst/dev.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,9 @@
+Documentation développeur
+#########################
+
+L'application est composée :
+
+- d'un service qui lit les SMS à voix haute
+- d'une activité de configuration
+- d'un *BroadcastReceiver* qui reçoit les SMS et écoute les connexions bluetooth
+- d'une application pour configurer le rapporteur de plantage
\ No newline at end of file
Added: trunk/src/site/fr/rst/index.rst
===================================================================
--- trunk/src/site/fr/rst/index.rst (rev 0)
+++ trunk/src/site/fr/rst/index.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,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
Added: trunk/src/site/fr/rst/user.rst
===================================================================
--- trunk/src/site/fr/rst/user.rst (rev 0)
+++ trunk/src/site/fr/rst/user.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,52 @@
+Documentation utilisateur
+#########################
+
+Installation
+~~~~~~~~~~~~
+
+Pour pouvoir installer l'application, vous devez posséder un appareil sous Android Ice Cream Sandwich 4.0.3 au minimum.
+
+L'application a besoin d'un synthétiseur de voix. Si aucun n'est installé, il vous sera proposé d'en installer un.
+
+Lorsque vous avez installé l'application, il faut l'ouvrir une première fois pour l'activer.
+Elle s'activera ensuite automatiquement à chaque démarrage de l'appareil.
+
+Permissions
+-----------
+
+L'application a besoin des permissions suivantes :
+
+:RECEIVE_SMS:
+ pour recevoir les SMS
+:SEND_SMS:
+ l'utilisateur peut s'envoyer des SMS pour tester
+:READ_PHONE_STATE:
+ pour vérifier qu'un appel n'est pas en cours
+:MODIFY_AUDIO_SETTINGS:
+ le synthétiseur d voix en a besoin
+:READ_CONTACTS:
+ pour trouver le nom du contact à partir du numéro de l'envoyeur
+:BLUETOOTH:
+ pour accéder aux appareils bluetooth connectés
+
+Configuration
+~~~~~~~~~~~~~
+
+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 le `mode Heisendroid`_.
+- vous envoyer un SMS pour tester la lecture
+
+Mode Heisendroid
+----------------
+
+Le nom de *Say My Texts* est une référence à la série américaine *Breaking Bad*.
+Le nom du personnage dans le logo s'appelle *Heisendroid*,
+en référence au pseudo de Walter White dans la série (Heisenberg).
+
+Lorsque vous activez le mode Heisendroid, la lecture des SMS est précédée par "*Say my text*"
+et suivie de "*You're goddamn right!*". Il s'agit là aussi d'une référence à une des répliques cultes de la série.
+
+.. _mode Heisendroid: #Mode_Heisendroid
\ No newline at end of file
Added: trunk/src/site/resources/images/logos/smt_logo_title.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/logos/smt_logo_title.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/rst/dev.rst
===================================================================
--- trunk/src/site/rst/dev.rst (rev 0)
+++ trunk/src/site/rst/dev.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,9 @@
+Developer documentation
+#######################
+
+The application is composed of:
+
+- a service which reads the SMS out loud
+- an activity for the settings
+- a *BroadcastReceiver* which receives the SMS and listens to the bluetooth connections
+- an application to setup the crash report
\ No newline at end of file
Added: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst (rev 0)
+++ trunk/src/site/rst/index.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,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
Added: trunk/src/site/rst/user.rst
===================================================================
--- trunk/src/site/rst/user.rst (rev 0)
+++ trunk/src/site/rst/user.rst 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,48 @@
+User documentation
+##################
+
+Installation
+~~~~~~~~~~~~
+
+To install the application, you need a device with at least Android Ice Cream Sandwich 4.0.3.
+
+The application needs a voice synthetizer. If none is installed, you will be able to install one from the application.
+
+Once the application is installed, you need to launch it once to activate it.
+It will be automatically activated the next times you start the device.
+
+
+Permissions
+-----------
+
+The application needs the following permissions:
+
+:RECEIVE_SMS: to receive the SMS
+:SEND_SMS: the user can send SMS to himself to test
+:READ_PHONE_STATE: to check that the user is not in a call
+: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
+
+
+Settings
+~~~~~~~~
+
+When you launch the application from the menu, the settings open.
+You can:
+
+- enable or disable the reading
+- enable or disable the `Heisendroid mode`_.
+- send a SMS to yourself to test the reading
+
+Heisendroid mode
+----------------
+
+The name *Say My Texts* is a reference to the American TV show *Breaking Bad*.
+The logo character's name is *Heisendroid*,
+in reference to Walter White's pseudonym in the series (Heisenberg).
+
+When you enable the Heisendroid mode, the SMS reading is preceded by "*Say my text*"
+and followed by "*You're goddamn right!*". It is also a reference to one of the cult line of the series.
+
+.. _Heisendroid mode: #Heisendroid_mode
\ No newline at end of file
Added: trunk/src/site/site_en.xml
===================================================================
--- trunk/src/site/site_en.xml (rev 0)
+++ trunk/src/site/site_en.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Pollen
+ $Id: site_en.xml 3671 2012-09-04 14:06:07Z tchemit $
+ $HeadURL: http://forge.chorem.org/svn-private/pollen/trunk/src/site/site_en.xml $
+ %%
+ Copyright (C) 2009 - 2012 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="SayMyTexts">/images/logos/smt_logo_title.png</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.3.0</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>false</topBarEnabled>
+ <sideBarEnabled>true</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <publishDate position="right" format="MM/dd/yyyy"/>
+ <version position="right"/>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven"
+ img="http://maven-site.nuiton.org/public/images/logos/maven-feather.png"/>
+
+ <logo href="http://docutils.sourceforge.net/rst.html"
+ name="ReStructuredText"
+ img="http://maven-site.nuiton.org/public/images/logos/restructuredtext-logo.png"/>
+
+ <logo href="http://maven-site.nuiton.org/jrst" name="JRst"
+ img="http://maven-site.nuiton.org/public/images/logos/jrst-logo.png"/>
+
+ </poweredBy>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.chorem.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.chorem.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="./index.html"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="nuiton.org" href="http://www.nuiton.org"/>
+ <item name="chorem.org" href="http://www.chorem.org"/>
+ <item name="CodeLutin" href="http://codelutin.com"/>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ </links>
+
+ <menu name="Documentation">
+ <item name="User" href="./user.html"/>
+ <item name="Developer" href="./dev.html"/>
+ </menu>
+
+ <menu name="Language">
+ <item name="Français" href="./fr/index.html"/>
+ <item name="English" href="./index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+ <div id='projectMetas' locale='en'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
+
Added: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml (rev 0)
+++ trunk/src/site/site_fr.xml 2014-03-28 21:42:08 UTC (rev 5)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Pollen
+ $Id: site_fr.xml 3671 2012-09-04 14:06:07Z tchemit $
+ $HeadURL: http://forge.chorem.org/svn-private/pollen/trunk/src/site/site_fr.xml $
+ %%
+ Copyright (C) 2009 - 2012 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="SayMyTexts">/images/logos/smt_logo_title.png</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.3.0</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>false</topBarEnabled>
+ <sideBarEnabled>true</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <publishDate position="right" format="dd/MM/yyyy"/>
+ <version position="right"/>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven"
+ img="http://maven-site.nuiton.org/public/images/logos/maven-feather.png"/>
+
+ <logo href="http://docutils.sourceforge.net/rst.html"
+ name="ReStructuredText"
+ img="http://maven-site.nuiton.org/public/images/logos/restructuredtext-logo.png"/>
+
+ <logo href="http://maven-site.nuiton.org/jrst" name="JRst"
+ img="http://maven-site.nuiton.org/public/images/logos/jrst-logo.png"/>
+
+<!-- add android -->
+
+ </poweredBy>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="./index.html"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="nuiton.org" href="http://www.nuiton.org"/>
+ <item name="chorem.org" href="http://www.chorem.org"/>
+ <item name="CodeLutin" href="http://codelutin.com"/>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ </links>
+
+ <menu name="Documentation">
+ <item name="Utilisateur" href="./user.html"/>
+ <item name="Développeur" href="./dev.html"/>
+ </menu>
+
+ <menu name="Langue">
+ <item name="Français" href="index.html"/>
+ <item name="English" href="../index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <div id='projectMetas' locale='fr'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
+
1
0
Author: kmorin
Date: 2014-03-24 22:11:15 +0100 (Mon, 24 Mar 2014)
New Revision: 4
Url: http://forge.chorem.org/projects/say-my-texts/repository/revisions/4
Log:
fixes #1003 Read out loud when the phone is connected by bluetooth to a headset or car system
Modified:
trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java
trunk/src/org/chorem/android/saymytexts/SayMyTextService.java
trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java
Modified: trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java 2014-03-22 11:16:53 UTC (rev 3)
+++ trunk/src/org/chorem/android/saymytexts/NewTextBroadcastReceiver.java 2014-03-24 21:11:15 UTC (rev 4)
@@ -1,18 +1,13 @@
package org.chorem.android.saymytexts;
+import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
-import android.media.AudioManager;
import android.os.Bundle;
-import android.preference.PreferenceManager;
import android.telephony.SmsMessage;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Receives the SMSs and if the headset is plugged, start the service to say it out loud.
*
@@ -21,70 +16,52 @@
*/
public class NewTextBroadcastReceiver extends BroadcastReceiver {
- protected static final List<BluetoothDevice> BT_DEVICES = new ArrayList<>();
-
@Override
public void onReceive(Context context, Intent intent) {
+ Intent serviceIntent = new Intent(context, SayMyTextService.class);
+
String action = intent.getAction();
if ("android.provider.Telephony.SMS_RECEIVED".equals(action)) {
- SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
- String readingEnabledKey = context.getString(R.string.preference_enable_reading_key);
- boolean readingEnabled = sharedPref.getBoolean(readingEnabledKey, true);
+ // get the SMS message passed in
+ Bundle bundle = intent.getExtras();
+ if (bundle != null) {
+ SmsMessage[] msgs = null;
+ String messageReceived = "";
- // if the headset is plugged
- AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
-// if (am.isWiredHeadsetOn() || !BT_DEVICES.isEmpty()) {
- if (readingEnabled && (am.isWiredHeadsetOn() ||
- am.isBluetoothScoAvailableOffCall() && am.isBluetoothScoOn()
- || am.isBluetoothA2dpOn())) {
+ // retrieve the SMS message received
+ Object[] pdus = (Object[]) bundle.get("pdus");
+ msgs = new SmsMessage[pdus.length];
+ for (int i = 0; i < msgs.length; i++) {
+ msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
+ messageReceived += msgs[i].getDisplayMessageBody() + " ";
+ }
- // get the SMS message passed in
- Bundle bundle = intent.getExtras();
+ // Get the Sender Phone Number
+ String senderPhoneNumber = msgs[0].getDisplayOriginatingAddress();
- if (bundle != null) {
- SmsMessage[] msgs = null;
- String messageReceived = "";
+ // start the service to say it out loud
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_BODY, messageReceived);
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_SENDER, senderPhoneNumber);
+ context.startService(serviceIntent);
+ }
- // retrieve the SMS message received
- Object[] pdus = (Object[]) bundle.get("pdus");
- msgs = new SmsMessage[pdus.length];
- for (int i = 0; i < msgs.length; i++) {
- msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
- messageReceived += msgs[i].getDisplayMessageBody() + " ";
- }
+ } else {
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
- // Get the Sender Phone Number
- String senderPhoneNumber = msgs[0].getDisplayOriginatingAddress();
-
- if (am.isBluetoothScoAvailableOffCall()) {
- am.startBluetoothSco();
- } else {
- am.stopBluetoothSco();
- }
- // start the service to say it out loud
- Intent serviceIntent = new Intent(context, SayMyTextService.class);
- serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_BODY, messageReceived);
- serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_SMS_SENDER, senderPhoneNumber);
+ if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
+ int majorDeviceClass = device.getBluetoothClass().getMajorDeviceClass();
+ if (majorDeviceClass == BluetoothClass.Device.Major.AUDIO_VIDEO) {
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_BT_DEVICE, device);
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_ADD_BT_DEVICE, true);
context.startService(serviceIntent);
}
- }
- } else {
-// BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
-//
-// if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
-// int majorDeviceClass = device.getBluetoothClass().getMajorDeviceClass();
-// Toast.makeText(context, "ACTION_ACL_CONNECTED " + majorDeviceClass, Toast.LENGTH_LONG).show();
-// if (majorDeviceClass == BluetoothClass.Device.Major.AUDIO_VIDEO) {
-// Toast.makeText(context, "device ok", Toast.LENGTH_LONG).show();
-// BT_DEVICES.add(device);
-// }
-//
-// } else {
-// Toast.makeText(context, "btHeadsetConnected false", Toast.LENGTH_LONG).show();
-// BT_DEVICES.remove(device);
-// }
+ } else {
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_BT_DEVICE, device);
+ serviceIntent.putExtra(SayMyTextService.INTENT_EXTRA_ADD_BT_DEVICE, false);
+ context.startService(serviceIntent);
+ }
}
}
}
Modified: trunk/src/org/chorem/android/saymytexts/SayMyTextService.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextService.java 2014-03-22 11:16:53 UTC (rev 3)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextService.java 2014-03-24 21:11:15 UTC (rev 4)
@@ -1,22 +1,32 @@
package org.chorem.android.saymytexts;
import android.app.Service;
+import android.bluetooth.BluetoothDevice;
+import android.content.BroadcastReceiver;
import android.content.ContentResolver;
+import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.database.Cursor;
+import android.media.AudioManager;
import android.net.Uri;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.provider.BaseColumns;
import android.provider.ContactsContract;
import android.speech.tts.TextToSpeech;
+import android.speech.tts.UtteranceProgressListener;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
import android.util.Log;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
/**
* Service which say out loud the text passed in the intent
@@ -26,25 +36,63 @@
*/
public class SayMyTextService extends Service implements TextToSpeech.OnInitListener {
- private static final String TAG = "SayMyTextActivity";
+ private static final String TAG = "SayMyTextService";
+ /** Body of the SMS */
public static final String INTENT_EXTRA_SMS_BODY = "smsBody";
+ /** Number of the sender of the SMS */
public static final String INTENT_EXTRA_SMS_SENDER = "smsSender";
+ /** Bluetooth device which has just connected or disconnected */
+ public static final String INTENT_EXTRA_BT_DEVICE = "btDevice";
+ /** If true, the device has just connected, else disconnected */
+ public static final String INTENT_EXTRA_ADD_BT_DEVICE = "addBtDevice";
+ /** utterance id when the bluetooth device is connected */
+ protected static final String BT_UTTERANCE_ID = "btUtteranceId";
+
+ protected AudioManager audioManager;
+
+ /** null if the texttospeech is not initialized */
+ protected Boolean canSpeak = null;
+
protected TextToSpeech textToSpeech;
- // texts to read, received before the textospeech is ready
+
+ /** texts to read, received before the textospeech is ready or while a call is in progress */
protected List<String> awaitingTexts = new ArrayList<>();
+ /** bluetooth devices which are currently connected */
+ protected Map<BluetoothDevice, Integer> bluetoothDevices = new HashMap<>();
+
+ /**
+ * Listener to clal state change
+ */
+ protected final PhoneStateListener callStateListener = new PhoneStateListener() {
+ @Override
+ public void onCallStateChanged(int state, String incomingNumber) {
+ super.onCallStateChanged(state, incomingNumber);
+ if (canSpeak != null) {
+ setCanSpeak(state == TelephonyManager.CALL_STATE_IDLE);
+ }
+ }
+ };
+
@Override
public void onCreate() {
super.onCreate();
textToSpeech = new TextToSpeech(this, this);
+
+ audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
+
+ TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
+ tm.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE);
}
@Override
public void onDestroy() {
super.onDestroy();
+ TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
+ tm.listen(callStateListener, PhoneStateListener.LISTEN_NONE);
textToSpeech.shutdown();
}
@@ -55,65 +103,169 @@
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
- super.onStartCommand(intent, flags, startId);
+ int result = super.onStartCommand(intent, flags, startId);
- String sms = intent.getStringExtra(INTENT_EXTRA_SMS_BODY);
- String sender = intent.getStringExtra(INTENT_EXTRA_SMS_SENDER);
- sender = getContactDisplayNameByNumber(sender);
- String text = getString(R.string.sms_received, sender, sms);
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ String readingEnabledKey = getString(R.string.preference_enable_reading_key);
+ boolean readingEnabled = sharedPref.getBoolean(readingEnabledKey, true);
- if (awaitingTexts != null) {
- awaitingTexts.add(text);
- } else {
- readText(text);
+ if (intent != null) {
+ BluetoothDevice device = intent.getParcelableExtra(INTENT_EXTRA_BT_DEVICE);
+ // if a device is passed to the service
+ // add or remove the device from the connected devices
+ if (device != null) {
+ boolean addBtDevice = intent.getBooleanExtra(INTENT_EXTRA_ADD_BT_DEVICE, false);
+ if (addBtDevice) {
+ bluetoothDevices.put(device, device.getBluetoothClass().getDeviceClass());
+ } else {
+ bluetoothDevices.remove(device);
+ }
+
+
+ // else if the user enabled the reading and
+ // if the headset is plugged, or if there is a bluetooth device connected
+ } else if (readingEnabled && (audioManager.isWiredHeadsetOn() || !bluetoothDevices.isEmpty())) {
+
+ String sms = intent.getStringExtra(INTENT_EXTRA_SMS_BODY);
+ String sender = intent.getStringExtra(INTENT_EXTRA_SMS_SENDER);
+ sender = getContactDisplayNameByNumber(sender);
+ String text = getString(R.string.sms_received, sender, sms);
+
+ if (canSpeak != null && canSpeak) {
+ requestReading(text);
+ } else {
+ awaitingTexts.add(text);
+ }
+ }
+
+ result = START_STICKY;
}
- return START_STICKY;
+ return result;
}
@Override
public void onInit(int status) {
- Log.d(TAG, "initialized " + status);
if (status == TextToSpeech.SUCCESS) {
+ // init texttospeech
+ textToSpeech.setOnUtteranceProgressListener(new UtteranceProgressListener() {
+ @Override
+ public void onStart(String utteranceId) {
+ }
+
+ @Override
+ public void onError(String utteranceId) {
+ Log.e(TAG, "Error speaking: " + utteranceId);
+ }
+
+ @Override
+ public void onDone(String utteranceId) {
+ // when the text has been read by the bluetooth device, stop the connection
+ audioManager.stopBluetoothSco();
+ audioManager.setMode(AudioManager.MODE_NORMAL);
+ }
+ });
+
+ TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
+ setCanSpeak(tm.getCallState() == TelephonyManager.CALL_STATE_IDLE);
+
+ } else {
+ setCanSpeak(null);
+ textToSpeech = new TextToSpeech(this, this);
+ }
+ }
+
+ /**
+ * Sets if the texts can be read
+ *
+ * @param canSpeak null if the texttospeech is not ready,
+ * false if a call is in progress
+ * true otherwise
+ */
+ protected void setCanSpeak(Boolean canSpeak) {
+ this.canSpeak = canSpeak;
+ if (canSpeak != null && canSpeak) {
for (String text : awaitingTexts) {
- readText(text);
+ requestReading(text);
}
- awaitingTexts = null;
+ awaitingTexts.clear();
+ }
+ }
+ /**
+ * Requests the reading of one text through the wired headset or bluetooth device
+ * @param text the text to read
+ */
+ protected void requestReading(String text) {
+ requestReading(Collections.singletonList(text));
+ }
+
+ /**
+ * Requests the reading of a list of texts through the wired headset or bluetooth device
+ * @param texts the texts to read
+ */
+ protected void requestReading(List<String> texts) {
+ if (bluetoothDevices.isEmpty()) {
+ readText(texts, false);
} else {
- textToSpeech = new TextToSpeech(this, this);
+ requestReadingOverBt(texts);
}
}
/**
+ * Starts the connection with the bluetooth device and requests the reading
+ * @param texts the texts to read
+ */
+ protected void requestReadingOverBt(final List<String> texts) {
+ registerReceiver(new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int state = intent.getExtras().getInt(AudioManager.EXTRA_SCO_AUDIO_STATE);
+ if (state == AudioManager.SCO_AUDIO_STATE_CONNECTED) {
+ context.unregisterReceiver(this);
+ readText(texts, true);
+ }
+ }
+ }, new IntentFilter(AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED));
+ audioManager.setMode(AudioManager.MODE_IN_CALL);
+ audioManager.startBluetoothSco();
+ }
+
+ /**
* Reads the texts out loud
- * @param text the text to read
+ * @param texts the texts to read
+ * @param btConnected if true, adds the utterance id for the bluetooth device
*/
- protected void readText(String text) {
+ protected void readText(List<String> texts, boolean btConnected) {
HashMap<String, String> params = new HashMap<>();
-// params.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_VOICE_CALL));
+ params.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_VOICE_CALL));
+ if (btConnected) {
+ params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, BT_UTTERANCE_ID);
+ }
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
String heisendroidModeEnabledKey = getString(R.string.preference_enable_heisendroid_mode_key);
boolean heisendroidModeEnabled = sharedPref.getBoolean(heisendroidModeEnabledKey, true);
- if (heisendroidModeEnabled) {
- textToSpeech.setLanguage(Locale.US);
- textToSpeech.setSpeechRate(0.3f);
- textToSpeech.setPitch(0.1f);
- textToSpeech.speak("Say my text.", TextToSpeech.QUEUE_ADD, params);
- }
+ for (String text : texts) {
+ if (heisendroidModeEnabled) {
+ textToSpeech.setLanguage(Locale.US);
+ textToSpeech.setSpeechRate(0.3f);
+ textToSpeech.setPitch(0.1f);
+ textToSpeech.speak("Say my text.", TextToSpeech.QUEUE_ADD, params);
+ }
- textToSpeech.setLanguage(Locale.getDefault());
- textToSpeech.setSpeechRate(1f);
- textToSpeech.setPitch(1f);
- textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, params);
+ textToSpeech.setLanguage(Locale.getDefault());
+ textToSpeech.setSpeechRate(1f);
+ textToSpeech.setPitch(1f);
+ textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, params);
- if (heisendroidModeEnabled) {
- textToSpeech.setLanguage(Locale.US);
- textToSpeech.setSpeechRate(0.3f);
- textToSpeech.setPitch(0.1f);
- textToSpeech.speak("You're goddamn right.", TextToSpeech.QUEUE_ADD, params);
+ if (heisendroidModeEnabled) {
+ textToSpeech.setLanguage(Locale.US);
+ textToSpeech.setSpeechRate(0.3f);
+ textToSpeech.setPitch(0.1f);
+ textToSpeech.speak("You're goddamn right.", TextToSpeech.QUEUE_ADD, params);
+ }
}
}
Modified: trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java
===================================================================
--- trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java 2014-03-22 11:16:53 UTC (rev 3)
+++ trunk/src/org/chorem/android/saymytexts/SayMyTextsApplication.java 2014-03-24 21:11:15 UTC (rev 4)
@@ -7,7 +7,7 @@
/**
* @author Kevin Morin (Code Lutin)
- * @since x.x
+ * @since 1.0
*/
@ReportsCrashes(formKey = "", // will not be used
mailTo = "Say-my-texts-devel(a)list.chorem.org",
1
0