aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.gradle1
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java78
-rw-r--r--src/main/res/layout-w945dp/fragment_conversations_overview.xml2
-rw-r--r--src/main/res/layout/fragment_conversations_overview.xml2
-rw-r--r--src/main/res/values/defaults.xml1
5 files changed, 4 insertions, 80 deletions
diff --git a/build.gradle b/build.gradle
index e28514aa1..645d6ac67 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,7 +50,6 @@ dependencies {
compile 'com.google.zxing:core:3.3.0'
compile 'com.google.zxing:android-integration:3.3.0'
compile 'de.measite.minidns:minidns-hla:0.2.4'
- compile 'de.timroes.android:EnhancedListView:0.3.4'
compile 'me.leolin:ShortcutBadger:1.1.19@aar'
compile 'com.kyleduo.switchbutton:library:1.2.8'
compile 'org.whispersystems:signal-protocol-java:2.6.2'
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 606374d47..3bfcf3dc9 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -42,6 +42,7 @@ import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.ListView;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import android.widget.TextView;
@@ -86,7 +87,6 @@ import de.pixart.messenger.xmpp.XmppConnection;
import de.pixart.messenger.xmpp.chatstate.ChatState;
import de.pixart.messenger.xmpp.jid.InvalidJidException;
import de.pixart.messenger.xmpp.jid.Jid;
-import de.timroes.android.listview.EnhancedListView;
import static de.pixart.messenger.ui.SettingsActivity.USE_BUNDLED_EMOJIS;
import static de.pixart.messenger.ui.ShowFullscreenMessageActivity.getMimeType;
@@ -139,7 +139,7 @@ public class ConversationActivity extends XmppActivity
private List<Conversation> conversationList = new ArrayList<>();
private Conversation swipedConversation = null;
private Conversation mSelectedConversation = null;
- private EnhancedListView listView;
+ private ListView listView;
public ConversationFragment mConversationFragment;
private ArrayAdapter<Conversation> listAdapter;
@@ -269,76 +269,6 @@ public class ConversationActivity extends XmppActivity
}
});
- listView.setDismissCallback(new EnhancedListView.OnDismissCallback() {
-
- @Override
- public EnhancedListView.Undoable onDismiss(final EnhancedListView enhancedListView, final int position) {
-
- final int index = listView.getFirstVisiblePosition();
- View v = listView.getChildAt(0);
- final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
-
- try {
- swipedConversation = listAdapter.getItem(position);
- } catch (IndexOutOfBoundsException e) {
- return null;
- }
- listAdapter.remove(swipedConversation);
- xmppConnectionService.markRead(swipedConversation);
-
- final boolean formerlySelected = (getSelectedConversation() == swipedConversation);
- if (position == 0 && listAdapter.getCount() == 0) {
- endConversation(swipedConversation, false, true);
- return null;
- } else if (formerlySelected) {
- setSelectedConversation(listAdapter.getItem(0));
- ConversationActivity.this.mConversationFragment
- .reInit(getSelectedConversation());
- }
-
- return new EnhancedListView.Undoable() {
-
- @Override
- public void undo() {
- listAdapter.insert(swipedConversation, position);
- if (formerlySelected) {
- setSelectedConversation(swipedConversation);
- ConversationActivity.this.mConversationFragment
- .reInit(getSelectedConversation());
- }
- swipedConversation = null;
- listView.setSelectionFromTop(index + (listView.getChildCount() < position ? 1 : 0), top);
- }
-
- @Override
- public void discard() {
- if (!swipedConversation.isRead()
- && swipedConversation.getMode() == Conversation.MODE_SINGLE) {
- swipedConversation = null;
- return;
- }
- endConversation(swipedConversation, false, false);
- swipedConversation = null;
- }
-
- @Override
- public String getTitle() {
- if (swipedConversation.getMode() == Conversation.MODE_MULTI) {
- return getResources().getString(R.string.title_undo_swipe_out_muc);
- } else {
- return getResources().getString(R.string.title_undo_swipe_out_conversation);
- }
- }
- };
- }
- });
- //listView.enableSwipeToDismiss();
- listView.setSwipingLayout(R.id.swipeable_item);
- listView.setUndoStyle(EnhancedListView.UndoStyle.SINGLE_POPUP);
- listView.setUndoHideDelay(10000);
- listView.setRequireTouchBeforeDismiss(false);
- listView.setSwipeDirection(EnhancedListView.SwipeDirection.START); // swipe to left to close conversation
-
mContentView = findViewById(R.id.content_view_spl);
if (mContentView == null) {
mContentView = findViewById(R.id.content_view_ll);
@@ -364,7 +294,6 @@ public class ConversationActivity extends XmppActivity
@Override
public void onPanelClosed(View arg0) {
mShouldPanelBeOpen.set(false);
- listView.discardUndo();
openConversation();
}
@@ -1280,7 +1209,6 @@ public class ConversationActivity extends XmppActivity
@Override
public void onPause() {
- listView.discardUndo();
super.onPause();
this.mActivityPaused = true;
}
@@ -2036,8 +1964,6 @@ public class ConversationActivity extends XmppActivity
if (swipedConversation != null) {
if (swipedConversation.isRead()) {
conversationList.remove(swipedConversation);
- } else {
- listView.discardUndo();
}
}
listAdapter.notifyDataSetChanged();
diff --git a/src/main/res/layout-w945dp/fragment_conversations_overview.xml b/src/main/res/layout-w945dp/fragment_conversations_overview.xml
index 127264945..3176ad814 100644
--- a/src/main/res/layout-w945dp/fragment_conversations_overview.xml
+++ b/src/main/res/layout-w945dp/fragment_conversations_overview.xml
@@ -10,7 +10,7 @@
android:background="@color/grey50"
android:orientation="vertical">
- <de.timroes.android.listview.EnhancedListView
+ <ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
diff --git a/src/main/res/layout/fragment_conversations_overview.xml b/src/main/res/layout/fragment_conversations_overview.xml
index e74e0e533..493f962ec 100644
--- a/src/main/res/layout/fragment_conversations_overview.xml
+++ b/src/main/res/layout/fragment_conversations_overview.xml
@@ -10,7 +10,7 @@
android:background="@color/grey50"
android:orientation="vertical">
- <de.timroes.android.listview.EnhancedListView
+ <ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index 208c43e63..4fa1e37a2 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -32,7 +32,6 @@
\n\nhttps://developer.android.com/tools/support-library\n(Apache License, Version 2.0)
\n\nhttps://github.com/zxing/zxing\n(Apache License, Version 2.0)
\n\nhttps://github.com/google/material-design-icons\n(CC BY 4.0)
- \n\nhttps://github.com/timroes/EnhancedListView\n(Apache License, Version 2.0)
\n\nhttps://github.com/leolin310148/ShortcutBadger\n(Apache License, Version 2.0)
\n\nhttps://github.com/kyleduo/SwitchButton\n(Apache License, Version 2.0)
\n\nhttps://github.com/WhisperSystems/libaxolotl-java\n(GPLv3)