diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-14 18:52:34 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-14 18:52:34 +0100 |
commit | 93e97be6dbea6ccea7912830da56542f86f0fd45 (patch) | |
tree | 335598e6957f7fa078c3f0d8f889e2ac409671df /src/main/java/de/pixart | |
parent | 648fe344ae32e56c59ea7e58d559be1a425f3479 (diff) |
switch volume control between earpiece and speaker while listening audio
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AudioPlayer.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AudioPlayer.java b/src/main/java/de/pixart/messenger/services/AudioPlayer.java index 985280554..e41982be3 100644 --- a/src/main/java/de/pixart/messenger/services/AudioPlayer.java +++ b/src/main/java/de/pixart/messenger/services/AudioPlayer.java @@ -378,6 +378,7 @@ public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompleti try { ViewHolder currentViewHolder = getCurrentViewHolder(); if (currentViewHolder != null) { + messageAdapter.getActivity().setVolumeControlStream(streamType); play(currentViewHolder, currentlyPlayingMessage, streamType == AudioManager.STREAM_VOICE_CALL, progress); } } catch (Exception e) { diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 5eb9619c7..e1abbe593 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -26,7 +26,6 @@ import android.graphics.Point; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; -import android.media.AudioManager; import android.net.ConnectivityManager; import android.net.Uri; import android.os.AsyncTask; @@ -401,7 +400,6 @@ public abstract class XmppActivity extends ActionBarActivity { super.onCreate(savedInstanceState); this.mTheme = findTheme(); setTheme(this.mTheme); - setVolumeControlStream(AudioManager.STREAM_MUSIC); metrics = getResources().getDisplayMetrics(); ExceptionHelper.init(getApplicationContext()); new EmojiService(this).init(getPreferences().getBoolean(USE_BUNDLED_EMOJIS, getResources().getBoolean(R.bool.use_bundled_emoji))); |