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.setLayoutManager(new LinearLayoutManagerBugFixed(this));
binding.commentContentMarkdownView.setAdapter(markwonAdapter); binding.commentContentMarkdownView.setAdapter(markwonAdapter);
markwonAdapter.setMarkdown(postBodyMarkwon, parentBodyMarkdown); markwonAdapter.setMarkdown(postBodyMarkwon, parentBodyMarkdown);
// noinspection NotifyDataSetChanged
markwonAdapter.notifyDataSetChanged(); markwonAdapter.notifyDataSetChanged();
} }
parentFullname = intent.getStringExtra(EXTRA_PARENT_FULLNAME_KEY); parentFullname = intent.getStringExtra(EXTRA_PARENT_FULLNAME_KEY);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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