Skip to content

Commit

Permalink
fix(b9efdbb): adapt the ComposeFragment's take picture button to that…
Browse files Browse the repository at this point in the history
… commit
  • Loading branch information
LucasGGamerM committed Jul 15, 2024
1 parent b9efdbb commit 86512e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.joinmastodon.android.E;
import org.joinmastodon.android.GlobalUserPreferences;
import org.joinmastodon.android.R;
import org.joinmastodon.android.TweakedFileProvider;
import org.joinmastodon.android.api.MastodonErrorResponse;
import org.joinmastodon.android.api.requests.statuses.CreateStatus;
import org.joinmastodon.android.api.requests.statuses.DeleteStatus;
Expand Down Expand Up @@ -98,7 +99,6 @@
import org.joinmastodon.android.ui.text.ComposeHashtagOrMentionSpan;
import org.joinmastodon.android.ui.text.HtmlParser;
import org.joinmastodon.android.ui.utils.SimpleTextWatcher;
import org.joinmastodon.android.utils.FileProvider;
import org.joinmastodon.android.utils.TransferSpeedTracker;
import org.joinmastodon.android.ui.utils.UiUtils;
import org.joinmastodon.android.ui.viewcontrollers.ComposeAutocompleteViewController;
Expand Down Expand Up @@ -1505,7 +1505,7 @@ public void onTakePictureRequest(TakePictureRequestEvent ev) {
private void openCamera() throws IOException {
if (getContext().checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
File photoFile = File.createTempFile("img", ".jpg");
photoUri = FileProvider.getUriForFile(getContext(), getContext().getPackageName() + ".fileprovider", photoFile);
photoUri = UiUtils.getFileProviderUri(getContext(), photoFile);

Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
Expand Down
7 changes: 0 additions & 7 deletions mastodon/src/main/res/xml/file_paths.xml

This file was deleted.

3 changes: 3 additions & 0 deletions mastodon/src/main/res/xml/fileprovider_paths.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<cache-path name="image_cache" path="images/"/>
<cache-path
name="pictures_taken_through_compose"
path="."/>
</paths>

0 comments on commit 86512e2

Please sign in to comment.