diff options
-rw-r--r-- | res/values-ldrtl/styles.xml | 2 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 4 | ||||
-rw-r--r-- | res/values/lineage_constants.xml | 4 | ||||
-rw-r--r-- | res/values/styles.xml | 2 | ||||
-rw-r--r-- | res/xml-v21/preferences_application.xml | 7 | ||||
-rw-r--r-- | res/xml-v23/preferences_application.xml | 7 | ||||
-rw-r--r-- | res/xml/preferences_application.xml | 7 | ||||
-rw-r--r-- | src/com/android/messaging/ui/conversation/ComposeMessageView.java | 11 | ||||
-rw-r--r-- | src/org/lineageos/messaging/util/PrefsUtils.java | 10 |
9 files changed, 52 insertions, 2 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_strings.xml b/res/values/cm_strings.xml index 1e1ee52..15110df 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -18,4 +18,8 @@ <!-- Swipe to delete conversation --> <string name="swipe_to_delete_conversation_pref_title">Swipe to delete</string> <string name="swipe_to_delete_conversation_pref_summary">Swipe to the right to delete a conversation</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/lineage_constants.xml b/res/values/lineage_constants.xml index 1975b6a..cf2793b 100644 --- a/res/values/lineage_constants.xml +++ b/res/values/lineage_constants.xml @@ -21,4 +21,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/styles.xml b/res/values/styles.xml index 643d044..fa02e4f 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -142,7 +142,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/xml-v21/preferences_application.xml b/res/xml-v21/preferences_application.xml index ab9206a..c403c06 100644 --- a/res/xml-v21/preferences_application.xml +++ b/res/xml-v21/preferences_application.xml @@ -67,6 +67,13 @@ android:dependency="@string/notifications_enabled_pref_key" /> <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_to_delete_conversation_pref_title" android:summary="@string/swipe_to_delete_conversation_pref_summary" diff --git a/res/xml-v23/preferences_application.xml b/res/xml-v23/preferences_application.xml index 0f106c7..d9cc151 100644 --- a/res/xml-v23/preferences_application.xml +++ b/res/xml-v23/preferences_application.xml @@ -68,6 +68,13 @@ android:dependency="@string/notifications_enabled_pref_key" /> <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_to_delete_conversation_pref_title" android:summary="@string/swipe_to_delete_conversation_pref_summary" diff --git a/res/xml/preferences_application.xml b/res/xml/preferences_application.xml index 4c67407..03b868b 100644 --- a/res/xml/preferences_application.xml +++ b/res/xml/preferences_application.xml @@ -66,6 +66,13 @@ android:persistent="true" android:dependency="@string/notifications_enabled_pref_key" /> + <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_to_delete_conversation_pref_title" diff --git a/src/com/android/messaging/ui/conversation/ComposeMessageView.java b/src/com/android/messaging/ui/conversation/ComposeMessageView.java index 5db1292..bd63c98 100644 --- a/src/com/android/messaging/ui/conversation/ComposeMessageView.java +++ b/src/com/android/messaging/ui/conversation/ComposeMessageView.java @@ -25,6 +25,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; @@ -69,6 +70,8 @@ import com.android.messaging.util.MediaUtil; import com.android.messaging.util.OsUtil; import com.android.messaging.util.UiUtils; +import org.lineageos.messaging.util.PrefsUtils; + import java.util.Collection; import java.util.List; @@ -213,6 +216,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/org/lineageos/messaging/util/PrefsUtils.java b/src/org/lineageos/messaging/util/PrefsUtils.java index fa08af4..ad0bc13 100644 --- a/src/org/lineageos/messaging/util/PrefsUtils.java +++ b/src/org/lineageos/messaging/util/PrefsUtils.java @@ -22,6 +22,8 @@ import com.android.messaging.R; import com.android.messaging.util.BuglePrefs; public class PrefsUtils { + public static final String SHOW_EMOTICONS_ENABLED = "pref_show_emoticons"; + private PrefsUtils() { //Don't instantiate } @@ -39,4 +41,12 @@ public class PrefsUtils { R.bool.swipe_right_deletes_conversation_default); return prefs.getBoolean(prefKey, defaultValue); } + + 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); + } } |