Fix issue with CW
This commit is contained in:
parent
5d71d8c763
commit
5fa0cbe878
|
@ -75,6 +75,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
||||||
private boolean expanded;
|
private boolean expanded;
|
||||||
private BroadcastReceiver receive_action;
|
private BroadcastReceiver receive_action;
|
||||||
private String conversationId;
|
private String conversationId;
|
||||||
|
private boolean spoilerShown, spoilerBehaviour;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -102,7 +103,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
||||||
if( theme == Helper.THEME_BLACK)
|
if( theme == Helper.THEME_BLACK)
|
||||||
toolbar.setBackgroundColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.black));
|
toolbar.setBackgroundColor(ContextCompat.getColor(ShowConversationActivity.this, R.color.black));
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
spoilerShown = spoilerBehaviour =sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
statuses = new ArrayList<>();
|
statuses = new ArrayList<>();
|
||||||
if(b != null) {
|
if(b != null) {
|
||||||
|
@ -187,11 +188,19 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if( statuses != null && statuses.size() > 0) {
|
if( statuses != null && statuses.size() > 0) {
|
||||||
|
spoilerShown = !spoilerShown;
|
||||||
for (Status status : statuses) {
|
for (Status status : statuses) {
|
||||||
status.setShowSpoiler(!status.isShowSpoiler());
|
if( spoilerBehaviour && !status.isSpoilerShown() ){
|
||||||
|
status.setAutoHiddenCW(true);
|
||||||
|
}else{
|
||||||
|
status.setAutoHiddenCW(false);
|
||||||
|
}
|
||||||
|
status.setSpoilerShown(spoilerShown);
|
||||||
|
status.setShowSpoiler(spoilerShown);
|
||||||
}
|
}
|
||||||
statusListAdapter.notifyItemRangeChanged(0, statuses.size());
|
statusListAdapter.notifyItemRangeChanged(0, statuses.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
action_expand.setOnClickListener(new View.OnClickListener() {
|
action_expand.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -1024,10 +1024,22 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
holder.status_spoiler.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||||
|
if (motionEvent.getAction() == MotionEvent.ACTION_UP && !view.hasFocus()) {
|
||||||
|
try {
|
||||||
|
view.requestFocus();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
//Click on a conversation
|
//Click on a conversation
|
||||||
|
|
||||||
if ((getItemViewType(viewHolder.getAdapterPosition()) == DISPLAYED_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == CONSOLE_STATUS)) {
|
if ((getItemViewType(viewHolder.getAdapterPosition()) == DISPLAYED_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == COMPACT_STATUS || getItemViewType(viewHolder.getAdapterPosition()) == CONSOLE_STATUS)) {
|
||||||
holder.status_spoiler_container.setOnClickListener(new View.OnClickListener() {
|
holder.status_spoiler.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE) {
|
if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE) {
|
||||||
|
|
Loading…
Reference in New Issue