Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor code #19

Merged
merged 1 commit into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions app/src/main/java/com/app/edithormobile/adapter/NoteAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
import com.google.android.material.card.MaterialCardView;

import java.util.ArrayList;
import java.util.Set;

public class NoteAdapter extends RecyclerView.Adapter<NoteAdapter.NoteHolder> {
Context context;
ArrayList<NoteModel> notes ,pinnedList;
ArrayList<NoteModel> notes;
ArrayList<NoteModel> pinnedList;
Util util = new Util();

static ClickListener clickListener;
Expand Down Expand Up @@ -83,18 +85,18 @@ public void onBindViewHolder(@NonNull NoteHolder holder, int position) {
holder.card.setStrokeColor(mNote.getColor());

//Pin Control
if(mNote.isPinned()){
if (mNote.isPinned()) {
holder.pinImage.setVisibility(View.VISIBLE);
}else{
} else {
holder.pinImage.setVisibility(View.GONE);
}


} else {
//Pin Control
if(mNote.isPinned()){
if (mNote.isPinned()) {
holder.pin.setVisibility(View.VISIBLE);
}else{
} else {
holder.pin.setVisibility(View.GONE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ public void onItemClick(View v, int position) {
intent.putExtra("position", model);
intent.putExtra("image", notes.get(position).getImageUri());
intent.putExtra("pinned", notes.get(position).isPinned());

startActivity(intent);

}


Expand Down