Skip to content
Snippets Groups Projects
Commit 8a56d36c authored by Rayan Osseiran's avatar Rayan Osseiran
Browse files

integration: improve share with option for text

Catches issue with sharing vidoe as well.

Change-Id: I1f37a9f0c3e210c2c54f6804b21089aedfb27786
parent 34860abd
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,10 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -31,7 +31,10 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.InflateException;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -122,8 +125,12 @@ public class ShareWithFragment extends Fragment { ...@@ -122,8 +125,12 @@ public class ShareWithFragment extends Fragment {
Uri data = mPendingIntent.getData(); Uri data = mPendingIntent.getData();
if (data == null && clip != null && clip.getItemCount() > 0) if (data == null && clip != null && clip.getItemCount() > 0)
data = clip.getItemAt(0).getUri(); data = clip.getItemAt(0).getUri();
try {
previewVideo.setVideoURI(data); previewVideo.setVideoURI(data);
previewVideo.setVisibility(View.VISIBLE); previewVideo.setVisibility(View.VISIBLE);
} catch (NullPointerException | InflateException | NumberFormatException e) {
Log.e(TAG, e.getMessage());
}
previewVideo.setOnCompletionListener(mediaPlayer -> previewVideo.start()); previewVideo.setOnCompletionListener(mediaPlayer -> previewVideo.start());
} }
} }
......
...@@ -20,19 +20,22 @@ ...@@ -20,19 +20,22 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="#888888" android:focusableInTouchMode="true"
android:elevation="2dp"> android:elevation="2dp">
<EditText <EditText
android:id="@+id/previewText" android:id="@+id/previewText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@null" android:background="@null"
android:maxHeight="@dimen/share_preview_height" android:inputType="textMultiLine"
android:singleLine="false" android:singleLine="false"
android:textColor="@color/text_color_primary_dark" android:textColor="@color/text_color_primary"
android:visibility="gone" android:visibility="gone"
android:inputType="textShortMessage"
tools:text="Test text message" /> tools:text="Test text message" />
<ImageView <ImageView
...@@ -53,6 +56,12 @@ ...@@ -53,6 +56,12 @@
</FrameLayout> </FrameLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/shareList" android:id="@+id/shareList"
android:layout_width="match_parent" android:layout_width="match_parent"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment