Skip to content

Commit

Permalink
Fixed issue where Note Card works unexpected due to presence of a new…
Browse files Browse the repository at this point in the history
… line in description
  • Loading branch information
Jaguar000212 committed Dec 24, 2024
1 parent 74879d2 commit dc6cd80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ android {
applicationId = "com.jaguar.selfnotes"
minSdk = 30
targetSdk = 34
versionName = "3.0"
versionName = "3.5"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
signingConfig = signingConfigs.getByName("debug")
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public void onBindViewHolder(@NonNull NotesRecyclerAdapter.ListItemHolder holder
} else {
holder.nTitle.setText(note.getTitle());
}
if (note.getDescription().length() > 24) {
if (note.getDescription().indexOf("\n") < 24 && note.getDescription().contains("\n")) {
holder.nDescription.setText(String.format("%s...", note.getDescription().substring(0, note.getDescription().indexOf("\n"))));
} else if (note.getDescription().length() > 24) {
holder.nDescription.setText(String.format("%s...", note.getDescription().substring(0, 24)));
} else holder.nDescription.setText(note.getDescription());
holder.setNote(note);
Expand Down

0 comments on commit dc6cd80

Please sign in to comment.