Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental: use the Android Sharelist instead of IITC custom chooser #261

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public static Intent forFile(final Context context, final File file, final Strin
final Uri uri = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
? FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file)
: Uri.fromFile(file);
return new Intent(context, ShareActivity.class)
.putExtra(EXTRA_TYPE, TYPE_FILE)
.putExtra("uri", uri)
.putExtra("type", type)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Intent shareIntent = new Intent().setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_STREAM, uri)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType(type);
String title = context.getString(R.string.send_to);
return Intent.createChooser(shareIntent, title);
}

public static Intent forPosition(final Context context, final double lat, final double lng, final int zoom,
Expand Down
1 change: 1 addition & 0 deletions mobile/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,6 @@
<b>Be careful:</b> Javascript from external sources may contain harmful code (spyware etc.)!<br><br>
Are you sure you want to proceed?]]>
</string>
<string name="send_to">Send to...</string>

</resources>