summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrianDC <radian.dc@gmail.com>2016-01-31 22:39:56 +0100
committerMartin Brabham <optedoblivion@cyngn.com>2016-03-01 13:02:15 -0500
commit2a065f1a6887ebf43eae9e431464fae8c32b9d7a (patch)
treeec8b48d160f241cc231bba89f857b2a2865c334c
parent80c9a59ac18e0676d4a4a8d73255b12672b5c094 (diff)
downloadpackages_apps_Messaging-2a065f1a6887ebf43eae9e431464fae8c32b9d7a.tar.gz
packages_apps_Messaging-2a065f1a6887ebf43eae9e431464fae8c32b9d7a.tar.bz2
packages_apps_Messaging-2a065f1a6887ebf43eae9e431464fae8c32b9d7a.zip
Messaging: Toggable keyboard emoticons access
* Allows keyboards to always display the line return key Change-Id: I316154ebc19c2f1274b9059336cef9940d9d6cff Signed-off-by: AdrianDC <radian.dc@gmail.com>
-rw-r--r--res/values-ldrtl/styles.xml2
-rw-r--r--res/values/cm_constants.xml4
-rw-r--r--res/values/cm_strings.xml4
-rw-r--r--res/values/styles.xml4
-rw-r--r--res/xml-v21/preferences_application.xml7
-rw-r--r--res/xml-v23/preferences_application.xml7
-rw-r--r--res/xml/preferences_application.xml7
-rw-r--r--src/com/android/messaging/ui/conversation/ComposeMessageView.java11
-rwxr-xr-xsrc/com/cyanogenmod/messaging/quickmessage/QuickMessagePopup.java9
-rw-r--r--src/com/cyanogenmod/messaging/util/PrefsUtils.java9
10 files changed, 61 insertions, 3 deletions
diff --git a/res/values-ldrtl/styles.xml b/res/values-ldrtl/styles.xml
index bd270c7..abfd16c 100644
--- a/res/values-ldrtl/styles.xml
+++ b/res/values-ldrtl/styles.xml
@@ -38,7 +38,7 @@
<item name="android:background">@null</item>
<item name="android:scrollHorizontally">false</item>
<item name="android:textCursorDrawable">@null</item>
- <item name="android:inputType">textShortMessage|textAutoCorrect|textCapSentences|textMultiLine</item>
+ <item name="android:inputType">textAutoCorrect|textCapSentences|textMultiLine</item>
</style>
<style name="ConversationComposeSubjectText" parent="ConversationComposeSendText">
diff --git a/res/values/cm_constants.xml b/res/values/cm_constants.xml
index 87ed210..5dcac5d 100644
--- a/res/values/cm_constants.xml
+++ b/res/values/cm_constants.xml
@@ -22,4 +22,8 @@
<!-- This should really go into a config xml, but whoever wrote this app is an idiot, so follow their pattern -->
<bool name="swipe_right_deletes_conversation_default" translatable="false">false</bool>
+
+ <!-- Preference keys for user-visible settings -->
+ <!-- Application-wide settings -->
+ <bool name="show_emoticons_pref_default" translatable="false">true</bool>
</resources>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 8c48b8f..66fdbbd 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -51,4 +51,8 @@
<string name="send">Send</string>
<string name="compose_message_hint_text">Enter message</string>
+
+ <!-- Show emoticons -->
+ <string name="show_emoticons_pref_title">Emoticons access</string>
+ <string name="show_emoticons_pref_summary">Show the emoticons key on the keyboard</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index f017b23..7009202 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -133,7 +133,7 @@
<item name="android:background">@null</item>
<item name="android:scrollHorizontally">false</item>
<item name="android:textCursorDrawable">@null</item>
- <item name="android:inputType">textShortMessage|textAutoCorrect|textCapSentences|textMultiLine</item>
+ <item name="android:inputType">textAutoCorrect|textCapSentences|textMultiLine</item>
</style>
<style name="ConversationComposeSubjectText" parent="ConversationComposeSendText">
@@ -656,7 +656,7 @@
<item name="android:backgroundTint">@color/outgoing_message_bg</item>
<item name="android:scrollHorizontally">false</item>
<item name="android:textCursorDrawable">@null</item>
- <item name="android:inputType">textShortMessage|textAutoCorrect|textCapSentences|textMultiLine</item>
+ <item name="android:inputType">textAutoCorrect|textCapSentences|textMultiLine</item>
</style>
<style name="QMConversationMessage" parent="ConversationMessage">
diff --git a/res/xml-v21/preferences_application.xml b/res/xml-v21/preferences_application.xml
index cae8d2e..947db88 100644
--- a/res/xml-v21/preferences_application.xml
+++ b/res/xml-v21/preferences_application.xml
@@ -76,6 +76,13 @@
android:entryValues="@array/pref_unicode_stripping_values" />
<SwitchPreference
+ android:key="pref_show_emoticons"
+ android:title="@string/show_emoticons_pref_title"
+ android:persistent="true"
+ android:defaultValue="@bool/show_emoticons_pref_default"
+ android:summary="@string/show_emoticons_pref_summary" />
+
+ <SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"
android:title="@string/swipe_right_deletes_conversation_text"
android:defaultValue="false"
diff --git a/res/xml-v23/preferences_application.xml b/res/xml-v23/preferences_application.xml
index 57480ac..f55f9fc 100644
--- a/res/xml-v23/preferences_application.xml
+++ b/res/xml-v23/preferences_application.xml
@@ -77,6 +77,13 @@
android:entryValues="@array/pref_unicode_stripping_values" />
<SwitchPreference
+ android:key="pref_show_emoticons"
+ android:title="@string/show_emoticons_pref_title"
+ android:persistent="true"
+ android:defaultValue="@bool/show_emoticons_pref_default"
+ android:summary="@string/show_emoticons_pref_summary" />
+
+ <SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"
android:title="@string/swipe_right_deletes_conversation_text"
android:defaultValue="false"
diff --git a/res/xml/preferences_application.xml b/res/xml/preferences_application.xml
index 2a29fe2..b32cf98 100644
--- a/res/xml/preferences_application.xml
+++ b/res/xml/preferences_application.xml
@@ -75,6 +75,13 @@
android:entries="@array/pref_unicode_stripping_entries"
android:entryValues="@array/pref_unicode_stripping_values" />
+ <CheckBoxPreference
+ android:key="pref_show_emoticons"
+ android:title="@string/show_emoticons_pref_title"
+ android:persistent="true"
+ android:defaultValue="@bool/show_emoticons_pref_default"
+ android:summary="@string/show_emoticons_pref_summary" />
+
<SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"
android:title="@string/swipe_right_deletes_conversation_text"
diff --git a/src/com/android/messaging/ui/conversation/ComposeMessageView.java b/src/com/android/messaging/ui/conversation/ComposeMessageView.java
index e666f2a..bafcb9d 100644
--- a/src/com/android/messaging/ui/conversation/ComposeMessageView.java
+++ b/src/com/android/messaging/ui/conversation/ComposeMessageView.java
@@ -27,6 +27,7 @@ import android.text.Editable;
import android.text.Html;
import android.text.InputFilter;
import android.text.InputFilter.LengthFilter;
+import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
@@ -72,6 +73,8 @@ import com.android.messaging.util.OsUtil;
import com.android.messaging.util.UiUtils;
import com.android.messaging.util.UnicodeFilter;
+import com.cyanogenmod.messaging.util.PrefsUtils;
+
import java.util.Collection;
import java.util.List;
@@ -229,6 +232,14 @@ public class ComposeMessageView extends LinearLayout
new LengthFilter(MmsConfig.get(ParticipantData.DEFAULT_SELF_SUB_ID)
.getMaxTextLimit()) });
+ if (PrefsUtils.isShowEmoticonsEnabled()) {
+ mComposeEditText.setInputType(mComposeEditText.getInputType()
+ | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
+ } else {
+ mComposeEditText.setInputType(mComposeEditText.getInputType()
+ & ~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
+ }
+
mSelfSendIcon = (SimIconView) findViewById(R.id.self_send_icon);
mSelfSendIcon.setOnClickListener(new OnClickListener() {
@Override
diff --git a/src/com/cyanogenmod/messaging/quickmessage/QuickMessagePopup.java b/src/com/cyanogenmod/messaging/quickmessage/QuickMessagePopup.java
index f96aab1..8589435 100755
--- a/src/com/cyanogenmod/messaging/quickmessage/QuickMessagePopup.java
+++ b/src/com/cyanogenmod/messaging/quickmessage/QuickMessagePopup.java
@@ -25,6 +25,7 @@ import android.service.notification.StatusBarNotification;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.telephony.TelephonyManager;
+import android.text.InputType;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -404,6 +405,14 @@ public class QuickMessagePopup extends Activity {
// Add the layout to the viewpager
collection.addView(quickMessageView);
+
+ if (PrefsUtils.isShowEmoticonsEnabled()) {
+ qmReplyText.setInputType(qmReplyText.getInputType()
+ | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
+ } else {
+ qmReplyText.setInputType(qmReplyText.getInputType()
+ & ~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
+ }
}
return quickMessageView;
}
diff --git a/src/com/cyanogenmod/messaging/util/PrefsUtils.java b/src/com/cyanogenmod/messaging/util/PrefsUtils.java
index d6e4279..0cd0899 100644
--- a/src/com/cyanogenmod/messaging/util/PrefsUtils.java
+++ b/src/com/cyanogenmod/messaging/util/PrefsUtils.java
@@ -29,6 +29,7 @@ public class PrefsUtils {
// QuickMessage
public static final String QUICKMESSAGE_ENABLED = "pref_key_quickmessage";
public static final String QM_CLOSE_ALL_ENABLED = "pref_key_close_all";
+ public static final String SHOW_EMOTICONS_ENABLED = "pref_show_emoticons";
private PrefsUtils() {
//Don't instantiate
@@ -58,6 +59,14 @@ public class PrefsUtils {
return prefs.getBoolean(QM_CLOSE_ALL_ENABLED, false);
}
+ public static boolean isShowEmoticonsEnabled() {
+ final BuglePrefs prefs = BuglePrefs.getApplicationPrefs();
+ final Context context = Factory.get().getApplicationContext();
+ final boolean defaultValue = context.getResources().getBoolean(
+ R.bool.show_emoticons_pref_default);
+ return prefs.getBoolean(SHOW_EMOTICONS_ENABLED, defaultValue);
+ }
+
public static UnicodeFilter getUnicodeFilterIfEnabled() {
final BuglePrefs prefs = BuglePrefs.getApplicationPrefs();
final Context context = Factory.get().getApplicationContext();