mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
fix sharing videos
This commit is contained in:
parent
ba76a4a215
commit
29273fb4fa
1 changed files with 10 additions and 2 deletions
|
@ -119,10 +119,14 @@ public class ViewPagerActivity extends AppCompatActivity
|
||||||
private void shareMedium() {
|
private void shareMedium() {
|
||||||
final String shareTitle = getResources().getString(R.string.share_via);
|
final String shareTitle = getResources().getString(R.string.share_via);
|
||||||
final Intent sendIntent = new Intent();
|
final Intent sendIntent = new Intent();
|
||||||
|
final Medium medium = getCurrentMedium();
|
||||||
final File file = getCurrentFile();
|
final File file = getCurrentFile();
|
||||||
final Uri uri = Uri.fromFile(file);
|
final Uri uri = Uri.fromFile(file);
|
||||||
sendIntent.setAction(Intent.ACTION_SEND);
|
sendIntent.setAction(Intent.ACTION_SEND);
|
||||||
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
|
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||||
|
if (medium.getIsVideo())
|
||||||
|
sendIntent.setType("video/*");
|
||||||
|
else
|
||||||
sendIntent.setType("image/*");
|
sendIntent.setType("image/*");
|
||||||
startActivity(Intent.createChooser(sendIntent, shareTitle));
|
startActivity(Intent.createChooser(sendIntent, shareTitle));
|
||||||
}
|
}
|
||||||
|
@ -316,8 +320,12 @@ public class ViewPagerActivity extends AppCompatActivity
|
||||||
setTitle(Utils.getFilename(media.get(pager.getCurrentItem()).getPath()));
|
setTitle(Utils.getFilename(media.get(pager.getCurrentItem()).getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Medium getCurrentMedium() {
|
||||||
|
return media.get(pos);
|
||||||
|
}
|
||||||
|
|
||||||
private File getCurrentFile() {
|
private File getCurrentFile() {
|
||||||
return new File(media.get(pos).getPath());
|
return new File(getCurrentMedium().getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUndoMargin() {
|
private void addUndoMargin() {
|
||||||
|
|
Loading…
Reference in a new issue