aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java48
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java16
-rw-r--r--src/main/res/layout/fragment_conversation.xml52
3 files changed, 0 insertions, 116 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);
}
diff --git a/src/main/res/layout/fragment_conversation.xml b/src/main/res/layout/fragment_conversation.xml
index 1dea98a8c..1b03b375d 100644
--- a/src/main/res/layout/fragment_conversation.xml
+++ b/src/main/res/layout/fragment_conversation.xml
@@ -56,58 +56,6 @@
android:layout_alignParentLeft="true">
<RelativeLayout
- android:id="@+id/searchfield"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="2dp"
- android:background="?attr/color_border"
- android:minHeight="50dp"
- android:visibility="gone">
-
- <EditText
- android:id="@+id/searchfield_input"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_toLeftOf="@+id/button_bar"
- android:hint="@string/search"
- android:maxLines="4"
- android:minHeight="48dp"
- android:minLines="1"
- android:paddingBottom="12dp"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="12dp"
- android:singleLine="false"
- android:textColor="@color/realwhite"
- android:textColorHint="@color/white" />
-
- <LinearLayout
- android:id="@+id/button_bar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true">
-
- <ImageButton
- android:id="@+id/search_up"
- style="?android:attr/borderlessButtonStyle"
- android:layout_width="32dp"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_keyboard_arrow_up_white_24dp"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/search_down"
- style="?android:attr/borderlessButtonStyle"
- android:layout_width="32dp"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_keyboard_arrow_down_white_24dp"
- android:visibility="gone" />
- </LinearLayout>
- </RelativeLayout>
-
- <RelativeLayout
android:id="@+id/textsend"
android:layout_width="fill_parent"
android:layout_height="wrap_content"