comment #43 - CW cannot be opened in thread view

This commit is contained in:
Thomas 2022-05-09 14:05:18 +02:00
parent c399c83591
commit 1b3a844ddd
2 changed files with 10 additions and 9 deletions

View file

@ -689,13 +689,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
statusToDeal.isExpended = true; statusToDeal.isExpended = true;
statusToDeal.isMediaDisplayed = true; statusToDeal.isMediaDisplayed = true;
} else { } else {
if (context instanceof ContextActivity && statusToDeal.sensitive) {
statusToDeal.isExpended = displayCW;
status.isMediaDisplayed = displayCW;
}
holder.binding.spoilerExpand.setOnClickListener(v -> { holder.binding.spoilerExpand.setOnClickListener(v -> {
statusToDeal.isExpended = !status.isExpended; statusToDeal.isExpended = !statusToDeal.isExpended;
statusToDeal.isMediaDisplayed = !status.isMediaDisplayed; statusToDeal.isMediaDisplayed = !statusToDeal.isMediaDisplayed;
adapter.notifyItemChanged(getPositionAsync(notificationList, statusList, statusToDeal)); adapter.notifyItemChanged(getPositionAsync(notificationList, statusList, statusToDeal));
}); });
holder.binding.spoilerExpand.setVisibility(View.VISIBLE); holder.binding.spoilerExpand.setVisibility(View.VISIBLE);
@ -742,7 +738,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else { } else {
holder.binding.containerTrans.setVisibility(View.GONE); holder.binding.containerTrans.setVisibility(View.GONE);
} }
if (status.spoiler_text == null || status.spoiler_text.trim().isEmpty() || statusToDeal.isExpended) { if (status.spoiler_text == null || status.spoiler_text.trim().isEmpty() || statusToDeal.isExpended) {
if (statusToDeal.content.trim().length() == 0) { if (statusToDeal.content.trim().length() == 0) {
holder.binding.mediaContainer.setVisibility(View.GONE); holder.binding.mediaContainer.setVisibility(View.GONE);

View file

@ -14,6 +14,7 @@ package app.fedilab.android.ui.fragment.timeline;
* You should have received a copy of the GNU General Public License along with Fedilab; if not, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.activities.ContextActivity.displayCW;
import static app.fedilab.android.activities.ContextActivity.expand; import static app.fedilab.android.activities.ContextActivity.expand;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
@ -192,10 +193,15 @@ public class FragmentMastodonContext extends Fragment {
} }
public void refresh() { public void refresh() {
if (statusAdapter != null && statuses != null) { if (statuses != null) {
for (Status status : statuses) {
status.isExpended = displayCW;
}
if (statusAdapter != null) {
statusAdapter.notifyItemRangeChanged(0, statuses.size()); statusAdapter.notifyItemRangeChanged(0, statuses.size());
} }
} }
}
public void redraw() { public void redraw() {
if (statusAdapter != null && firstStatus != null) { if (statusAdapter != null && firstStatus != null) {