Fix issue #780
This commit is contained in:
parent
c553391120
commit
137bba3741
|
@ -150,7 +150,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
ImageView action_expand = getSupportActionBar().getCustomView().findViewById(R.id.action_expand);
|
||||
title.setText(R.string.conversation);
|
||||
ImageView close_conversation = getSupportActionBar().getCustomView().findViewById(R.id.close_conversation);
|
||||
|
||||
ImageView action_unhide = getSupportActionBar().getCustomView().findViewById(R.id.action_unhide);
|
||||
if( expanded)
|
||||
action_expand.setImageResource(R.drawable.ic_expand_less);
|
||||
else
|
||||
|
@ -185,6 +185,17 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
action_unhide.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if( statuses != null && statuses.size() > 0) {
|
||||
for (Status status : statuses) {
|
||||
status.setShowSpoiler(!status.isShowSpoiler());
|
||||
}
|
||||
statusListAdapter.notifyItemRangeChanged(0, statuses.size());
|
||||
}
|
||||
}
|
||||
});
|
||||
action_expand.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -120,6 +120,7 @@ public class Status implements Parcelable{
|
|||
private String conversationId;
|
||||
private boolean isExpanded = false;
|
||||
private int numberLines = -1;
|
||||
private boolean showSpoiler = false;
|
||||
|
||||
public Status(){}
|
||||
private List<String> conversationProfilePicture;
|
||||
|
@ -182,6 +183,7 @@ public class Status implements Parcelable{
|
|||
dest.writeByte(this.isFavAnimated ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.scheduled_at);
|
||||
dest.writeString(this.contentType);
|
||||
dest.writeByte(this.showSpoiler ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
protected Status(Parcel in) {
|
||||
|
@ -238,6 +240,7 @@ public class Status implements Parcelable{
|
|||
this.isFavAnimated = in.readByte() != 0;
|
||||
this.scheduled_at = in.readString();
|
||||
this.contentType = in.readString();
|
||||
this.showSpoiler = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Creator<Status> CREATOR = new Creator<Status>() {
|
||||
|
@ -1291,4 +1294,12 @@ public class Status implements Parcelable{
|
|||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public boolean isShowSpoiler() {
|
||||
return showSpoiler;
|
||||
}
|
||||
|
||||
public void setShowSpoiler(boolean showSpoiler) {
|
||||
this.showSpoiler = showSpoiler;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1149,7 +1149,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if (status.getReblog() == null) {
|
||||
if (status.getSpoiler_text() != null && status.getSpoiler_text().trim().length() > 0) {
|
||||
holder.status_spoiler_container.setVisibility(View.VISIBLE);
|
||||
if (!status.isSpoilerShown() && !expand_cw) {
|
||||
if (!status.isSpoilerShown() && !expand_cw && !status.isShowSpoiler()) {
|
||||
holder.status_content_container.setVisibility(View.GONE);
|
||||
if (status.getMentions().size() > 0)
|
||||
holder.status_spoiler_mention_container.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
|
||||
</vector>
|
|
@ -58,10 +58,22 @@
|
|||
android:textSize="14sp"
|
||||
android:id="@+id/toolbar_title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/action_unhide"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:src="@drawable/ic_show_hidden"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:contentDescription="@string/expand_cw" />
|
||||
<ImageView
|
||||
android:id="@+id/action_refresh"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:src="@drawable/ic_refresh"
|
||||
android:layout_alignParentRight="true"
|
||||
|
@ -72,8 +84,8 @@
|
|||
android:contentDescription="@string/refresh" />
|
||||
<ImageView
|
||||
android:id="@+id/action_expand"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:src="@drawable/ic_expand_more"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
Loading…
Reference in New Issue