diff --git a/app/build.gradle b/app/build.gradle index 1ad481d4..5efca00f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 21 targetSdk 33 - versionCode 460 - versionName "3.13.6" + versionCode 461 + versionName "3.13.7" 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 e8fc6545..35d084d4 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.7", + "code": "461", + "note": "Added:\n- Pixelfed: Custom layout to display Media fully \n*(Settings > Timelines > Pixelfed Presentation) - Also works for other softwares when there are media\n\nChanged:\n- Add pinned tag in \"any\" to avoid to lose it when renaming timeline\n\nFixed:\n- Fix push notifications with several accounts\n- Fix quotes with tags/mentions\n- Fix notifications\n- Fix sending multiple media\n- Some crashes" + }, { "version": "3.13.6", "code": "460", 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 37695146..45bf4949 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 @@ -195,6 +195,9 @@ public class StatusAdapter extends RecyclerView.Adapter private static boolean isVisiblePixelfed(Status status) { + if (status.reblog != null) { + status = status.reblog; + } return status.media_attachments != null && status.media_attachments.size() > 0; } @@ -2606,24 +2609,33 @@ public class StatusAdapter extends RecyclerView.Adapter context.startActivity(intent); }); } else if (viewHolder.getItemViewType() == STATUS_PIXELFED) { + Status statusToDeal = status.reblog != null ? status.reblog : status; StatusViewHolder holder = (StatusViewHolder) viewHolder; - MastodonHelper.loadPPMastodon(holder.bindingPixelfed.artPp, status.account); - SliderAdapter adapter = new SliderAdapter(status); + + if (status.reblog != null) { + MastodonHelper.loadPPMastodon(holder.bindingPixelfed.artReblogPp, status.account); + holder.bindingPixelfed.artReblogPp.setVisibility(View.VISIBLE); + } else { + holder.bindingPixelfed.artReblogPp.setVisibility(View.GONE); + } + + MastodonHelper.loadPPMastodon(holder.bindingPixelfed.artPp, statusToDeal.account); + SliderAdapter adapter = new SliderAdapter(statusToDeal); holder.bindingPixelfed.artMedia.setSliderAdapter(adapter); holder.bindingPixelfed.artMedia.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION); holder.bindingPixelfed.artMedia.setAutoCycleDirection(SliderView.AUTO_CYCLE_DIRECTION_BACK_AND_FORTH); holder.bindingPixelfed.artMedia.setScrollTimeInSec(4); holder.bindingPixelfed.artMedia.startAutoCycle(); - holder.bindingPixelfed.commentNumber.setText(String.valueOf(status.replies_count)); + holder.bindingPixelfed.commentNumber.setText(String.valueOf(statusToDeal.replies_count)); holder.bindingPixelfed.artUsername.setText( - status.account.getSpanDisplayName(context, + statusToDeal.account.getSpanDisplayName(context, new WeakReference<>(holder.bindingPixelfed.artUsername)), TextView.BufferType.SPANNABLE); - holder.bindingPixelfed.artAcct.setText(String.format(Locale.getDefault(), "@%s", status.account.acct)); + holder.bindingPixelfed.artAcct.setText(String.format(Locale.getDefault(), "@%s", statusToDeal.account.acct)); holder.bindingPixelfed.artPp.setOnClickListener(v -> { Intent intent = new Intent(context, ProfileActivity.class); Bundle b = new Bundle(); - b.putSerializable(Helper.ARG_ACCOUNT, status.account); + b.putSerializable(Helper.ARG_ACCOUNT, statusToDeal.account); intent.putExtras(b); ActivityOptionsCompat options = ActivityOptionsCompat .makeSceneTransitionAnimation((Activity) context, holder.bindingPixelfed.artPp, context.getString(R.string.activity_porfile_pp)); @@ -2631,7 +2643,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.bindingPixelfed.bottomBanner.setOnClickListener(v -> { Intent intent = new Intent(context, ContextActivity.class); - intent.putExtra(Helper.ARG_STATUS, status); + intent.putExtra(Helper.ARG_STATUS, statusToDeal); context.startActivity(intent); }); } diff --git a/app/src/main/res/layout/drawer_status_pixelfed.xml b/app/src/main/res/layout/drawer_status_pixelfed.xml index 317c14b3..c410908d 100644 --- a/app/src/main/res/layout/drawer_status_pixelfed.xml +++ b/app/src/main/res/layout/drawer_status_pixelfed.xml @@ -18,6 +18,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/art_container" + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" android:layout_width="match_parent" android:layout_height="wrap_content"> @@ -54,12 +56,24 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"> - - + android:layout_height="50dp"> + + + + + + Timelines > Pixelfed Presentation) - Also works for other softwares when there are media Changed: - Add pinned tag in "any" to avoid to lose it when renaming timeline