aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java39
-rw-r--r--src/main/res/drawable-v21/circle.xml109
-rw-r--r--src/main/res/drawable/circle.xml95
-rw-r--r--src/main/res/layout/activity_fullscreen_message.xml28
-rw-r--r--src/main/res/layout/tool_bar.xml8
5 files changed, 272 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java b/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
index e59df4d28..aa58a673b 100644
--- a/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
@@ -10,6 +10,8 @@ import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
+import android.webkit.MimeTypeMap;
+import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Toast;
@@ -27,11 +29,13 @@ import uk.co.senab.photoview.PhotoViewAttacher;
public class ShowFullscreenMessageActivity extends Activity {
+ private ConversationActivity activity;
PhotoView mImage;
FullscreenVideoLayout mVideo;
ImageView mFullscreenbutton;
Uri mFileUri;
File mFile;
+ ImageButton mFAB;
@Override
@@ -55,6 +59,36 @@ public class ShowFullscreenMessageActivity extends Activity {
mImage = (PhotoView) findViewById(R.id.message_image_view);
mVideo = (FullscreenVideoLayout) findViewById(R.id.message_video_view);
mFullscreenbutton = (ImageView) findViewById(R.id.vcv_img_fullscreen);
+
+ mFAB = (ImageButton) findViewById(R.id.imageButton);
+ mFAB.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mVideo.reset();
+ shareWith(mFileUri);
+ }
+ });
+ }
+
+ private void shareWith(Uri mFileUri) {
+ Intent share = new Intent(Intent.ACTION_SEND);
+ share.setType(getMimeType(mFileUri.toString()));
+ share.putExtra(Intent.EXTRA_STREAM, Uri.parse(mFileUri.toString()));
+ startActivity(Intent.createChooser(share, getString(R.string.share_with)));
+ }
+
+ public static String getMimeType(String path) {
+ try {
+ String type = null;
+ String extension = path.substring(path.lastIndexOf(".") + 1, path.length());
+ if (extension != null) {
+ type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
+ }
+ return type;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
}
@Override
@@ -82,11 +116,6 @@ public class ShowFullscreenMessageActivity extends Activity {
}
}
- @Override
- protected void onPause() {
- super.onPause();
- }
-
private void DisplayImage(File file) {
final PhotoViewAttacher mAttacher = new PhotoViewAttacher(mImage);
mImage.setVisibility(View.VISIBLE);
diff --git a/src/main/res/drawable-v21/circle.xml b/src/main/res/drawable-v21/circle.xml
new file mode 100644
index 000000000..b7d6e348c
--- /dev/null
+++ b/src/main/res/drawable-v21/circle.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:tools="http://schemas.android.com/tools"
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:top="8px">
+ <layer-list>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#08000000" />
+ <padding
+ android:bottom="3px"
+ android:left="3px"
+ android:right="3px"
+ android:top="3px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#09000000" />
+ <padding
+ android:bottom="2px"
+ android:left="2px"
+ android:right="2px"
+ android:top="2px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#10000000" />
+ <padding
+ android:bottom="2px"
+ android:left="2px"
+ android:right="2px"
+ android:top="2px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#11000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#12000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#13000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#14000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#15000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+
+ </layer-list>
+ </item>
+
+ <item>
+ <ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:colorControlHighlight">
+ <item android:id="@android:id/mask">
+ <shape android:shape="oval">
+ <solid android:color="#FFBB00" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="@color/primary" />
+ </shape>
+ </item>
+ </ripple>
+
+ </item>
+
+
+</layer-list> \ No newline at end of file
diff --git a/src/main/res/drawable/circle.xml b/src/main/res/drawable/circle.xml
new file mode 100644
index 000000000..6d4756500
--- /dev/null
+++ b/src/main/res/drawable/circle.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:top="8px">
+ <layer-list>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#08000000" />
+ <padding
+ android:bottom="3px"
+ android:left="3px"
+ android:right="3px"
+ android:top="3px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#09000000" />
+ <padding
+ android:bottom="2px"
+ android:left="2px"
+ android:right="2px"
+ android:top="2px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#10000000" />
+ <padding
+ android:bottom="2px"
+ android:left="2px"
+ android:right="2px"
+ android:top="2px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#11000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#12000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#13000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#14000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="#15000000" />
+ <padding
+ android:bottom="1px"
+ android:left="1px"
+ android:right="1px"
+ android:top="1px" />
+ </shape>
+ </item>
+ </layer-list>
+ </item>
+
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="@color/primary" />
+ </shape>
+ </item>
+
+</layer-list> \ No newline at end of file
diff --git a/src/main/res/layout/activity_fullscreen_message.xml b/src/main/res/layout/activity_fullscreen_message.xml
index 183513196..40f920c4e 100644
--- a/src/main/res/layout/activity_fullscreen_message.xml
+++ b/src/main/res/layout/activity_fullscreen_message.xml
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/black">
+ <include
+ android:id="@+id/toolbar"
+ layout="@layout/tool_bar">
+ </include>
+
<uk.co.senab.photoview.PhotoView
android:id="@id/message_image_view"
android:layout_width="match_parent"
@@ -17,4 +23,22 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
-</LinearLayout> \ No newline at end of file
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:id="@+id/frameLayout">
+
+ <ImageButton
+ android:layout_margin="15dp"
+ android:layout_width="70dp"
+ android:layout_height="70dp"
+ android:src="@drawable/ic_share_white_24dp"
+ android:background="@drawable/circle"
+ android:id="@+id/imageButton"
+ android:layout_gravity="right|top" />
+ </FrameLayout>
+</RelativeLayout> \ No newline at end of file
diff --git a/src/main/res/layout/tool_bar.xml b/src/main/res/layout/tool_bar.xml
new file mode 100644
index 000000000..990a00e03
--- /dev/null
+++ b/src/main/res/layout/tool_bar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/primary"
+ android:elevation="2dp"
+ android:theme="@style/Base.ThemeOverlay.AppCompat.Dark" /> \ No newline at end of file