diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2b42c3ce3b..9ecede95d9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionCode="222"
android:versionName="3.25.4">
-
+
0) {
+ mediaListener.onMediaSelected(inputContentInfo.getContentUri(),
+ inputContentInfo.getDescription().getMimeType(0));
+
+ return true;
+ }
+
+ return false;
+ }
+ }
+
}
diff --git a/src/org/thoughtcrime/securesms/components/InputPanel.java b/src/org/thoughtcrime/securesms/components/InputPanel.java
index 1067a05089..f7a07c88ee 100644
--- a/src/org/thoughtcrime/securesms/components/InputPanel.java
+++ b/src/org/thoughtcrime/securesms/components/InputPanel.java
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.components;
import android.annotation.TargetApi;
import android.content.Context;
+import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.NonNull;
@@ -32,14 +33,17 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
public class InputPanel extends LinearLayout
- implements MicrophoneRecorderView.Listener, KeyboardAwareLinearLayout.OnKeyboardShownListener, EmojiDrawer.EmojiEventListener {
+ implements MicrophoneRecorderView.Listener,
+ KeyboardAwareLinearLayout.OnKeyboardShownListener,
+ EmojiDrawer.EmojiEventListener
+{
private static final String TAG = InputPanel.class.getSimpleName();
private static final int FADE_TIME = 150;
private EmojiToggle emojiToggle;
- private EmojiEditText composeText;
+ private ComposeText composeText;
private View quickCameraToggle;
private View quickAudioToggle;
private View buttonToggle;
@@ -106,6 +110,10 @@ public class InputPanel extends LinearLayout
});
}
+ public void setMediaListener(@NonNull MediaListener listener) {
+ composeText.setMediaListener(listener);
+ }
+
@Override
public void onRecordPressed(float startPositionX) {
if (listener != null) listener.onRecorderStarted();
@@ -300,4 +308,8 @@ public class InputPanel extends LinearLayout
}
}
}
+
+ public interface MediaListener {
+ public void onMediaSelected(@NonNull Uri uri, String contentType);
+ }
}