Unverified Commit 75719076 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #1318 from RocketChat/fix/download-button

[FIX] Download button.
parents df033e7d 234f1a7c
...@@ -30,7 +30,7 @@ class ImageAttachmentViewHolder( ...@@ -30,7 +30,7 @@ class ImageAttachmentViewHolder(
file_name.text = data.attachmentTitle file_name.text = data.attachmentTitle
image_attachment.setOnClickListener { image_attachment.setOnClickListener {
ImageHelper.openImage( ImageHelper.openImage(
it.context, context,
data.attachmentUrl, data.attachmentUrl,
data.attachmentTitle.toString() data.attachmentTitle.toString()
) )
......
...@@ -94,17 +94,13 @@ class FilesFragment : Fragment(), FilesView { ...@@ -94,17 +94,13 @@ class FilesFragment : Fragment(), FilesView {
override fun playMedia(url: String) { override fun playMedia(url: String) {
ui { ui {
activity?.let {
PlayerActivity.play(it, url) PlayerActivity.play(it, url)
} }
} }
}
override fun openImage(url: String, name: String) { override fun openImage(url: String, name: String) {
ui { ui {
activity?.let { ImageHelper.openImage(root_layout.context, url, name)
ImageHelper.openImage(it, url, name)
}
} }
} }
......
...@@ -53,7 +53,6 @@ object ImageHelper { ...@@ -53,7 +53,6 @@ object ImageHelper {
) )
val toolbar = Toolbar(context).also { val toolbar = Toolbar(context).also {
it.inflateMenu(R.menu.image_actions) it.inflateMenu(R.menu.image_actions)
it.overflowIcon?.setTint(Color.WHITE)
it.setOnMenuItemClickListener { it.setOnMenuItemClickListener {
return@setOnMenuItemClickListener when (it.itemId) { return@setOnMenuItemClickListener when (it.itemId) {
R.id.action_save_image -> saveImage(context) R.id.action_save_image -> saveImage(context)
...@@ -109,7 +108,6 @@ object ImageHelper { ...@@ -109,7 +108,6 @@ object ImageHelper {
.hideStatusBar(false) .hideStatusBar(false)
.setCustomDraweeControllerBuilder(builder) .setCustomDraweeControllerBuilder(builder)
.show() .show()
} }
private fun saveImage(context: Context): Boolean { private fun saveImage(context: Context): Boolean {
...@@ -166,5 +164,4 @@ object ImageHelper { ...@@ -166,5 +164,4 @@ object ImageHelper {
) )
} }
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".files.ui.FilesFragment"> tools:context=".files.ui.FilesFragment">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment