Ignore NotifyDataSetChanged lint warnings for Markwon adapters (#1228)

There is no "more efficient" way to update it
This commit is contained in:
Sergei Kozelko 2023-01-21 12:56:22 +08:00 committed by GitHub
parent c42f183696
commit 2ff6bcfcd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 1 deletions

View File

@ -213,6 +213,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
binding.commentContentMarkdownView.setLayoutManager(new LinearLayoutManagerBugFixed(this));
binding.commentContentMarkdownView.setAdapter(markwonAdapter);
markwonAdapter.setMarkdown(postBodyMarkwon, parentBodyMarkdown);
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged();
}
parentFullname = intent.getStringExtra(EXTRA_PARENT_FULLNAME_KEY);

View File

@ -162,6 +162,7 @@ public class FullMarkdownActivity extends BaseActivity {
markdownRecyclerView.setLayoutManager(linearLayoutManager);
markdownRecyclerView.setAdapter(markwonAdapter);
markwonAdapter.setMarkdown(markwon, commentMarkdown);
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged();
}

View File

@ -204,6 +204,7 @@ public class WikiActivity extends BaseActivity {
loadWiki();
} else {
markwonAdapter.setMarkdown(markwon, wikiMarkdown);
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged();
}
}
@ -227,6 +228,7 @@ public class WikiActivity extends BaseActivity {
String markdown = new JSONObject(response.body())
.getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.CONTENT_MD_KEY);
markwonAdapter.setMarkdown(markwon, Utils.modifyMarkdown(markdown));
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged();
} catch (JSONException e) {
e.printStackTrace();

View File

@ -216,6 +216,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
}
((CommentViewHolder) holder).markwonAdapter.setMarkdown(mMarkwon, comment.getCommentMarkdown());
// noinspection NotifyDataSetChanged
((CommentViewHolder) holder).markwonAdapter.notifyDataSetChanged();
String commentText = "";

View File

@ -440,6 +440,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
}
((CommentViewHolder) holder).mMarkwonAdapter.setMarkdown(mCommentMarkwon, comment.getCommentMarkdown());
// noinspection NotifyDataSetChanged
((CommentViewHolder) holder).mMarkwonAdapter.notifyDataSetChanged();
if (!mHideTheNumberOfVotes) {

View File

@ -120,7 +120,6 @@ public class CustomizeThemeRecyclerViewAdapter extends RecyclerView.Adapter<Recy
public void setCustomThemeSettingsItem(ArrayList<CustomThemeSettingsItem> customThemeSettingsItems) {
this.customThemeSettingsItems.clear();
notifyDataSetChanged();
this.customThemeSettingsItems.addAll(customThemeSettingsItems);
notifyDataSetChanged();
}

View File

@ -643,6 +643,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
((PostDetailBaseViewHolder) holder).mContentMarkdownView.setVisibility(View.VISIBLE);
((PostDetailBaseViewHolder) holder).mContentMarkdownView.setAdapter(mMarkwonAdapter);
mMarkwonAdapter.setMarkdown(mPostDetailMarkwon, mPost.getSelfText());
// noinspection NotifyDataSetChanged
mMarkwonAdapter.notifyDataSetChanged();
}

View File

@ -169,6 +169,7 @@ public class SidebarFragment extends Fragment {
sidebarDescription = subredditData.getSidebarDescription();
if (sidebarDescription != null && !sidebarDescription.equals("")) {
markwonAdapter.setMarkdown(markwon, sidebarDescription);
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged();
}
} else {