diff --git a/DoNExt/app/build.gradle b/DoNExt/app/build.gradle
index 4912e18..00bf023 100644
--- a/DoNExt/app/build.gradle
+++ b/DoNExt/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "com.wismna.geoffroy.donext"
minSdkVersion 19
targetSdkVersion 25
- versionCode 15
- versionName "1.4.0"
+ versionCode 16
+ versionName "1.4.1"
}
buildTypes {
release {
@@ -26,7 +26,7 @@ dependencies {
compile 'com.android.support:support-v4:25.3.0'
compile 'com.android.support:percent:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
- compile 'com.google.android.gms:play-services-ads:10.2.0'
+ compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'net.danlew:android.joda:2.9.7'
testCompile 'junit:junit:4.12'
}
diff --git a/DoNExt/app/src/androidTest/java/com/wismna/geoffroy/donext/ApplicationTest.java b/DoNExt/app/src/androidTest/java/com/wismna/geoffroy/donext/ApplicationTest.java
deleted file mode 100644
index 81cfef3..0000000
--- a/DoNExt/app/src/androidTest/java/com/wismna/geoffroy/donext/ApplicationTest.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.wismna.geoffroy.donext;
-
-import android.app.Application;
-import android.test.ApplicationTestCase;
-
-/**
- * Testing Fundamentals
- */
-public class ApplicationTest extends ApplicationTestCase {
- public ApplicationTest() {
- super(Application.class);
- }
-}
\ No newline at end of file
diff --git a/DoNExt/app/src/main/AndroidManifest.xml b/DoNExt/app/src/main/AndroidManifest.xml
index be58329..742bf0a 100644
--- a/DoNExt/app/src/main/AndroidManifest.xml
+++ b/DoNExt/app/src/main/AndroidManifest.xml
@@ -22,7 +22,6 @@
-
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/DoNext.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/DoNext.java
index ee5489e..ec24558 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/DoNext.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/DoNext.java
@@ -6,6 +6,7 @@ import net.danlew.android.joda.JodaTimeAndroid;
/**
* Created by bg45 on 2017-03-15.
+ * Application class, used to initialize Joda Time
*/
public class DoNext extends Application {
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/MainActivity.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/MainActivity.java
index 8781d33..46c53b4 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/MainActivity.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/MainActivity.java
@@ -136,19 +136,7 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
- // Handles layout change button
- MenuItem displayLayoutItem = menu.findItem(R.id.action_changeLayout);
- if (displayLayoutItem == null) return false;
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
- String layoutType = sharedPref.getString("pref_conf_task_layout", "1");
- switch (layoutType) {
- case "1" :
- displayLayoutItem.setIcon(R.drawable.ic_list_white_24dp);
- break;
- case "2" :
- displayLayoutItem.setIcon(R.drawable.ic_view_list_white_24dp);
- break;
- }
// Handles today list
MenuItem todayListItem = menu.findItem(R.id.action_todayList);
@@ -232,8 +220,6 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
// Update the ViewPagerAdapter to refresh all tabs
mSectionsPagerAdapter.notifyDataSetChanged();
- // Invalidate the menu to redraw the icon
- invalidateOptionsMenu();
}
/** Called when the user clicks the Edit Lists button */
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/TodayActivity.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/TodayActivity.java
index bb65a08..a622d27 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/TodayActivity.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/activities/TodayActivity.java
@@ -49,23 +49,6 @@ public class TodayActivity extends AppCompatActivity
return true;
}
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- MenuItem displayLayoutItem = menu.findItem(R.id.action_changeLayout);
- if (displayLayoutItem == null) return false;
- SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
- String layoutType = sharedPref.getString("pref_conf_task_layout", "1");
- switch (layoutType) {
- case "1" :
- displayLayoutItem.setIcon(R.drawable.ic_list_white_24dp);
- break;
- case "2" :
- displayLayoutItem.setIcon(R.drawable.ic_view_list_white_24dp);
- break;
- }
- return super.onPrepareOptionsMenu(menu);
- }
-
/** Called when the user clicks on the Change Layout button */
public void changeLayout(MenuItem item) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
@@ -75,10 +58,9 @@ public class TodayActivity extends AppCompatActivity
editor.putString("pref_conf_task_layout", String.valueOf(layoutType % 2 + 1));
editor.apply();
+ // TODO: refresh the task list
// Update the ViewPagerAdapter to refresh all tabs
//mSectionsPagerAdapter.notifyDataSetChanged();
- // Invalidate the menu to redraw the icon
- invalidateOptionsMenu();
}
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/SmartFragmentStatePagerAdapter.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/SmartFragmentStatePagerAdapter.java
index a2e8b34..bae6059 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/SmartFragmentStatePagerAdapter.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/SmartFragmentStatePagerAdapter.java
@@ -1,5 +1,11 @@
package com.wismna.geoffroy.donext.adapters;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+import android.util.SparseArray;
+import android.view.ViewGroup;
+
/**
* Created by geoffroy on 15-11-28.
* Extension of FragmentStatePagerAdapter which intelligently caches
@@ -7,15 +13,9 @@ package com.wismna.geoffroy.donext.adapters;
* Usage involves extending from SmartFragmentStatePagerAdapter as you would any other PagerAdapter.
*/
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentStatePagerAdapter;
-import android.util.SparseArray;
-import android.view.ViewGroup;
-
public abstract class SmartFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
// Sparse array to keep track of registered fragments in memory
- private SparseArray registeredFragments = new SparseArray<>();
+ private final SparseArray registeredFragments = new SparseArray<>();
public SmartFragmentStatePagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/TaskListRecyclerViewAdapter.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/TaskListRecyclerViewAdapter.java
index af00110..ab05915 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/TaskListRecyclerViewAdapter.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/adapters/TaskListRecyclerViewAdapter.java
@@ -33,7 +33,7 @@ public class TaskListRecyclerViewAdapter extends RecyclerView.Adapter mValues;
- private TaskListRecyclerViewAdapterListener mListener;
+ private final TaskListRecyclerViewAdapterListener mListener;
public TaskListRecyclerViewAdapter(List items,
TaskListRecyclerViewAdapterListener listener) {
@@ -110,7 +110,7 @@ public class TaskListRecyclerViewAdapter extends RecyclerView.Adapter {
private List mValues;
- private int viewType;
+ private final int viewType;
public TaskRecyclerViewAdapter(List items, int viewType) {
mValues = items;
@@ -52,7 +52,7 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter taskLists;
-
- public static TaskDialogFragment newInstance(Task task, List taskLists, NewTaskListener newTaskListener) {
- TaskDialogFragment fragment = new TaskDialogFragment();
- fragment.task = task;
- fragment.taskLists = taskLists;
- fragment.mListener = newTaskListener;
- fragment.setRetainInstance(true);
- return fragment;
- }
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- // This part is only needed on small layouts (large layouts use onCreateDialog)
- if (!getArguments().getBoolean("layout")) {
- View view = inflater.inflate(R.layout.fragment_task_form, container, false);
- AppCompatActivity activity = (AppCompatActivity) getActivity();
- activity.setSupportActionBar(setToolbarTitle(view));
-
- ActionBar actionBar = activity.getSupportActionBar();
- if (actionBar != null) {
- actionBar.setDisplayHomeAsUpEnabled(true);
- actionBar.setHomeButtonEnabled(true);
- actionBar.setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel);
- }
- setHasOptionsMenu(true);
- setTaskValues(view);
- return view;
- }
- return super.onCreateView(inflater, container, savedInstanceState);
- }
-
- @Override
- @NonNull
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Inflate and set the layout for the dialog
- LayoutInflater inflater = getActivity().getLayoutInflater();
- final View view = inflater.inflate(R.layout.fragment_task_form, null);
- setToolbarTitle(view);
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- // Pass null as the parent view because its going in the dialog layout
- builder.setView(view)
- // Add action buttons
- .setPositiveButton(R.string.new_task_save, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- onPositiveButtonClick(view);
- }
- })
- .setNegativeButton(R.string.new_task_cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- // Send the negative button event back to the host activity
- // Canceled creation, nothing to do
- //dialog.cancel();
- onNegativeButtonClick();
- }
- });
- if (task != null) {
- builder.setNeutralButton(R.string.new_task_delete, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- onNeutralButtonClick();
- }
- });
- }
- setTaskValues(view);
- return builder.create();
- }
-
- @Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- //super.onCreateOptionsMenu(menu, inflater);
- menu.clear();
- getActivity().getMenuInflater().inflate(R.menu.menu_dynamic_fragment, menu);
- }
-
- @Override
- public void onPrepareOptionsMenu(Menu menu) {
- if (task == null) {
- menu.removeItem(R.id.menu_neutral_button);
- }
- super.onPrepareOptionsMenu(menu);
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Determine which menu item was clicked
- int id = item.getItemId();
- View view = getView();
-
- // Hide the keyboard if present
- if (view != null) {
- InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
- }
- if (id == R.id.menu_positive_button) {
- // handle save button click here
- onPositiveButtonClick(view);
- return true;
- }
- else if (id == R.id.menu_neutral_button) {
- // handle delete button click here
- onNeutralButtonClick();
- return true;
- }
- else if (id == android.R.id.home) {
- // handle close button click here
- onNegativeButtonClick();
- return true;
- }
-
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- public void onDestroyView() {
- Dialog dialog = getDialog();
- // Stop the dialog from being dismissed on rotation, due to a bug with the compatibility library
- // https://code.google.com/p/android/issues/detail?id=17423
- if (dialog != null && getRetainInstance()) {
- dialog.setDismissMessage(null);
- }
- super.onDestroyView();
- }
-
- private void setTaskValues(View view) {
- // Get date picker
- final DatePicker dueDatePicker = (DatePicker) view.findViewById(R.id.new_task_due_date);
-
- // Populate spinner with task lists
- Spinner spinner = (Spinner) view.findViewById(R.id.new_task_list);
- // Create an ArrayAdapter using the string array and a default spinner layout
- ArrayAdapter adapter = new ArrayAdapter<>(
- getActivity(), android.R.layout.simple_spinner_item, taskLists);
- // Specify the layout to use when the list of choices appears
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- spinner.setAdapter(adapter);
-
- // Auto set list value to current tab
- Bundle args = getArguments();
- int id = args.getInt("list");
- spinner.setSelection(id);
-
- CheckBox checkBox = (CheckBox) view.findViewById(R.id.new_task_today);
- TextView todayLabel = (TextView) view.findViewById(R.id.new_task_today_label);
- boolean isTodayActive = args.getBoolean("today");
- checkBox.setVisibility(isTodayActive ? View.VISIBLE : View.GONE);
- todayLabel.setVisibility(isTodayActive ? View.VISIBLE : View.GONE);
-
- // Set other properties if they exist
- if (task != null) {
-
- EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
- titleText.setText(task.getName());
- EditText descText = (EditText) view.findViewById(R.id.new_task_description);
- descText.setText(task.getDescription());
- SeekBar seekBar = (SeekBar) view.findViewById(R.id.new_task_priority);
- seekBar.setProgress(task.getPriority());
-
- // Set Due Date
- LocalDate dueDate = task.getDueDate();
- dueDatePicker.updateDate(dueDate.getYear(), dueDate.getMonthOfYear() - 1, dueDate.getDayOfMonth());
-
- checkBox.setChecked(task.isToday());
- }
- else {
- // Disallow past dates on new tasks
- dueDatePicker.setMinDate(LocalDate.now().toDate().getTime());
- }
- }
-
- private Toolbar setToolbarTitle(View view) {
- Toolbar toolbar = (Toolbar) view.findViewById(R.id.dialog_toolbar);
- toolbar.setTitle(getTag());
- return toolbar;
- }
-
- protected void onPositiveButtonClick(View view) {
- if (view == null) return;
- EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
- // handle confirmation button click hereEditText titleText = (EditText) d.findViewById(R.id.new_task_name);
- if (titleText.getText().toString().matches(""))
- titleText.setError(getResources().getString(R.string.new_task_name_error));
- else {
- // Send the positive button event back to the host activity
- mListener.onNewTaskDialogPositiveClick(TaskDialogFragment.this, view);
- dismiss();
- }
- }
-
- protected /*abstract*/ void onNeutralButtonClick() {
- mListener.onNewTaskDialogNeutralClick(TaskDialogFragment.this);
- }
-
- protected /*abstract*/ void onNegativeButtonClick() {
- dismiss();
- }
-}
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TaskListsFragment.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TaskListsFragment.java
index 6fc7537..84bd8fb 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TaskListsFragment.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TaskListsFragment.java
@@ -49,8 +49,7 @@ public class TaskListsFragment extends Fragment implements
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- taskListDataAccess = new TaskListDataAccess(getContext());
- taskListDataAccess.open(TaskListDataAccess.MODE.WRITE);
+ taskListDataAccess = new TaskListDataAccess(getContext(), TaskListDataAccess.MODE.WRITE);
new GetTaskListsTask().execute(taskListDataAccess);
}
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TasksFragment.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TasksFragment.java
index 0f018c0..68c9a16 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TasksFragment.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TasksFragment.java
@@ -187,21 +187,21 @@ public class TasksFragment extends Fragment implements
int totalCycles = taskRecyclerViewAdapter.getCycleCount();
TextView totalCyclesView = (TextView) view.findViewById(R.id.total_task_cycles);
if (totalCycles != 0)
- totalCyclesView.setText(resources.getString(R.string.task_total_cycles, totalCycles, (totalCycles > 1 ? "s" : "")));
+ totalCyclesView.setText(resources.getQuantityString(R.plurals.task_total_cycles, totalCycles, totalCycles));
else totalCyclesView.setText("");
// Update total tasks
int totalTasks = taskRecyclerViewAdapter.getItemCount();
TextView totalTasksView = (TextView) view.findViewById(R.id.total_task_count);
- if (totalTasks == 0) totalTasksView.setText(resources.getText(R.string.task_no_tasks));
- else totalTasksView.setText(resources.getString(R.string.task_total, totalTasks, (totalTasks > 1 ? "s" : "")));
+ if (totalTasks == 0) view.findViewById(R.id.no_more_tasks).setVisibility(View.VISIBLE);
+ else totalTasksView.setText(resources.getQuantityString(R.plurals.task_total, totalTasks, totalTasks));
// Update remaining tasks
TextView remainingTasksView = (TextView) view.findViewById(R.id.remaining_task_count);
NoScrollingLayoutManager layoutManager = (NoScrollingLayoutManager) recyclerView.getLayoutManager();
int remainingTaskCount = totalTasks - layoutManager.findLastVisibleItemPosition() - 1;
if (remainingTaskCount == 0) remainingTasksView.setText("");
- else remainingTasksView.setText(resources.getString(R.string.task_remaining, remainingTaskCount, (remainingTaskCount > 1 ? "s" : "")));
+ else remainingTasksView.setText(resources.getQuantityString(R.plurals.task_remaining, remainingTaskCount, remainingTaskCount));
//recyclerView.getViewTreeObserver().removeOnPreDrawListener(this);
return true;
@@ -214,89 +214,8 @@ public class TasksFragment extends Fragment implements
@Override
public void onPause() {
- super.onPause();
if (snackbar != null) snackbar.dismiss();
- }
-
- /** Performs an action on a task: done, next or delete */
- public void PerformTaskAction(final int itemPosition, final int direction) {
- final long itemId = taskRecyclerViewAdapter.getItemId(itemPosition);
- final Task task = taskRecyclerViewAdapter.getItem(itemPosition);
- String action = "";
- Resources resources = getResources();
-
- taskRecyclerViewAdapter.remove(itemPosition);
-
- switch (direction)
- {
- // Mark item as Done
- case ItemTouchHelper.LEFT:
- action = resources.getString(R.string.snackabar_action_done);
- break;
- // Increase task cycle count
- case ItemTouchHelper.RIGHT:
- action = resources.getString(R.string.snackabar_action_next);
- task.setCycle(task.getCycle() + 1);
- taskRecyclerViewAdapter.add(task, taskRecyclerViewAdapter.getItemCount());
- break;
- case -1:
- FragmentManager manager = getFragmentManager();
- DialogFragment dialog = (DialogFragment) manager.findFragmentByTag(getString(R.string.action_edit_task));
- if (dialog != null) dialog.dismiss();
- action = resources.getString(R.string.snackabar_action_deleted);
- break;
- }
-
- // Setup the snack bar
- snackbar = Snackbar.make(view, resources.getString(R.string.snackabar_label, action), Snackbar.LENGTH_LONG)
- .setAction(resources.getString(R.string.snackabar_button), new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // Undo adapter changes
- switch (direction) {
- // Nothing special to do for done
- case ItemTouchHelper.LEFT:
- break;
- // Remove the last item
- case ItemTouchHelper.RIGHT:
- taskRecyclerViewAdapter.remove(taskRecyclerViewAdapter.getItemCount() - 1);
- task.setCycle(task.getCycle() - 1);
- break;
- // Nothing special to do for delete
- case -1:
- break;
- }
- // Reset the first item
- taskRecyclerViewAdapter.add(task, itemPosition);
- recyclerView.scrollToPosition(0);
- }
- });
- snackbar.addCallback(new Snackbar.Callback() {
- @Override
- public void onDismissed(Snackbar snackbar, int event) {
- super.onDismissed(snackbar, event);
-
- // When clicked on undo, do not write to DB
- if (event == DISMISS_EVENT_ACTION) return;
-
- // Commit the changes to DB
- try (TaskDataAccess taskDataAccess = new TaskDataAccess(view.getContext(), TaskDataAccess.MODE.WRITE)) {
- switch (direction) {
- // Mark item as Done
- case ItemTouchHelper.LEFT:
- taskDataAccess.setDone(itemId);
- break;
- // Increase task cycle count
- case ItemTouchHelper.RIGHT:
- taskDataAccess.increaseCycle(task.getCycle(), itemId);
- break;
- case -1:
- // Commit the changes to DB
- taskDataAccess.deleteTask(itemId);
- }
- }
- }
- }).show();
+ super.onPause();
}
@Override
@@ -456,4 +375,85 @@ public class TasksFragment extends Fragment implements
}
else PerformTaskAction(itemPosition, direction);
}
+
+ /** Performs an action on a task: done, next or delete */
+ private void PerformTaskAction(final int itemPosition, final int direction) {
+ final long itemId = taskRecyclerViewAdapter.getItemId(itemPosition);
+ final Task task = taskRecyclerViewAdapter.getItem(itemPosition);
+ String action = "";
+ Resources resources = getResources();
+
+ taskRecyclerViewAdapter.remove(itemPosition);
+
+ switch (direction)
+ {
+ // Mark item as Done
+ case ItemTouchHelper.LEFT:
+ action = resources.getString(R.string.snackabar_action_done);
+ break;
+ // Increase task cycle count
+ case ItemTouchHelper.RIGHT:
+ action = resources.getString(R.string.snackabar_action_next);
+ task.setCycle(task.getCycle() + 1);
+ taskRecyclerViewAdapter.add(task, taskRecyclerViewAdapter.getItemCount());
+ break;
+ case -1:
+ FragmentManager manager = getFragmentManager();
+ DialogFragment dialog = (DialogFragment) manager.findFragmentByTag(getString(R.string.action_edit_task));
+ if (dialog != null) dialog.dismiss();
+ action = resources.getString(R.string.snackabar_action_deleted);
+ break;
+ }
+
+ // Setup the snack bar
+ snackbar = Snackbar.make(view, resources.getString(R.string.snackabar_label, action), Snackbar.LENGTH_LONG)
+ .setAction(resources.getString(R.string.snackabar_button), new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // Undo adapter changes
+ switch (direction) {
+ // Nothing special to do for done
+ case ItemTouchHelper.LEFT:
+ break;
+ // Remove the last item
+ case ItemTouchHelper.RIGHT:
+ taskRecyclerViewAdapter.remove(taskRecyclerViewAdapter.getItemCount() - 1);
+ task.setCycle(task.getCycle() - 1);
+ break;
+ // Nothing special to do for delete
+ case -1:
+ break;
+ }
+ // Reset the first item
+ taskRecyclerViewAdapter.add(task, itemPosition);
+ recyclerView.scrollToPosition(0);
+ }
+ });
+ snackbar.addCallback(new Snackbar.Callback() {
+ @Override
+ public void onDismissed(Snackbar snackbar, int event) {
+ super.onDismissed(snackbar, event);
+
+ // When clicked on undo, do not write to DB
+ if (event == DISMISS_EVENT_ACTION) return;
+
+ // Commit the changes to DB
+ try (TaskDataAccess taskDataAccess = new TaskDataAccess(view.getContext(), TaskDataAccess.MODE.WRITE)) {
+ switch (direction) {
+ // Mark item as Done
+ case ItemTouchHelper.LEFT:
+ taskDataAccess.setDone(itemId);
+ break;
+ // Increase task cycle count
+ case ItemTouchHelper.RIGHT:
+ taskDataAccess.increaseCycle(task.getCycle(), itemId);
+ break;
+ case -1:
+ // Delete the task
+ taskDataAccess.deleteTask(itemId);
+ }
+ }
+ }
+ }).show();
+ }
}
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TodayFormDialogFragment.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TodayFormDialogFragment.java
index 292570a..17d99b3 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TodayFormDialogFragment.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/fragments/TodayFormDialogFragment.java
@@ -18,6 +18,7 @@ import com.wismna.geoffroy.donext.database.TaskDataAccess;
import org.joda.time.LocalDate;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -34,16 +35,12 @@ public class TodayFormDialogFragment extends DynamicDialogFragment {
void onTodayTasksUpdated();
}
private TodayFormDialogFragment.TodayTaskListener mListener;
- private List tasks;
+ private final List mUpdatedTasks = new ArrayList<>();
public static TodayFormDialogFragment newInstance(Context context, TodayTaskListener todayTaskListener) {
TodayFormDialogFragment fragment = new TodayFormDialogFragment();
fragment.mListener = todayTaskListener;
- // TODO: put this in an AsyncTask
- try(TaskDataAccess taskDataAccess = new TaskDataAccess(context)) {
- fragment.tasks = taskDataAccess.getAllTasks();
- }
fragment.setRetainInstance(true);
return fragment;
}
@@ -53,19 +50,15 @@ public class TodayFormDialogFragment extends DynamicDialogFragment {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContentFragment = new TodayFormContentFragment();
+ // Load the tasks asynchronously
+ new LoadTasks().execute(getActivity());
Bundle args = getArguments();
if (args != null) {
mIsLargeLayout = args.getBoolean("layout");
}
}
- @Override
- public void onStart() {
- super.onStart();
- setLayoutValues(getView());
- }
-
- private void setLayoutValues(View view) {
+ private void setLayoutValues(View view, List tasks) {
EditText editText = (EditText) view.findViewById(R.id.today_search);
final ListView listView = (ListView) view.findViewById(R.id.today_tasks);
final TodayArrayAdapter adapter = new TodayArrayAdapter(getActivity(), tasks);
@@ -77,6 +70,10 @@ public class TodayFormDialogFragment extends DynamicDialogFragment {
Task task = adapter.getItem(position);
if (task == null) return;
task.setTodayDate(task.isToday() ? "" : LocalDate.now().toString());
+ // Maintain a list of actually updated tasks to commit to DB
+ if (!mUpdatedTasks.contains(task)) mUpdatedTasks.add(task);
+ else mUpdatedTasks.remove(task);
+ // Refresh the view
adapter.notifyDataSetChanged();
}
});
@@ -101,8 +98,8 @@ public class TodayFormDialogFragment extends DynamicDialogFragment {
@Override
protected void onPositiveButtonClick(View view) {
mListener.onTodayTaskDialogPositiveClick(view);
- // TODO: find a way to filter this list to only get changed tasks
- new UpdateTasks().execute(tasks.toArray(new Task[tasks.size()]));
+ // Only commit the updated tasks to DB
+ new UpdateTasks().execute(mUpdatedTasks.toArray(new Task[mUpdatedTasks.size()]));
dismiss();
}
@@ -116,6 +113,21 @@ public class TodayFormDialogFragment extends DynamicDialogFragment {
dismiss();
}
+ private class LoadTasks extends AsyncTask> {
+ @Override
+ protected List doInBackground(Context... params) {
+ try(TaskDataAccess taskDataAccess = new TaskDataAccess(params[0])) {
+ return taskDataAccess.getAllTasks();
+ }
+ }
+
+ @Override
+ protected void onPostExecute(List tasks) {
+ super.onPostExecute(tasks);
+ setLayoutValues(getView(), tasks);
+ }
+ }
+
private class UpdateTasks extends AsyncTask {
@Override
protected Integer doInBackground(Task... params) {
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskListTouchHelper.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskListTouchHelper.java
index 627b959..80553d6 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskListTouchHelper.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskListTouchHelper.java
@@ -11,7 +11,7 @@ import android.support.v7.widget.helper.ItemTouchHelper;
public class TaskListTouchHelper extends ItemTouchHelper.SimpleCallback {
public interface TaskListTouchHelperAdapter {
- boolean onItemMove (int fromPosition, int toPosition);
+ boolean onItemMove(int fromPosition, int toPosition);
}
private final TaskListTouchHelperAdapter mAdapter;
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskTouchHelper.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskTouchHelper.java
index 8435562..311c90e 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskTouchHelper.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/helpers/TaskTouchHelper.java
@@ -22,7 +22,7 @@ public class TaskTouchHelper extends ItemTouchHelper.SimpleCallback {
void onItemSwiped(int position, int direction);
}
- private TaskTouchHelperAdapter mAdapter;
+ private final TaskTouchHelperAdapter mAdapter;
public TaskTouchHelper(TaskTouchHelperAdapter adapter){
// No drag moves, no swipes (except for 1st element, see getSwipeDirs method)
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/listeners/RecyclerItemClickListener.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/listeners/RecyclerItemClickListener.java
index 00b8007..f161c52 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/listeners/RecyclerItemClickListener.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/listeners/RecyclerItemClickListener.java
@@ -11,13 +11,13 @@ import android.view.View;
* Listener class on RecyclerView to intercept touch events
*/
public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
- private OnItemClickListener mListener;
+ private final OnItemClickListener mListener;
public interface OnItemClickListener {
void onItemClick(View view, int position);
}
- GestureDetector mGestureDetector;
+ private final GestureDetector mGestureDetector;
public RecyclerItemClickListener(Context context, OnItemClickListener listener) {
mListener = listener;
diff --git a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/widgets/DividerItemDecoration.java b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/widgets/DividerItemDecoration.java
index d62cb71..e2751b7 100644
--- a/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/widgets/DividerItemDecoration.java
+++ b/DoNExt/app/src/main/java/com/wismna/geoffroy/donext/widgets/DividerItemDecoration.java
@@ -15,7 +15,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
- private Drawable mDivider;
+ private final Drawable mDivider;
/**
* Default divider will be used
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_access_alarm.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_access_alarm.png
new file mode 100644
index 0000000..debd50f
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-hdpi/ic_access_alarm.png differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_add.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_add.png
new file mode 100644
index 0000000..1ae5b2d
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-hdpi/ic_add.png differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_add_white_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_add_white_24dp.png
deleted file mode 100644
index 694179b..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_add_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_dark.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_dark.png
new file mode 100644
index 0000000..86bed01
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_white_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_white_24dp.png
deleted file mode 100644
index 2d12a89..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_create_new_folder_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_format_size_dark.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_format_size_dark.png
new file mode 100644
index 0000000..ea4d26d
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-hdpi/ic_format_size_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_forward_black_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_forward_black_24dp.png
deleted file mode 100644
index 13a9128..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_forward_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png
deleted file mode 100644
index da56077..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png
deleted file mode 100644
index e200012..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_reorder.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_reorder.png
new file mode 100644
index 0000000..d0371ec
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-hdpi/ic_reorder.png differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png
deleted file mode 100644
index a5ebdbd..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png b/DoNExt/app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png
deleted file mode 100644
index 64ad8e1..0000000
Binary files a/DoNExt/app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_access_alarm.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_access_alarm.png
new file mode 100644
index 0000000..77d4e93
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-mdpi/ic_access_alarm.png differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_add.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_add.png
new file mode 100644
index 0000000..d51f0dd
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-mdpi/ic_add.png differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_add_white_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_add_white_24dp.png
deleted file mode 100644
index 3856041..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_add_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_dark.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_dark.png
new file mode 100644
index 0000000..d716b24
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_white_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_white_24dp.png
deleted file mode 100644
index 02167a9..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_create_new_folder_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_format_size_dark.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_format_size_dark.png
new file mode 100644
index 0000000..28da916
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-mdpi/ic_format_size_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_forward_black_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_forward_black_24dp.png
deleted file mode 100644
index 8b185cb..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_forward_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png
deleted file mode 100644
index 5ef3dc0..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png
deleted file mode 100644
index b36475d..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_reorder.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_reorder.png
new file mode 100644
index 0000000..53bcf7a
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-mdpi/ic_reorder.png differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png
deleted file mode 100644
index 9685e8e..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-mdpi/ic_view_list_white_24dp.png b/DoNExt/app/src/main/res/drawable-mdpi/ic_view_list_white_24dp.png
deleted file mode 100644
index 4aca55c..0000000
Binary files a/DoNExt/app/src/main/res/drawable-mdpi/ic_view_list_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-v21/ic_info_black_24dp.xml b/DoNExt/app/src/main/res/drawable-v21/ic_info_black_24dp.xml
deleted file mode 100644
index 34b8202..0000000
--- a/DoNExt/app/src/main/res/drawable-v21/ic_info_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/DoNExt/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml b/DoNExt/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml
deleted file mode 100644
index e3400cf..0000000
--- a/DoNExt/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/DoNExt/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml b/DoNExt/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml
deleted file mode 100644
index 3f0ac1c..0000000
--- a/DoNExt/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_access_alarm.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_access_alarm.png
new file mode 100644
index 0000000..46eea0f
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xhdpi/ic_access_alarm.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_add.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_add.png
new file mode 100644
index 0000000..9ea0eeb
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xhdpi/ic_add.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_add_white_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_add_white_24dp.png
deleted file mode 100644
index 67bb598..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_add_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_dark.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_dark.png
new file mode 100644
index 0000000..7ad2e63
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_white_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_white_24dp.png
deleted file mode 100644
index 1589f81..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_create_new_folder_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_format_size_dark.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_format_size_dark.png
new file mode 100644
index 0000000..f1575d7
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xhdpi/ic_format_size_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_forward_black_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_forward_black_24dp.png
deleted file mode 100644
index ec952d4..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_forward_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png
deleted file mode 100644
index 46ed12a..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png
deleted file mode 100644
index 7de8581..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_reorder.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_reorder.png
new file mode 100644
index 0000000..d3ad70b
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xhdpi/ic_reorder.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png
deleted file mode 100644
index 860a5db..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png b/DoNExt/app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png
deleted file mode 100644
index b81d910..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_access_alarm.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_access_alarm.png
new file mode 100644
index 0000000..4d37868
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_access_alarm.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add.png
new file mode 100644
index 0000000..75f192a
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png
deleted file mode 100644
index 0fdced8..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_dark.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_dark.png
new file mode 100644
index 0000000..2600b90
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_white_24dp.png
deleted file mode 100644
index 54ca462..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_create_new_folder_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_format_size_dark.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_format_size_dark.png
new file mode 100644
index 0000000..fef9e59
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_format_size_dark.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_forward_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_forward_black_24dp.png
deleted file mode 100644
index 9a05bf2..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_forward_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png
deleted file mode 100644
index a81eeb9..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png
deleted file mode 100644
index ab8a9c4..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_reorder.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_reorder.png
new file mode 100644
index 0000000..817adb5
Binary files /dev/null and b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_reorder.png differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png
deleted file mode 100644
index f799008..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png
deleted file mode 100644
index f0a2bbc..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_add_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_add_white_24dp.png
deleted file mode 100644
index d64c22e..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_add_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_create_new_folder_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_create_new_folder_white_24dp.png
deleted file mode 100644
index 2e5dd82..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_create_new_folder_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_forward_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_forward_black_24dp.png
deleted file mode 100644
index 2187b5f..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_forward_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png
deleted file mode 100644
index c8f86b9..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png
deleted file mode 100644
index 86f89d7..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png
deleted file mode 100644
index b9f56f3..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_view_list_white_24dp.png b/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_view_list_white_24dp.png
deleted file mode 100644
index 7c3bdda..0000000
Binary files a/DoNExt/app/src/main/res/drawable-xxxhdpi/ic_view_list_white_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml b/DoNExt/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml
deleted file mode 100644
index 934b067..0000000
--- a/DoNExt/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/DoNExt/app/src/main/res/drawable/ic_reorder_grey_500_24dp.png b/DoNExt/app/src/main/res/drawable/ic_reorder_grey_500_24dp.png
deleted file mode 100644
index b2ebf02..0000000
Binary files a/DoNExt/app/src/main/res/drawable/ic_reorder_grey_500_24dp.png and /dev/null differ
diff --git a/DoNExt/app/src/main/res/layout-large/activity_main.xml b/DoNExt/app/src/main/res/layout-large/activity_main.xml
index e95120c..6862c4a 100644
--- a/DoNExt/app/src/main/res/layout-large/activity_main.xml
+++ b/DoNExt/app/src/main/res/layout-large/activity_main.xml
@@ -12,7 +12,6 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/AppTheme.AppBarOverlay">
@@ -24,7 +23,7 @@
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:onClick="onNewTaskClick"
- android:src="@drawable/ic_add_white_24dp" />
+ android:src="@drawable/ic_add" />
+ android:src="@drawable/ic_add" />
diff --git a/DoNExt/app/src/main/res/layout/activity_today.xml b/DoNExt/app/src/main/res/layout/activity_today.xml
index eaf8934..467768c 100644
--- a/DoNExt/app/src/main/res/layout/activity_today.xml
+++ b/DoNExt/app/src/main/res/layout/activity_today.xml
@@ -30,6 +30,6 @@
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:onClick="onNewTaskClick"
- android:src="@drawable/ic_add_white_24dp" />
+ android:src="@drawable/ic_add" />
diff --git a/DoNExt/app/src/main/res/layout/fragment_task_confirmation.xml b/DoNExt/app/src/main/res/layout/fragment_task_confirmation.xml
index ce1fa6d..bfb17db 100644
--- a/DoNExt/app/src/main/res/layout/fragment_task_confirmation.xml
+++ b/DoNExt/app/src/main/res/layout/fragment_task_confirmation.xml
@@ -7,7 +7,6 @@
android:id="@+id/task_confirmation_never"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/text_margin"
android:layout_marginStart="@dimen/text_margin"
android:layout_marginTop="10dp"
android:text="@string/task_confirmation_never_button" />
diff --git a/DoNExt/app/src/main/res/layout/fragment_task_form.xml b/DoNExt/app/src/main/res/layout/fragment_task_form.xml
deleted file mode 100644
index cec27bf..0000000
--- a/DoNExt/app/src/main/res/layout/fragment_task_form.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/DoNExt/app/src/main/res/layout/fragment_tasklist.xml b/DoNExt/app/src/main/res/layout/fragment_tasklist.xml
index 2a73470..1b27656 100644
--- a/DoNExt/app/src/main/res/layout/fragment_tasklist.xml
+++ b/DoNExt/app/src/main/res/layout/fragment_tasklist.xml
@@ -9,7 +9,7 @@
android:layout_height="match_parent"
android:layout_gravity="center_vertical|start"
android:scaleType="center"
- android:src="@drawable/ic_reorder_grey_500_24dp"
+ android:src="@drawable/ic_reorder"
android:contentDescription="@string/task_list_drag_handle"/>