Skip to content

Commit

Permalink
updated version to 3.1.0 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
tirtharajsinha committed Feb 5, 2022
1 parent f05b938 commit 1c3c9c0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 84 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/example/todo_app/FirstFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
duecounter++;
}

// System.out.println(res.getInt(0) + res.getString(1) + res.getString(2));
}


Expand Down
18 changes: 9 additions & 9 deletions app/src/main/java/com/example/todo_app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ public void onClick(View v) {
if (task.equals("")) {
Toast.makeText(MainActivity.this, "Empty todo entry found.", Toast.LENGTH_SHORT).show();
} else {
if(date.equals("")){
date=getCurDate();
if (date.equals("")) {
date = getCurDate();
}

Boolean checkinsertdata = DB.insertuserdetails(task,date);
Boolean checkinsertdata = DB.insertuserdetails(task, date);
if (checkinsertdata) {
Toast.makeText(MainActivity.this, "new entry inserted", Toast.LENGTH_SHORT).show();

Expand Down Expand Up @@ -147,12 +147,12 @@ public String getCurDate() {
return date;

}
public String makeDoubledigit(int a){
if(a<10){
return "0"+a;
}
else{
return ""+a;

public String makeDoubledigit(int a) {
if (a < 10) {
return "0" + a;
} else {
return "" + a;
}
}

Expand Down
72 changes: 0 additions & 72 deletions app/src/main/java/com/example/todo_app/SecondFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ public void onClick(View v) {
}

private void refreshsecondFragment() {
RecyclerView mRecView = (RecyclerView) view.findViewById(R.id.taskRecyclerview);
int size = mRecView.getAdapter().getItemCount();
System.out.println(size);
getChecked();
SecondFragment fragment = new SecondFragment();
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.flFragment, fragment);
Expand All @@ -114,73 +110,5 @@ private void refreshsecondFragment() {

}

private List<Integer> getChecked() {
RecyclerView mRecView = (RecyclerView) view.findViewById(R.id.taskRecyclerview);
int size = mRecView.getAdapter().getItemCount();
System.out.println(size);
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < size; i++) {

// ToDoAdapter.ViewHolder wordView = (ToDoAdapter.ViewHolder) mRecView.getChildAt(i);
View wordview = mRecView.getChildAt(i);
// CheckBox status = (CheckBox) wordView.itemView.findViewById(R.id.todoCheckbox);
if (wordview == null) {
System.out.println("null at pos " + i);
} else {
CheckBox status = wordview.findViewById(R.id.todoCheckbox);
if (status.isChecked()) {
list.add(i);
System.out.println("yes " + i);
} else {
System.out.println("no " + i);
}

}


}
return list;


}


public void deleteItem(int position) {
ToDoModel item = taskList.get(position);
int editid = item.getId();
System.out.println("id : " + editid + " - " + item.getTask());
Boolean checkupdatedata = DB.deleteuserdetails(editid);
}

public void createdialog(List<Integer> checkedlist) {
AlertDialog.Builder builder = new AlertDialog.Builder(thiscontext);
builder.setTitle("Delete Task");
builder.setMessage("Are you sure you want to delete this task?");
builder.setPositiveButton("Confirm",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

System.out.println("delete------------");
for (int pos : checkedlist) {
System.out.println("deleting task on - " + pos);
deleteItem(pos);
}
refreshsecondFragment();

}
});
builder.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
System.out.println("do nothing----------------");
// refreshsecondFragment();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}


}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_third.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
android:layout_width="380dp"
android:layout_height="150dp"
android:layout_marginTop="108dp"
android:background="@color/purple_500"
android:background="?attr/colorPrimaryVariant"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v23/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<style name="Theme.Todo_app" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#3667C8</item>
<item name="colorPrimaryVariant">#324771</item>
<item name="colorPrimaryVariant">#A9C0EC</item>
<item name="colorOnPrimary">#ECEFF4</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">#E5E9F0</item>
Expand Down

0 comments on commit 1c3c9c0

Please sign in to comment.