aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-09-11 21:33:31 +0200
committerChristian Schneppe <christian@pix-art.de>2018-09-11 21:33:31 +0200
commitc9137e69ccaeace11a26699f2c0ff936297c1f6e (patch)
tree1a80705dfce1bb64a25321614f1f4c7cabe6fd57 /src/main/java/de/pixart/messenger/ui
parent35332e989ad6db1b31b651c240eecd4813a7f13e (diff)
AudioPlayer: disable screen when holding phone to ear
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index abe17e4e0..877696824 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -2131,6 +2131,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
public void onStop() {
super.onStop();
final Activity activity = getActivity();
+ messageListAdapter.unregisterListenerInAudioPlayer();
if (activity == null || !activity.isChangingConfigurations()) {
hideSoftKeyboard(activity);
messageListAdapter.stopAudioPlayer();
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 f3b04ff8a..0c42d11b4 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -1027,6 +1027,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
audioPlayer.stop();
}
+ public void unregisterListenerInAudioPlayer() {
+ audioPlayer.unregisterListener();
+ }
+
public void startStopPending() {
audioPlayer.startStopPending();
}