Prepare backend 3a - fix filter crashes
This commit is contained in:
parent
937c16c088
commit
7604bf9f3d
|
@ -177,7 +177,7 @@ public class ArtListAdapter extends RecyclerView.Adapter implements OnPostAction
|
|||
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int i) {
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
final String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
|
||||
if( viewHolder.getItemViewType() != HIDDEN_STATUS ) {
|
||||
final ViewHolderArt holder = (ViewHolderArt) viewHolder;
|
||||
final Status status = statuses.get(viewHolder.getAdapterPosition());
|
||||
if (!status.isClickable())
|
||||
|
@ -239,6 +239,7 @@ public class ArtListAdapter extends RecyclerView.Adapter implements OnPostAction
|
|||
holder.art_username.setText(status.getAccount().getUsername());
|
||||
|
||||
holder.art_acct.setText(String.format("@%s", status.getAccount().getAcct()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int i) {
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
final String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
|
||||
if( viewHolder.getItemViewType() != HIDDEN_STATUS ) {
|
||||
final ViewHolderPixelfed holder = (ViewHolderPixelfed) viewHolder;
|
||||
final Status status = statuses.get(viewHolder.getAdapterPosition());
|
||||
if (!status.isClickable())
|
||||
|
@ -294,6 +294,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
holder.art_username.setText(status.getAccount().getUsername());
|
||||
|
||||
holder.art_acct.setText(String.format("@%s", status.getAccount().getAcct()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -452,6 +452,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
final String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
|
||||
if( viewHolder.getItemViewType() != HIDDEN_STATUS ) {
|
||||
final ViewHolder holder = (ViewHolder) viewHolder;
|
||||
final Status status = statuses.get(viewHolder.getAdapterPosition());
|
||||
|
||||
|
@ -636,7 +637,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_privacy.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
|
||||
changeDrawableColor(context, R.drawable.video_preview, R.color.white);
|
||||
if (theme == Helper.THEME_BLACK) {
|
||||
changeDrawableColor(context, R.drawable.ic_reply, R.color.action_black);
|
||||
|
@ -736,7 +736,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_bookmark.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark_border));
|
||||
|
||||
|
||||
|
||||
//Redraws top icons (boost/reply)
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
holder.spark_button_fav.pressOnTouch(false);
|
||||
|
@ -801,7 +800,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
|
||||
|
||||
|
||||
holder.vertical_content.setLayoutParams(params);
|
||||
holder.left_buttons.setLayoutParams(paramsB);
|
||||
if (!status.isClickable())
|
||||
|
@ -812,7 +810,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
@Override
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
if (motionEvent.getAction() == MotionEvent.ACTION_UP && !view.hasFocus()) {
|
||||
try{view.requestFocus();}catch (Exception ignored){}
|
||||
try {
|
||||
view.requestFocus();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -873,8 +874,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (status.getNumberLines() > truncate_toots_size) {
|
||||
} else if (status.getNumberLines() > truncate_toots_size) {
|
||||
holder.status_show_more_content.setVisibility(View.VISIBLE);
|
||||
if (status.isExpanded()) {
|
||||
holder.status_content.setMaxLines(Integer.MAX_VALUE);
|
||||
|
@ -1131,8 +1131,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
} else {
|
||||
holder.status_translate.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
holder.status_translate.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
|
@ -1344,8 +1343,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
} else {
|
||||
holder.spark_button_reblog.setChecked(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
status.setBoostAnimated(false);
|
||||
holder.spark_button_reblog.setChecked(true);
|
||||
holder.spark_button_reblog.setAnimationSpeed(1.0f);
|
||||
|
@ -1401,8 +1399,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_pin.setImageDrawable(imgPin);
|
||||
|
||||
holder.status_pin.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
holder.status_pin.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
@ -1501,7 +1498,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
});
|
||||
|
||||
|
||||
|
||||
holder.spark_button_fav.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -1592,6 +1588,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
new CountDownTimer((timeout * 1000), 1000) {
|
||||
public void onTick(long millisUntilFinished) {
|
||||
}
|
||||
|
||||
public void onFinish() {
|
||||
status.setAttachmentShown(false);
|
||||
notifyStatusChanged(status);
|
||||
|
@ -1997,7 +1994,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
b.putString("fileMention", fname);
|
||||
b.putString("tootMention", (status.getReblog() != null) ? status.getReblog().getAccount().getAcct() : status.getAccount().getAcct());
|
||||
b.putString("urlMention", (status.getReblog() != null) ? status.getReblog().getUrl() : status.getUrl());
|
||||
|
@ -2167,6 +2165,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
holder.status_toot_app.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
});
|
||||
|
||||
|
||||
if( instanceType == null || instanceType.equals("MASTODON") || instanceType.equals("PIXELFED"))
|
||||
if( !instanceType.equals("PEERTUBE"))
|
||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
@ -516,7 +516,12 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
safeStatuses.add(status);
|
||||
}
|
||||
this.statuses.addAll(safeStatuses);
|
||||
if( instanceType.equals("MASTODON") || instanceType.equals("MISSKEY"))
|
||||
statusListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
else if( instanceType.equals("PIXELFED"))
|
||||
pixelfedListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
else if( instanceType.equals("ART"))
|
||||
artListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
}else if( tagTimeline == null || !tagTimeline.isART() || (tagTimeline.isART() && tagTimeline.isNSFW())) {
|
||||
this.statuses.addAll(statuses);
|
||||
statusListAdapter.notifyItemRangeInserted(previousPosition, statuses.size());
|
||||
|
@ -528,7 +533,13 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
safeStatuses.add(status);
|
||||
}
|
||||
this.statuses.addAll(safeStatuses);
|
||||
|
||||
if( instanceType.equals("MASTODON") || instanceType.equals("MISSKEY"))
|
||||
statusListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
else if( instanceType.equals("PIXELFED"))
|
||||
pixelfedListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
else if( instanceType.equals("ART"))
|
||||
artListAdapter.notifyItemRangeInserted(previousPosition, safeStatuses.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -566,7 +577,13 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
try {
|
||||
((MainActivity) context).updateHomeCounter();
|
||||
}catch (Exception ignored){}
|
||||
|
||||
if( instanceType.equals("MASTODON") || instanceType.equals("MISSKEY"))
|
||||
statusListAdapter.notifyItemInserted(0);
|
||||
else if( instanceType.equals("PIXELFED"))
|
||||
pixelfedListAdapter.notifyItemInserted(0);
|
||||
else if( instanceType.equals("ART"))
|
||||
artListAdapter.notifyItemInserted(0);
|
||||
if (textviewNoAction.getVisibility() == View.VISIBLE)
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue