|
|
|
@ -19,6 +19,8 @@ import android.Manifest |
|
|
|
|
import android.animation.Animator |
|
|
|
|
import android.animation.AnimatorListenerAdapter |
|
|
|
|
import android.app.DownloadManager |
|
|
|
|
import android.content.ClipData |
|
|
|
|
import android.content.ClipboardManager |
|
|
|
|
import android.content.Context |
|
|
|
|
import android.content.Intent |
|
|
|
|
import android.content.pm.PackageManager |
|
|
|
@ -143,6 +145,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener |
|
|
|
|
R.id.action_download -> downloadMedia() |
|
|
|
|
R.id.action_open_status -> onOpenStatus() |
|
|
|
|
R.id.action_share_media -> shareMedia() |
|
|
|
|
R.id.action_copy_media_link -> copyLink() |
|
|
|
|
} |
|
|
|
|
true |
|
|
|
|
} |
|
|
|
@ -224,6 +227,11 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener |
|
|
|
|
startActivityWithSlideInAnimation(ViewThreadActivity.startIntent(this, attach.statusId, attach.statusUrl)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun copyLink() { |
|
|
|
|
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager |
|
|
|
|
clipboard.primaryClip = ClipData.newPlainText(null, attachments!![viewPager.currentItem].attachment.url) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun shareMedia() { |
|
|
|
|
val directory = applicationContext.getExternalFilesDir("Tusky") |
|
|
|
|
if (directory == null || !(directory.exists())) { |
|
|
|
|