Small fix for panel features
This commit is contained in:
parent
f2544e5668
commit
fc66974cf4
|
@ -137,6 +137,7 @@ public class Status implements Parcelable{
|
|||
private int media_height;
|
||||
private boolean cached = false;
|
||||
private boolean autoHiddenCW = false;
|
||||
private boolean customFeaturesDisplayed = false;
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
|
@ -197,6 +198,7 @@ public class Status implements Parcelable{
|
|||
dest.writeInt(this.media_height);
|
||||
dest.writeByte(this.cached ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.autoHiddenCW ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.customFeaturesDisplayed ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
protected Status(Parcel in) {
|
||||
|
@ -259,6 +261,7 @@ public class Status implements Parcelable{
|
|||
this.media_height = in.readInt();
|
||||
this.cached = in.readByte() != 0;
|
||||
this.autoHiddenCW = in.readByte() != 0;
|
||||
this.customFeaturesDisplayed = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public static final Creator<Status> CREATOR = new Creator<Status>() {
|
||||
|
@ -1398,4 +1401,12 @@ public class Status implements Parcelable{
|
|||
public void setAutoHiddenCW(boolean autoHiddenCW) {
|
||||
this.autoHiddenCW = autoHiddenCW;
|
||||
}
|
||||
|
||||
public boolean isCustomFeaturesDisplayed() {
|
||||
return customFeaturesDisplayed;
|
||||
}
|
||||
|
||||
public void setCustomFeaturesDisplayed(boolean customFeaturesDisplayed) {
|
||||
this.customFeaturesDisplayed = customFeaturesDisplayed;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1000,14 +1000,16 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.fedilab_features.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
status.setCustomFeaturesDisplayed(!status.isCustomFeaturesDisplayed());
|
||||
notifyStatusChanged(status);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (holder.fedilab_features_panel.getVisibility() != View.VISIBLE) {
|
||||
if (status.isCustomFeaturesDisplayed()) {
|
||||
holder.fedilab_features_panel.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.fedilab_features_panel.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (theme == Helper.THEME_LIGHT) {
|
||||
holder.fedilab_features_panel.setBackgroundColor(ContextCompat.getColor(context, R.color.custom_features_panel_background_light));
|
||||
}
|
||||
|
@ -1054,8 +1056,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.fedilab_features_panel.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue