From abb76664ee0c5ac746799d2f121b19f6d7b4ccb7 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Fri, 6 Nov 2015 08:36:19 +0800 Subject: [PATCH] removed character limit of message conversation fragment --- .../fragment/support/MessagesConversationFragment.java | 4 +--- .../java/org/mariotaku/twidere/util/TwidereValidator.java | 4 ++++ .../src/main/java/org/mariotaku/twidere/util/Utils.java | 7 +++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/MessagesConversationFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/MessagesConversationFragment.java index 6c98e0c8a..6918381c8 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/MessagesConversationFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/MessagesConversationFragment.java @@ -630,8 +630,6 @@ public class MessagesConversationFragment extends BaseSupportFragment implements final String message = mEditText.getText().toString(); if (TextUtils.isEmpty(message)) { mEditText.setError(getString(R.string.error_message_no_content)); - } else if (mValidator.getTweetLength(message) > mValidator.getMaxTweetLength()) { - mEditText.setError(getString(R.string.error_message_message_too_long)); } else { mTwitterWrapper.sendDirectMessageAsync(account.account_id, recipient.id, message, mImageUri); mEditText.setText(null); @@ -727,7 +725,7 @@ public class MessagesConversationFragment extends BaseSupportFragment implements @Override public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { if (mSendButton == null || s == null) return; - mSendButton.setEnabled(mValidator.isValidTweet(s.toString())); + mSendButton.setEnabled(mValidator.isValidDirectMessage(s.toString())); } }); } diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/TwidereValidator.java b/twidere/src/main/java/org/mariotaku/twidere/util/TwidereValidator.java index a72009a55..eaadb5116 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/TwidereValidator.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/TwidereValidator.java @@ -55,4 +55,8 @@ public class TwidereValidator implements Constants { return !TextUtils.isEmpty(text) && getTweetLength(text) <= getMaxTweetLength(); } + public boolean isValidDirectMessage(final CharSequence text) { + return !TextUtils.isEmpty(text); + } + } diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/Utils.java b/twidere/src/main/java/org/mariotaku/twidere/util/Utils.java index f6300d666..cdcaf27ed 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/Utils.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/Utils.java @@ -3350,6 +3350,13 @@ public final class Utils implements Constants { final MenuItem favorite = menu.findItem(R.id.favorite); if (favorite != null) { if (preferences.getBoolean(KEY_I_WANT_MY_STARS_BACK)) { + final Drawable oldIcon = favorite.getIcon(); + if (oldIcon instanceof ActionIconDrawable) { + final Drawable starIcon = ContextCompat.getDrawable(context, R.drawable.ic_action_star); + favorite.setIcon(new ActionIconDrawable(starIcon, ((ActionIconDrawable) oldIcon).getDefaultColor())); + } else { + favorite.setIcon(R.drawable.ic_action_star); + } ActionIconDrawable.setMenuHighlight(favorite, new TwidereMenuInfo(status.is_favorite, favoriteHighlight)); favorite.setTitle(status.is_favorite ? R.string.unfavorite : R.string.favorite); } else {