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(
file_name.text = data.attachmentTitle
image_attachment.setOnClickListener {
ImageHelper.openImage(
it.context,
context,
data.attachmentUrl,
data.attachmentTitle.toString()
)
......
......@@ -94,17 +94,13 @@ class FilesFragment : Fragment(), FilesView {
override fun playMedia(url: String) {
ui {
activity?.let {
PlayerActivity.play(it, url)
}
}
}
override fun openImage(url: String, name: String) {
ui {
activity?.let {
ImageHelper.openImage(it, url, name)
}
ImageHelper.openImage(root_layout.context, url, name)
}
}
......
......@@ -53,7 +53,6 @@ object ImageHelper {
)
val toolbar = Toolbar(context).also {
it.inflateMenu(R.menu.image_actions)
it.overflowIcon?.setTint(Color.WHITE)
it.setOnMenuItemClickListener {
return@setOnMenuItemClickListener when (it.itemId) {
R.id.action_save_image -> saveImage(context)
......@@ -109,7 +108,6 @@ object ImageHelper {
.hideStatusBar(false)
.setCustomDraweeControllerBuilder(builder)
.show()
}
private fun saveImage(context: Context): Boolean {
......@@ -166,5 +164,4 @@ object ImageHelper {
)
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
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