Skip to content

Commit 6f96bb7

Browse files
committed
Second beta release, strikeThrough implementation and first time launch bug fix
1 parent ac9dc4d commit 6f96bb7

5 files changed

Lines changed: 47 additions & 36 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
applicationId "com.certified.notes"
1313
minSdkVersion 18
1414
targetSdkVersion 30
15-
versionCode 1
16-
versionName "beta-release-1.0"
15+
versionCode 2
16+
versionName "beta-release-1.1"
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919

app/release/app-release.apk

56 Bytes
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{
1111
"type": "SINGLE",
1212
"filters": [],
13-
"versionCode": 1,
14-
"versionName": "beta-release-1.0",
13+
"versionCode": 2,
14+
"versionName": "beta-release-1.1",
1515
"outputFile": "app-release.apk"
1616
}
1717
]

app/src/main/java/com/certified/notes/adapters/TodoRecyclerAdapter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import android.content.Context;
5+
import android.graphics.Paint;
56
import android.view.LayoutInflater;
67
import android.view.View;
78
import android.view.ViewGroup;
@@ -57,6 +58,9 @@ public void onBindViewHolder(ViewHolder holder, int position) {
5758
Todo todo = getItem(position);
5859
holder.mTodo.setText(todo.getTodo());
5960
holder.mCheckBox.setChecked(todo.isDone());
61+
if (holder.mCheckBox.isChecked()){
62+
strikeThrough(holder.mTodo, holder.mCheckBox.isChecked());
63+
}
6064

6165
holder.mCheckBox.setOnClickListener(v -> {
6266
String todoContent = holder.mTodo.getText().toString().trim();
@@ -91,6 +95,13 @@ public void onBindViewHolder(ViewHolder holder, int position) {
9195
});
9296
}
9397

98+
private void strikeThrough(TextView todo, boolean strikeThrough) {
99+
if (strikeThrough)
100+
todo.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
101+
else
102+
todo.setPaintFlags(0);
103+
}
104+
94105
public void setOnTodoClickedListener(onTodoClickedListener listener) {
95106
this.listener = listener;
96107
}

app/src/main/java/com/certified/notes/room/NotesDatabase.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,38 @@ public void onCreate(@NonNull SupportSQLiteDatabase db) {
6565
databaseWriteExecutor.execute(() -> {
6666
NotesDao notesDao = instance.mNotesDao();
6767

68-
// notesDao.deleteAllNotes();
69-
notesDao.insertNote(note1);
70-
notesDao.insertNote(note2);
71-
notesDao.insertNote(note3);
72-
notesDao.insertNote(note4);
73-
notesDao.insertNote(note5);
74-
notesDao.insertNote(note6);
75-
notesDao.insertNote(note7);
76-
notesDao.insertNote(note8);
77-
78-
// notesDao.deleteAllCourses();
79-
notesDao.insertCourse(course1);
80-
notesDao.insertCourse(course2);
81-
notesDao.insertCourse(course3);
82-
notesDao.insertCourse(course4);
83-
notesDao.insertCourse(course5);
84-
notesDao.insertCourse(course6);
85-
notesDao.insertCourse(course7);
86-
notesDao.insertCourse(course8);
87-
notesDao.insertCourse(course9);
88-
notesDao.insertCourse(course10);
89-
90-
// notesDao.deleteAllTodos();
91-
notesDao.insertTodo(todo1);
92-
notesDao.insertTodo(todo2);
93-
notesDao.insertTodo(todo3);
94-
notesDao.insertTodo(todo4);
95-
notesDao.insertTodo(todo5);
96-
notesDao.insertTodo(todo6);
97-
notesDao.insertTodo(todo7);
98-
notesDao.insertTodo(todo8);
99-
68+
//// notesDao.deleteAllNotes();
69+
// notesDao.insertNote(note1);
70+
// notesDao.insertNote(note2);
71+
// notesDao.insertNote(note3);
72+
// notesDao.insertNote(note4);
73+
// notesDao.insertNote(note5);
74+
// notesDao.insertNote(note6);
75+
// notesDao.insertNote(note7);
76+
// notesDao.insertNote(note8);
77+
//
78+
//// notesDao.deleteAllCourses();
79+
// notesDao.insertCourse(course1);
80+
// notesDao.insertCourse(course2);
81+
// notesDao.insertCourse(course3);
82+
// notesDao.insertCourse(course4);
83+
// notesDao.insertCourse(course5);
84+
// notesDao.insertCourse(course6);
85+
// notesDao.insertCourse(course7);
86+
// notesDao.insertCourse(course8);
87+
// notesDao.insertCourse(course9);
88+
// notesDao.insertCourse(course10);
89+
//
90+
//// notesDao.deleteAllTodos();
91+
// notesDao.insertTodo(todo1);
92+
// notesDao.insertTodo(todo2);
93+
// notesDao.insertTodo(todo3);
94+
// notesDao.insertTodo(todo4);
95+
// notesDao.insertTodo(todo5);
96+
// notesDao.insertTodo(todo6);
97+
// notesDao.insertTodo(todo7);
98+
// notesDao.insertTodo(todo8);
99+
//
100100
notesDao.insertUser(user);
101101
});
102102
}

0 commit comments

Comments
 (0)