From 20c031f39e5ecb2d879c19b306f6a0797c1d1fbf Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 11:44:36 +0100 Subject: [PATCH 01/11] Issue with media --- .../android/activities/MediaActivity.java | 15 +++++++-- .../imageeditor/EditImageActivity.java | 18 ++++++----- .../android/ui/drawer/ComposeAdapter.java | 14 +++++---- .../ui/fragment/login/FragmentLoginMain.java | 31 ++++++++++++------- .../settings/FragmentSettingsCategories.java | 11 ++++++- 5 files changed, 62 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index a93697f6..729d5c9d 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -27,6 +27,7 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.util.Log; import android.view.Display; import android.view.Menu; import android.view.MenuItem; @@ -243,9 +244,19 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload int position = binding.mediaViewpager.getCurrentItem(); Attachment attachment = attachments.get(position); if (Build.VERSION.SDK_INT >= 23) { - if (ContextCompat.checkSelfPermission(MediaActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(MediaActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(MediaActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE_MEDIA_SAVE); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(MediaActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(MediaActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(MediaActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE_MEDIA_SAVE); + } else { + if (attachment.type.compareTo("image") == 0) { + MediaHelper.manageMove(MediaActivity.this, attachment.url, false); + } else { + MediaHelper.manageDownloadsNoPopup(MediaActivity.this, attachment.url); + downloadID = -1; + } + } } else { + Log.v(Helper.TAG, "ici"); if (attachment.type.compareTo("image") == 0) { MediaHelper.manageMove(MediaActivity.this, attachment.url, false); } else { diff --git a/app/src/main/java/app/fedilab/android/imageeditor/EditImageActivity.java b/app/src/main/java/app/fedilab/android/imageeditor/EditImageActivity.java index 65c5545e..f0d5ea6b 100644 --- a/app/src/main/java/app/fedilab/android/imageeditor/EditImageActivity.java +++ b/app/src/main/java/app/fedilab/android/imageeditor/EditImageActivity.java @@ -8,6 +8,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Typeface; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.provider.MediaStore; import android.view.MotionEvent; @@ -252,7 +253,7 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList } private void saveImage() { - if (requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { + if (requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) || Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { showLoading(getString(R.string.saving)); File file = new File(path); try { @@ -263,13 +264,16 @@ public class EditImageActivity extends BaseActivity implements OnPhotoEditorList .setClearViewsEnabled(true) .setTransparencyEnabled(true) .build(); - if (ContextCompat.checkSelfPermission(EditImageActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != - PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(EditImageActivity.this, - new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, - STORE_REQUEST); - return; + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (ContextCompat.checkSelfPermission(EditImageActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != + PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(EditImageActivity.this, + new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, + STORE_REQUEST); + return; + } } + mPhotoEditor.saveAsFile(file.getAbsolutePath(), saveSettings, new PhotoEditor.OnSaveListener() { @Override public void onSuccess(@NonNull String imagePath) { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index 75f794be..332bb58e 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -390,12 +390,14 @@ public class ComposeAdapter extends RecyclerView.Adapter { if (isGranted) { - Intent openFileIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT); - openFileIntent.addCategory(Intent.CATEGORY_OPENABLE); - openFileIntent.setType("application/zip"); - String[] mimeTypes = new String[]{"application/zip"}; - openFileIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); - //noinspection deprecation - startActivityForResult( - Intent.createChooser( - openFileIntent, - getString(R.string.load_settings)), PICK_IMPORT); + proceed(); } else { ActivityCompat.requestPermissions(requireActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CODE); } @@ -233,13 +225,30 @@ public class FragmentLoginMain extends Fragment { } }); } else if (itemId == R.id.action_import_data) { - permissionLauncher.launch(Manifest.permission.WRITE_EXTERNAL_STORAGE); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + permissionLauncher.launch(Manifest.permission.WRITE_EXTERNAL_STORAGE); + } else { + proceed(); + } } return false; }); popupMenu.show(); } + private void proceed() { + Intent openFileIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT); + openFileIntent.addCategory(Intent.CATEGORY_OPENABLE); + openFileIntent.setType("application/zip"); + String[] mimeTypes = new String[]{"application/zip"}; + openFileIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); + //noinspection deprecation + startActivityForResult( + Intent.createChooser( + openFileIntent, + getString(R.string.load_settings)), PICK_IMPORT); + } + private void retrievesClientId(String instance) { String oldInstance = instance; if (!instance.startsWith("http://") && !instance.startsWith("https://")) { diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.java index 36d5b60e..eb11a00b 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.java @@ -18,6 +18,7 @@ import android.Manifest; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; +import android.os.Build; import android.os.Bundle; import android.webkit.URLUtil; import android.widget.Toast; @@ -135,7 +136,15 @@ public class FragmentSettingsCategories extends PreferenceFragmentCompat { Preference pref_export_settings = findPreference(getString(R.string.pref_export_settings)); if (pref_export_settings != null) { pref_export_settings.setOnPreferenceClickListener(preference -> { - permissionLauncher.launch(Manifest.permission.WRITE_EXTERNAL_STORAGE); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + permissionLauncher.launch(Manifest.permission.WRITE_EXTERNAL_STORAGE); + } else { + try { + ZipHelper.exportData(requireActivity()); + } catch (IOException e) { + e.printStackTrace(); + } + } return false; }); } From 2c48032127649b6d2070606d80424dd5b267fc91 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 11:58:53 +0100 Subject: [PATCH 02/11] Request notification for Android 13+ --- .../java/app/fedilab/android/BaseMainActivity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index cffdb745..331add50 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -21,6 +21,7 @@ import static app.fedilab.android.helper.Helper.PREF_USER_TOKEN; import static app.fedilab.android.helper.Helper.displayReleaseNotesIfNeeded; import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction; +import android.Manifest; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.Context; @@ -51,12 +52,15 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; +import androidx.activity.result.ActivityResultLauncher; +import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.SearchView; +import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityOptionsCompat; import androidx.core.view.GravityCompat; import androidx.fragment.app.Fragment; @@ -290,6 +294,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt }; private NetworkStateReceiver networkStateReceiver; private boolean headerMenuOpen; + private static final int REQUEST_CODE = 5415; @Override protected void onCreate(Bundle savedInstanceState) { @@ -304,6 +309,15 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } else { BaseMainActivity.currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null); } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + ActivityResultLauncher permissionLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { + if (!isGranted) { + ActivityCompat.requestPermissions(BaseMainActivity.this, new String[]{Manifest.permission.POST_NOTIFICATIONS}, REQUEST_CODE); + } + }); + permissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); + } filteredAccounts = new ArrayList<>(); mamageNewIntent(getIntent()); filterFetched = false; From 00009707b2a642f0aa51fcc25fc5f6c4fd66be99 Mon Sep 17 00:00:00 2001 From: Paulo Marinho Date: Wed, 28 Dec 2022 12:51:00 +0100 Subject: [PATCH 03/11] Translated using Weblate (Portuguese) Currently translated at 7.8% (5 of 64 strings) Co-authored-by: Paulo Marinho Translate-URL: https://hosted.weblate.org/projects/fedilab/description/pt/ Translation: Fedilab/description --- src/fdroid/fastlane/metadata/android/pt/changelogs/390.txt | 5 +++++ src/fdroid/fastlane/metadata/android/pt/changelogs/393.txt | 3 +++ src/fdroid/fastlane/metadata/android/pt/changelogs/394.txt | 1 + 3 files changed, 9 insertions(+) create mode 100644 src/fdroid/fastlane/metadata/android/pt/changelogs/390.txt create mode 100644 src/fdroid/fastlane/metadata/android/pt/changelogs/393.txt create mode 100644 src/fdroid/fastlane/metadata/android/pt/changelogs/394.txt diff --git a/src/fdroid/fastlane/metadata/android/pt/changelogs/390.txt b/src/fdroid/fastlane/metadata/android/pt/changelogs/390.txt new file mode 100644 index 00000000..e5ce13b8 --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/pt/changelogs/390.txt @@ -0,0 +1,5 @@ +Nova versão do Fedilab com nova funcionalidade. +- Agora é possível compor threads +- Vê o thread completo ao responder +- Suporte de cache +- Novo design diff --git a/src/fdroid/fastlane/metadata/android/pt/changelogs/393.txt b/src/fdroid/fastlane/metadata/android/pt/changelogs/393.txt new file mode 100644 index 00000000..88a074ca --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/pt/changelogs/393.txt @@ -0,0 +1,3 @@ +- Algumas correcções de bugs + +- Melhorar as linhas de tempo fixadas diff --git a/src/fdroid/fastlane/metadata/android/pt/changelogs/394.txt b/src/fdroid/fastlane/metadata/android/pt/changelogs/394.txt new file mode 100644 index 00000000..a833e934 --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/pt/changelogs/394.txt @@ -0,0 +1 @@ +‐ Correcção de crashes para algumas instâncias do pleroma From fc4e7fddbe6a820054c6be5a92f1f1666da79585 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 15:01:25 +0100 Subject: [PATCH 04/11] Fix DeepL pro URL --- .../java/app/fedilab/android/activities/MediaActivity.java | 2 -- .../main/java/app/fedilab/android/helper/TranslateHelper.java | 4 +++- .../java/com/github/stom79/mytransl/translate/Helper.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index 729d5c9d..66dcb5b9 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -27,7 +27,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.Display; import android.view.Menu; import android.view.MenuItem; @@ -256,7 +255,6 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload } } } else { - Log.v(Helper.TAG, "ici"); if (attachment.type.compareTo("image") == 0) { MediaHelper.manageMove(MediaActivity.this, attachment.url, false); } else { diff --git a/app/src/main/java/app/fedilab/android/helper/TranslateHelper.java b/app/src/main/java/app/fedilab/android/helper/TranslateHelper.java index 2edbb8ac..2876feea 100644 --- a/app/src/main/java/app/fedilab/android/helper/TranslateHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/TranslateHelper.java @@ -58,7 +58,9 @@ public class TranslateHelper { String translatorVersion = sharedpreferences.getString(context.getString(R.string.SET_TRANSLATOR_VERSION), "PRO"); params.setPro(translatorVersion.equals("PRO")); String apikey = sharedpreferences.getString(context.getString(R.string.SET_TRANSLATOR_API_KEY), null); - myTransL.setDeeplAPIKey(apikey.trim()); + if (apikey != null) { + myTransL.setDeeplAPIKey(apikey.trim()); + } } String translate = sharedpreferences.getString(context.getString(R.string.SET_LIVE_TRANSLATE), MyTransL.getLocale()); diff --git a/mytransl/src/main/java/com/github/stom79/mytransl/translate/Helper.java b/mytransl/src/main/java/com/github/stom79/mytransl/translate/Helper.java index 2b27c86b..5376d3cf 100644 --- a/mytransl/src/main/java/com/github/stom79/mytransl/translate/Helper.java +++ b/mytransl/src/main/java/com/github/stom79/mytransl/translate/Helper.java @@ -28,7 +28,7 @@ public class Helper { private static final String YANDEX_BASE_URL = "https://translate.yandex.net/api/v1.5/tr.json/translate?"; - private static final String DEEPL_BASE_URL = "https://free.deepl.com/v2/translate?"; + private static final String DEEPL_BASE_URL = "https://api.deepl.com/v2/translate?"; private static final String DEEPL_BASE_FREE_URL = "https://api-free.deepl.com/v2/translate?"; private static final String SYSTRAN_BASE_URL = "https://api-platform.systran.net/translation/text/translate?"; private static final String[] deeplAvailableLang = {"EN", "DE", "FR", "ES", "IT", "NL", "PL"}; From b6c908b24915503e9258b18c9dc95c86153cee79 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 15:01:58 +0100 Subject: [PATCH 05/11] Release notes --- .../fastlane/metadata/android/en/changelogs/456.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/fdroid/fastlane/metadata/android/en/changelogs/456.txt diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt new file mode 100644 index 00000000..bab35172 --- /dev/null +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt @@ -0,0 +1,10 @@ +Added: + + +Changed: + + +Fixed: +- Issue with Media for Android 11+ +- Crash when not setting a translation key +- Fix DeepL for API pro \ No newline at end of file From a7cc493922af68c549b89767aa1e08273b64e1c1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 15:10:23 +0100 Subject: [PATCH 06/11] Fix issue #690 - Crash when visiting a profile with a lot of media --- .../java/app/fedilab/android/ui/drawer/ImageAdapter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java index 1497f97d..41d48218 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java @@ -78,11 +78,9 @@ public class ImageAdapter extends RecyclerView.Adapter holder.binding.media.setOnClickListener(v -> { Intent mediaIntent = new Intent(context, MediaActivity.class); Bundle b = new Bundle(); - b.putInt(Helper.ARG_MEDIA_POSITION, position + 1); + b.putInt(Helper.ARG_MEDIA_POSITION, 1); ArrayList attachmentsTmp = new ArrayList<>(); - for (Status status1 : statuses) { - attachmentsTmp.add(status1.art_attachment); - } + attachmentsTmp.add(status.art_attachment); b.putSerializable(Helper.ARG_STATUS, status); b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(attachmentsTmp)); mediaIntent.putExtras(b); From 3e16d0c3100925078413282737a60212a731addb Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 15:36:39 +0100 Subject: [PATCH 07/11] Fix issue #694 - Home muted not working with no filters --- .../main/java/app/fedilab/android/helper/TimelineHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/helper/TimelineHelper.java b/app/src/main/java/app/fedilab/android/helper/TimelineHelper.java index 6c94cf29..42bfc8f4 100644 --- a/app/src/main/java/app/fedilab/android/helper/TimelineHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/TimelineHelper.java @@ -156,7 +156,8 @@ public class TimelineHelper { } } } - + } + if (statuses != null && statuses.size() > 0) { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); boolean groupReblogs = sharedpreferences.getBoolean(context.getString(R.string.SET_GROUP_REBLOGS), true); if (filterTimeLineType == Timeline.TimeLineEnum.HOME) { @@ -172,6 +173,7 @@ public class TimelineHelper { filterCustom.title = "Fedilab"; filterCustom.context = contextCustom; statuses.get(i).filteredByApp = filterCustom; + break; } } } From b72964c8516bd20e27d471e58bd4de06d2033ede Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 16:20:14 +0100 Subject: [PATCH 08/11] Fix emoji not displayed --- app/build.gradle | 2 +- .../app/fedilab/android/helper/CustomEmoji.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 566df8e7..b4602f0e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -109,7 +109,7 @@ dependencies { implementation("com.vanniktech:android-image-cropper:4.3.3") annotationProcessor "com.github.bumptech.glide:compiler:4.12.0" implementation 'jp.wasabeef:glide-transformations:4.3.0' - implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.24.0' + implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0' implementation 'com.google.android.exoplayer:exoplayer:2.18.1' implementation "androidx.viewpager2:viewpager2:1.0.0" implementation 'com.github.piasy:rxandroidaudio:1.7.0' diff --git a/app/src/main/java/app/fedilab/android/helper/CustomEmoji.java b/app/src/main/java/app/fedilab/android/helper/CustomEmoji.java index f121afc1..f7689766 100644 --- a/app/src/main/java/app/fedilab/android/helper/CustomEmoji.java +++ b/app/src/main/java/app/fedilab/android/helper/CustomEmoji.java @@ -94,28 +94,29 @@ public class CustomEmoji extends ReplacementSpan { @Override public void onResourceReady(@NonNull Drawable resource, @Nullable Transition transition) { View view = viewWeakReference.get(); + if (animate && resource instanceof Animatable) { - Drawable.Callback callback = resource.getCallback(); + Drawable.Callback drawableCallBack = resource.getCallback(); resource.setCallback(new Drawable.Callback() { @Override public void invalidateDrawable(@NonNull Drawable drawable) { - if (callback != null) { - callback.invalidateDrawable(drawable); + if (drawableCallBack != null) { + drawableCallBack.invalidateDrawable(drawable); } view.invalidate(); } @Override public void scheduleDrawable(@NonNull Drawable drawable, @NonNull Runnable runnable, long l) { - if (callback != null) { - callback.scheduleDrawable(drawable, runnable, l); + if (drawableCallBack != null) { + drawableCallBack.scheduleDrawable(drawable, runnable, l); } } @Override public void unscheduleDrawable(@NonNull Drawable drawable, @NonNull Runnable runnable) { - if (callback != null) { - callback.unscheduleDrawable(drawable, runnable); + if (drawableCallBack != null) { + drawableCallBack.unscheduleDrawable(drawable, runnable); } } }); From 639641c80a435894e8e6100f0c485ac75ead2700 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 16:21:26 +0100 Subject: [PATCH 09/11] Release notes --- .../fastlane/metadata/android/en/changelogs/456.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt index bab35172..4ae2a28b 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt @@ -1,10 +1,7 @@ -Added: - - -Changed: - - Fixed: - Issue with Media for Android 11+ - Crash when not setting a translation key -- Fix DeepL for API pro \ No newline at end of file +- Fix DeepL for API pro +- Crash when visiting a profile with a lot of media +- Home muted accounts not working without filters +- Animated custom emoji not displayed \ No newline at end of file From 07d358fa91376e7d91bae261688c511b9ee8c199 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 17:53:16 +0100 Subject: [PATCH 10/11] Fix issue #682 - Smaller size when media are hidden with fit preview images --- .../app/fedilab/android/ui/drawer/StatusAdapter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index f0be81cc..be9a5c3d 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -1201,7 +1201,7 @@ public class StatusAdapter extends RecyclerView.Adapter boolean singleMedia = statusToDeal.media_attachments.size() == 1; for (Attachment attachment : statusToDeal.media_attachments) { LayoutMediaBinding layoutMediaBinding = LayoutMediaBinding.inflate(LayoutInflater.from(context)); - if (fullAttachement) { + if (fullAttachement && !statusToDeal.sensitive) { float ratio = 1.0f; float mediaH = -1.0f; @@ -1240,13 +1240,13 @@ public class StatusAdapter extends RecyclerView.Adapter loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, -1.f, -1.f, -1.f, statusToDeal, attachment, singleMedia); } mediaPosition++; - if (fullAttachement || singleMedia) { + if ((fullAttachement && !statusToDeal.sensitive) || singleMedia) { holder.binding.mediaContainer.addView(layoutMediaBinding.getRoot()); } else { holder.binding.attachmentsList.addView(layoutMediaBinding.getRoot()); } } - if (!fullAttachement && !singleMedia) { + if ((!fullAttachement || statusToDeal.sensitive) && !singleMedia) { holder.binding.mediaContainer.setVisibility(View.GONE); holder.binding.attachmentsListContainer.setVisibility(View.VISIBLE); } else { @@ -2018,7 +2018,7 @@ public class StatusAdapter extends RecyclerView.Adapter boolean expand_media = sharedpreferences.getBoolean(context.getString(R.string.SET_EXPAND_MEDIA), false); LinearLayout.LayoutParams lp; - if (fullAttachement && mediaH > 0) { + if (fullAttachement && mediaH > 0 && !statusToDeal.sensitive) { lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, (int) (mediaH * ratio)); layoutMediaBinding.media.setScaleType(ImageView.ScaleType.FIT_CENTER); } else { @@ -2040,7 +2040,7 @@ public class StatusAdapter extends RecyclerView.Adapter focusY = statusToDeal.media_attachments.get(0).meta.focus.y; } layoutMediaBinding.count.setVisibility(View.VISIBLE); - if (!fullAttachement && !singleImage) { + if ((!fullAttachement || statusToDeal.sensitive) && !singleImage) { layoutMediaBinding.count.setText(String.format(Locale.getDefault(), "%d/%d", mediaPosition, statusToDeal.media_attachments.size())); } String finalUrl; @@ -2132,7 +2132,7 @@ public class StatusAdapter extends RecyclerView.Adapter adapter.notifyItemChanged(holder.getBindingAdapterPosition()); }); - if (fullAttachement || singleImage) { + if (!statusToDeal.sensitive && (fullAttachement || singleImage)) { layoutMediaBinding.getRoot().setPadding(0, 0, 0, 10); } else { layoutMediaBinding.getRoot().setPadding(0, 0, 10, 0); From 05a7ac4081ea549266e52850801664015593e20b Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 18:01:31 +0100 Subject: [PATCH 11/11] Release 3.13.2 --- app/build.gradle | 4 ++-- app/src/main/assets/release_notes/notes.json | 5 +++++ src/fdroid/fastlane/metadata/android/en/changelogs/456.txt | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b4602f0e..fcda7ec4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 21 targetSdk 33 - versionCode 455 - versionName "3.13.1" + versionCode 456 + versionName "3.13.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } flavorDimensions "default" diff --git a/app/src/main/assets/release_notes/notes.json b/app/src/main/assets/release_notes/notes.json index 2d2d1bba..b1e4195b 100644 --- a/app/src/main/assets/release_notes/notes.json +++ b/app/src/main/assets/release_notes/notes.json @@ -1,4 +1,9 @@ [ + { + "version": "3.13.2", + "code": "456", + "note": "Changed:\n- Hidden media smaller with preview images\n\nFixed:\n- Issue with Media for Android 11+\n- Crash when not setting a translation key\n- Fix DeepL for API pro\n- Crash when visiting a profile with a lot of media\n- Home muted accounts not working without filters\n- Animated custom emoji not displayed" + }, { "version": "3.13.1", "code": "455", diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt index 4ae2a28b..4ac4f10f 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/456.txt @@ -1,3 +1,6 @@ +Changed: +- Hidden media smaller with preview images + Fixed: - Issue with Media for Android 11+ - Crash when not setting a translation key