Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
196
Merge Requests
13
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Compare Revisions
83e162007d8b09e51297dce52daae9a68fcc6e0c...3f572f78f08c0bcec660381938b788f2eaa3f9bd
Source
3f572f78f08c0bcec660381938b788f2eaa3f9bd
...
Target
83e162007d8b09e51297dce52daae9a68fcc6e0c
Compare
Commits (2)
Copy link when user longpress a preview image
· 88e04796
Juan Manuel Solaro
authored
12 minutes ago
88e04796
Merge branch 'copy-link-on-image-longpress' into 'release/3.16.0'
· 3f572f78
Brian Hatchet
authored
12 minutes ago
Copy link when user longpress a preview image See merge request
!519
3f572f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
locales/en.json
View file @
3f572f78
...
...
@@ -796,5 +796,6 @@
"requests"
:
"Requests"
,
"notAllowed"
:
"You are not allowed"
,
"undo"
:
"Undo"
,
"validate"
:
"VALIDATE"
"validate"
:
"VALIDATE"
,
"linkCopied"
:
"Link copied to clipboard"
}
This diff is collapsed.
src/common/components/MediaView.js
View file @
3f572f78
...
...
@@ -20,6 +20,7 @@ import {
View
,
Dimensions
,
Linking
,
Clipboard
,
}
from
'
react-native
'
;
import
ExplicitImage
from
'
./explicit/ExplicitImage
'
...
...
@@ -36,6 +37,8 @@ import logService from '../services/log.service';
import
testID
from
'
../helpers/testID
'
;
import
i18n
from
'
../services/i18n.service
'
;
import
api
from
'
../services/api.service
'
;
import
{
showMessage
}
from
'
react-native-flash-message
'
;
import
Colors
from
'
../../styles/Colors
'
;
/**
* Activity
...
...
@@ -144,6 +147,25 @@ export default class MediaView extends Component {
this
.
setState
({
imageLoadFailed
:
true
});
}
imageLongPress
=
()
=>
{
if
(
this
.
props
.
entity
.
perma_url
)
{
setTimeout
(
async
()
=>
{
await
Clipboard
.
setString
(
this
.
props
.
entity
.
perma_url
);
showMessage
({
floating
:
true
,
position
:
'
top
'
,
message
:
i18n
.
t
(
'
linkCopied
'
),
duration
:
1300
,
backgroundColor
:
'
#FFDD63DD
'
,
color
:
Colors
.
dark
,
type
:
'
info
'
,
});
},
100
);
}
else
{
this
.
download
();
}
};
/**
* Get image with autoheight or Touchable fixed height
* @param {object} source
...
...
@@ -188,7 +210,7 @@ export default class MediaView extends Component {
return
(
<
TouchableOpacity
onPress
=
{
this
.
navToImage
}
onLongPress
=
{
this
.
download
}
onLongPress
=
{
this
.
imageLongPress
}
style
=
{[
styles
.
imageContainer
,
{
height
}]}
activeOpacity
=
{
1
}
{...
testID
(
'
Posted Image
'
)}
...
...
@@ -208,7 +230,7 @@ export default class MediaView extends Component {
return
autoHeight
?
(
<
TouchableOpacity
onPress
=
{
this
.
navToImage
}
onLongPress
=
{
this
.
download
}
onLongPress
=
{
this
.
imageLongPress
}
style
=
{
styles
.
imageContainer
}
activeOpacity
=
{
0.8
}
>
...
...
@@ -220,7 +242,7 @@ export default class MediaView extends Component {
)
:
(
<
TouchableOpacity
onPress
=
{
this
.
navToImage
}
onLongPress
=
{
this
.
download
}
onLongPress
=
{
this
.
imageLongPress
}
style
=
{[
styles
.
imageContainer
,
{
minHeight
:
200
}]}
activeOpacity
=
{
0.8
}
>
...
...
This diff is collapsed.