diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-05-02 20:46:30 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-05-02 20:46:30 +0200 |
commit | f176793c68f4fe96b848b54a8bbab8af154cbfb0 (patch) | |
tree | 47b9cc65c4956c2bba7da57604da0503d2f9e475 /src/main/java | |
parent | cb9c00d2883a3497fb74bb9c3b64c609f0310d77 (diff) |
remove old code
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 48 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 16 |
2 files changed, 0 insertions, 64 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 1f39276e2..ccb3cc59c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -29,7 +29,6 @@ import android.support.v13.view.inputmethod.InputConnectionCompat; import android.support.v13.view.inputmethod.InputContentInfoCompat; import android.support.v7.app.AlertDialog; import android.text.Editable; -import android.text.TextWatcher; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; @@ -550,53 +549,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke return getConversation(activity, R.id.main_fragment); } - private TextWatcher mSearchTextWatcher = new TextWatcher() { - - @Override - public void afterTextChanged(Editable editable) { - String query = editable.toString().trim(); - - if ((!query.isEmpty() || !query.contains("")) && query.length() >= 3) { - binding.searchUp.setVisibility(View.VISIBLE); - binding.searchDown.setVisibility(View.VISIBLE); - Message found = searchHistory(query); - if (found != null) { - binding.searchUp.setVisibility(View.VISIBLE); - binding.searchDown.setVisibility(View.VISIBLE); - } else { - binding.searchUp.setVisibility(View.GONE); - binding.searchDown.setVisibility(View.GONE); - } - binding.searchUp.setEnabled(found != null); - binding.searchDown.setEnabled(found != null); - View.OnClickListener upDownListener = new View.OnClickListener() { - @Override - public void onClick(View view) { - String searchQuery = binding.searchfieldInput.getText().toString().trim(); - if (!searchQuery.isEmpty() || !searchQuery.contains("")) { - searchHistory(searchQuery, view.getId() == R.id.search_up); - } - - } - }; - binding.searchUp.setOnClickListener(upDownListener); - binding.searchDown.setOnClickListener(upDownListener); - } else { - binding.searchUp.setVisibility(View.GONE); - binding.searchDown.setVisibility(View.GONE); - } - } - - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - activity.refreshUi(); - } - }; - private static boolean allGranted(int[] grantResults) { for (int grantResult : grantResults) { if (grantResult != PackageManager.PERMISSION_GRANTED) { diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 512fe989e..ad9bb8f4a 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -24,7 +24,6 @@ import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.format.DateUtils; -import android.text.style.BackgroundColorSpan; import android.text.style.ForegroundColorSpan; import android.text.style.RelativeSizeSpan; import android.text.style.StyleSpan; @@ -532,21 +531,6 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie final String nick = UIHelper.getMessageDisplayName(message); SpannableStringBuilder body = message.getMergedBody(); boolean hasMeCommand = message.hasMeCommand(); - if (mConversationFragment != null) { - String searchQuery = mConversationFragment.binding.searchfieldInput.getText().toString().toLowerCase().trim(); - if (((!searchQuery.isEmpty() || !searchQuery.contains("")) && searchQuery.length() >= 3) && body.toString().toLowerCase().contains(searchQuery)) { - int ofe = body.toString().toLowerCase().indexOf(searchQuery, 0); - for (int ofs = 0; ofs < body.length() && ofe != -1; ofs = ofe + 1) { - ofe = body.toString().toLowerCase().indexOf(searchQuery, ofs); - if (ofe == -1) { - break; - } else { - body.setSpan(new StyleSpan(Typeface.BOLD), ofe, ofe + searchQuery.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - body.setSpan(new BackgroundColorSpan(0xFFFFFF00), ofe, ofe + searchQuery.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - } - } - } - } if (hasMeCommand) { body = body.replace(0, Message.ME_COMMAND.length(), nick); } |