Merge pull request #458 from FineFindus/feat/share-profile-picture

fix: show profile picture in share sheet
This commit is contained in:
LucasGGamerM 2024-07-15 17:16:11 -03:00 committed by GitHub
commit b9efdbbb40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 12 deletions

View File

@ -105,16 +105,6 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<provider
android:name="org.joinmastodon.android.utils.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<provider <provider
android:authorities="${applicationId}.fileprovider" android:authorities="${applicationId}.fileprovider"
android:name=".TweakedFileProvider" android:name=".TweakedFileProvider"

View File

@ -1765,9 +1765,9 @@ public class UiUtils {
ImageCache cache=ImageCache.getInstance(context); ImageCache cache=ImageCache.getInstance(context);
try{ try{
File ava=cache.getFile(new UrlImageLoaderRequest(account.avatarStatic)); File ava=cache.getFile(new UrlImageLoaderRequest(account.avatarStatic));
if(!ava.exists()) if(ava==null || !ava.exists())
ava=cache.getFile(new UrlImageLoaderRequest(account.avatar)); ava=cache.getFile(new UrlImageLoaderRequest(account.avatar));
if(ava.exists()){ if(ava!=null && ava.exists()){
intent.setClipData(ClipData.newRawUri(null, getFileProviderUri(context, ava))); intent.setClipData(ClipData.newRawUri(null, getFileProviderUri(context, ava)));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
} }