From 08d6e39a17d499a01cb0bd1d1a055037c4c3e5ae Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 06:46:52 -0500 Subject: [PATCH 01/59] Throw exception when trying to undo deletion of habit --- .../java/org/isoron/uhabits/commands/DeleteHabitsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java b/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java index 6dff1f59d..7e4e201eb 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java @@ -41,7 +41,7 @@ public class DeleteHabitsCommand extends Command @Override public void undo() { - + throw new UnsupportedOperationException(); } public Integer getExecuteStringId() From fdf6c9192900513e8e1e4e0ad60339f9b4940d67 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 06:48:01 -0500 Subject: [PATCH 02/59] Use equals instead of operator --- .../java/org/isoron/uhabits/commands/EditHabitCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java b/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java index 53b4bbf1b..985275f40 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java @@ -33,8 +33,8 @@ public class EditHabitCommand extends Command this.modified = new Habit(modified); this.original = new Habit(original); - hasIntervalChanged = (this.original.freqDen != this.modified.freqDen || - this.original.freqNum != this.modified.freqNum); + hasIntervalChanged = (!this.original.freqDen.equals(this.modified.freqDen) || + !this.original.freqNum.equals(this.modified.freqNum)); } public void execute() From 0c0ac9dee54cd6c4fad8fbd119216c9b0a73dcdf Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 06:48:25 -0500 Subject: [PATCH 03/59] Minor formatting --- .../uhabits/fragments/EditHabitFragment.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java index 82a32d37d..84bbf4822 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java @@ -57,8 +57,15 @@ public class EditHabitFragment extends DialogFragment private OnSavedListener onSavedListener; - private Habit originalHabit, modifiedHabit; - private TextView tvName, tvDescription, tvFreqNum, tvFreqDen, tvReminderTime, tvReminderDays; + private Habit originalHabit; + private Habit modifiedHabit; + + private TextView tvName; + private TextView tvDescription; + private TextView tvFreqNum; + private TextView tvFreqDen; + private TextView tvReminderTime; + private TextView tvReminderDays; private SharedPreferences prefs; private boolean is24HourMode; @@ -96,13 +103,13 @@ public class EditHabitFragment extends DialogFragment Button buttonSave = (Button) view.findViewById(R.id.buttonSave); Button buttonDiscard = (Button) view.findViewById(R.id.buttonDiscard); + ImageButton buttonPickColor = (ImageButton) view.findViewById(R.id.buttonPickColor); buttonSave.setOnClickListener(this); buttonDiscard.setOnClickListener(this); tvReminderTime.setOnClickListener(this); tvReminderDays.setOnClickListener(this); - - ImageButton buttonPickColor = (ImageButton) view.findViewById(R.id.buttonPickColor); + buttonPickColor.setOnClickListener(this); prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); @@ -140,8 +147,6 @@ public class EditHabitFragment extends DialogFragment changeColor(modifiedHabit.color); updateReminder(); - buttonPickColor.setOnClickListener(this); - return view; } @@ -225,8 +230,6 @@ public class EditHabitFragment extends DialogFragment private void onSaveButtonClick() { - Command command = null; - modifiedHabit.name = tvName.getText().toString().trim(); modifiedHabit.description = tvDescription.getText().toString().trim(); modifiedHabit.freqNum = Integer.parseInt(tvFreqNum.getText().toString()); @@ -239,6 +242,7 @@ public class EditHabitFragment extends DialogFragment editor.putInt("pref_default_habit_freq_den", modifiedHabit.freqDen); editor.apply(); + Command command = null; Habit savedHabit = null; if (mode == EDIT_MODE) @@ -246,8 +250,10 @@ public class EditHabitFragment extends DialogFragment command = new EditHabitCommand(originalHabit, modifiedHabit); savedHabit = originalHabit; } - - if (mode == CREATE_MODE) command = new CreateHabitCommand(modifiedHabit); + else if (mode == CREATE_MODE) + { + command = new CreateHabitCommand(modifiedHabit); + } if (onSavedListener != null) onSavedListener.onSaved(command, savedHabit); @@ -325,6 +331,7 @@ public class EditHabitFragment extends DialogFragment int count = 0; for(int i = 0; i < 7; i++) if(selectedDays[i]) count++; + if(count == 0) Arrays.fill(selectedDays, true); modifiedHabit.reminderDays = DateHelper.packWeekdayList(selectedDays); From c8c4df6ef753c33e4df5ec47b61a476eb455367a Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 07:30:04 -0500 Subject: [PATCH 04/59] Split ListHabitsFragment into smaller classes --- .../dialogs/HabitSelectionCallback.java | 268 +++++++++++++++++ .../isoron/uhabits/dialogs/HintManager.java | 78 +++++ .../uhabits/fragments/EditHabitFragment.java | 4 +- .../uhabits/fragments/ListHabitsFragment.java | 278 ++---------------- 4 files changed, 378 insertions(+), 250 deletions(-) create mode 100644 app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java create mode 100644 app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java diff --git a/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java b/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java new file mode 100644 index 000000000..2283ffb9d --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java @@ -0,0 +1,268 @@ +/* Copyright (C) 2016 Alinson Santos Xavier + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.isoron.uhabits.dialogs; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; +import android.os.AsyncTask; +import android.view.ActionMode; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ProgressBar; + +import com.android.colorpicker.ColorPickerDialog; +import com.android.colorpicker.ColorPickerSwatch; + +import org.isoron.helpers.ColorHelper; +import org.isoron.helpers.DialogHelper; +import org.isoron.helpers.ReplayableActivity; +import org.isoron.uhabits.R; +import org.isoron.uhabits.commands.ArchiveHabitsCommand; +import org.isoron.uhabits.commands.ChangeHabitColorCommand; +import org.isoron.uhabits.commands.DeleteHabitsCommand; +import org.isoron.uhabits.commands.UnarchiveHabitsCommand; +import org.isoron.uhabits.fragments.EditHabitFragment; +import org.isoron.uhabits.io.CSVExporter; +import org.isoron.uhabits.loaders.HabitListLoader; +import org.isoron.uhabits.models.Habit; + +import java.io.File; +import java.util.LinkedList; +import java.util.List; + +public class HabitSelectionCallback implements ActionMode.Callback +{ + private HabitListLoader loader; + private List selectedPositions; + private ReplayableActivity activity; + private Listener listener; + private DialogHelper.OnSavedListener onSavedListener; + private ProgressBar progressBar; + + public interface Listener + { + void onActionModeDestroyed(ActionMode mode); + } + + public HabitSelectionCallback(ReplayableActivity activity, HabitListLoader loader) + { + this.activity = activity; + this.loader = loader; + selectedPositions = new LinkedList<>(); + } + + public void setListener(Listener listener) + { + this.listener = listener; + } + + public void setProgressBar(ProgressBar progressBar) + { + this.progressBar = progressBar; + } + + public void setOnSavedListener(DialogHelper.OnSavedListener onSavedListener) + { + this.onSavedListener = onSavedListener; + } + + public void setSelectedPositions(List selectedPositions) + { + this.selectedPositions = selectedPositions; + } + + @Override + public boolean onCreateActionMode(ActionMode mode, Menu menu) + { + activity.getMenuInflater().inflate(R.menu.list_habits_context, menu); + updateTitle(mode); + updateActions(menu); + return true; + } + + @Override + public boolean onPrepareActionMode(ActionMode mode, Menu menu) + { + updateTitle(mode); + updateActions(menu); + return true; + } + + private void updateActions(Menu menu) + { + boolean showEdit = (selectedPositions.size() == 1); + boolean showColor = true; + boolean showArchive = true; + boolean showUnarchive = true; + + if (showEdit) showColor = false; + for (int i : selectedPositions) + { + Habit h = loader.habitsList.get(i); + if (h.isArchived()) + { + showColor = false; + showArchive = false; + } + else showUnarchive = false; + } + + MenuItem itemEdit = menu.findItem(R.id.action_edit_habit); + MenuItem itemColor = menu.findItem(R.id.action_color); + MenuItem itemArchive = menu.findItem(R.id.action_archive_habit); + MenuItem itemUnarchive = menu.findItem(R.id.action_unarchive_habit); + + itemEdit.setVisible(showEdit); + itemColor.setVisible(showColor); + itemArchive.setVisible(showArchive); + itemUnarchive.setVisible(showUnarchive); + } + + private void updateTitle(ActionMode mode) + { + mode.setTitle("" + selectedPositions.size()); + } + + @Override + public boolean onActionItemClicked(final ActionMode mode, MenuItem item) + { + final LinkedList selectedHabits = new LinkedList<>(); + for (int i : selectedPositions) + selectedHabits.add(loader.habitsList.get(i)); + + Habit firstHabit = selectedHabits.getFirst(); + + switch (item.getItemId()) + { + case R.id.action_archive_habit: + activity.executeCommand(new ArchiveHabitsCommand(selectedHabits), null); + mode.finish(); + return true; + + case R.id.action_unarchive_habit: + activity.executeCommand(new UnarchiveHabitsCommand(selectedHabits), null); + mode.finish(); + return true; + + case R.id.action_edit_habit: + { + EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(firstHabit.getId()); + frag.setOnSavedListener(onSavedListener); + frag.show(activity.getFragmentManager(), "dialog"); + return true; + } + + case R.id.action_color: + { + ColorPickerDialog picker = ColorPickerDialog.newInstance(R.string.color_picker_default_title, + ColorHelper.palette, firstHabit.color, 4, ColorPickerDialog.SIZE_SMALL); + + picker.setOnColorSelectedListener(new ColorPickerSwatch.OnColorSelectedListener() + { + public void onColorSelected(int color) + { + activity.executeCommand( + new ChangeHabitColorCommand(selectedHabits, color), null); + mode.finish(); + } + }); + picker.show(activity.getFragmentManager(), "picker"); + return true; + } + + case R.id.action_delete: + { + new AlertDialog.Builder(activity).setTitle(R.string.delete_habits) + .setMessage(R.string.delete_habits_message) + .setPositiveButton(android.R.string.yes, + new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + activity.executeCommand( + new DeleteHabitsCommand(selectedHabits), null); + mode.finish(); + } + }).setNegativeButton(android.R.string.no, null) + .show(); + + return true; + } + + case R.id.action_export_csv: + { + onExportHabitsClick(selectedHabits); + return true; + } + } + + return false; + } + + @Override + public void onDestroyActionMode(ActionMode mode) + { + if(listener != null) listener.onActionModeDestroyed(mode); + } + + private void onExportHabitsClick(final LinkedList selectedHabits) + { + new AsyncTask() + { + String filename; + + @Override + protected void onPreExecute() + { + if(progressBar != null) + { + progressBar.setIndeterminate(true); + progressBar.setVisibility(View.VISIBLE); + } + } + + @Override + protected void onPostExecute(Void aVoid) + { + if(filename != null) + { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_SEND); + intent.setType("application/zip"); + intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(filename))); + + activity.startActivity(intent); + } + + if(progressBar != null) + progressBar.setVisibility(View.GONE); + } + + @Override + protected Void doInBackground(Void... params) + { + CSVExporter exporter = new CSVExporter(activity, selectedHabits); + filename = exporter.writeArchive(); + return null; + } + }.execute(); + } +} diff --git a/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java b/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java new file mode 100644 index 000000000..eee95a27d --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java @@ -0,0 +1,78 @@ +/* Copyright (C) 2016 Alinson Santos Xavier + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.isoron.uhabits.dialogs; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.view.View; +import android.widget.TextView; + +import org.isoron.helpers.DateHelper; +import org.isoron.uhabits.R; + +public class HintManager +{ + private Context context; + private SharedPreferences prefs; + private View hintView; + + public HintManager(Context context, View hintView) + { + this.context = context; + this.hintView = hintView; + prefs = PreferenceManager.getDefaultSharedPreferences(context); + } + + public void dismissHint() + { + hintView.animate().alpha(0f).setDuration(500).setListener(new AnimatorListenerAdapter() + { + @Override + public void onAnimationEnd(Animator animation) + { + hintView.setVisibility(View.GONE); + } + }); + } + + public void showHintIfAppropriate() + { + Integer lastHintNumber = prefs.getInt("last_hint_number", -1); + Long lastHintTimestamp = prefs.getLong("last_hint_timestamp", -1); + + if (DateHelper.getStartOfToday() > lastHintTimestamp) showHint(lastHintNumber + 1); + } + + private void showHint(int hintNumber) + { + String[] hints = context.getResources().getStringArray(R.array.hints); + if (hintNumber >= hints.length) return; + + prefs.edit().putInt("last_hint_number", hintNumber).apply(); + prefs.edit().putLong("last_hint_timestamp", DateHelper.getStartOfToday()).apply(); + + TextView tvContent = (TextView) hintView.findViewById(R.id.hintContent); + tvContent.setText(hints[hintNumber]); + + hintView.setAlpha(0.0f); + hintView.setVisibility(View.VISIBLE); + hintView.animate().alpha(1f).setDuration(500); + } +} diff --git a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java index 84bbf4822..cef7fa916 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java @@ -70,7 +70,7 @@ public class EditHabitFragment extends DialogFragment private SharedPreferences prefs; private boolean is24HourMode; - static EditHabitFragment editSingleHabitFragment(long id) + public static EditHabitFragment editSingleHabitFragment(long id) { EditHabitFragment frag = new EditHabitFragment(); Bundle args = new Bundle(); @@ -80,7 +80,7 @@ public class EditHabitFragment extends DialogFragment return frag; } - static EditHabitFragment createHabitFragment() + public static EditHabitFragment createHabitFragment() { EditHabitFragment frag = new EditHabitFragment(); Bundle args = new Bundle(); diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java index 278e54345..e94a2d3e4 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java @@ -16,19 +16,12 @@ package org.isoron.uhabits.fragments; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.app.Activity; -import android.app.AlertDialog; import android.app.Fragment; import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.Typeface; -import android.net.Uri; -import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; import android.util.DisplayMetrics; @@ -53,31 +46,24 @@ import android.widget.LinearLayout.LayoutParams; import android.widget.ProgressBar; import android.widget.TextView; -import com.android.colorpicker.ColorPickerDialog; -import com.android.colorpicker.ColorPickerSwatch; import com.mobeta.android.dslv.DragSortController; import com.mobeta.android.dslv.DragSortListView; import com.mobeta.android.dslv.DragSortListView.DropListener; -import org.isoron.helpers.ColorHelper; import org.isoron.helpers.Command; import org.isoron.helpers.DateHelper; import org.isoron.helpers.DialogHelper; import org.isoron.helpers.DialogHelper.OnSavedListener; import org.isoron.helpers.ReplayableActivity; import org.isoron.uhabits.R; -import org.isoron.uhabits.commands.ArchiveHabitsCommand; -import org.isoron.uhabits.commands.ChangeHabitColorCommand; -import org.isoron.uhabits.commands.DeleteHabitsCommand; import org.isoron.uhabits.commands.ToggleRepetitionCommand; -import org.isoron.uhabits.commands.UnarchiveHabitsCommand; +import org.isoron.uhabits.dialogs.HabitSelectionCallback; +import org.isoron.uhabits.dialogs.HintManager; import org.isoron.uhabits.helpers.ReminderHelper; -import org.isoron.uhabits.io.CSVExporter; import org.isoron.uhabits.loaders.HabitListLoader; import org.isoron.uhabits.models.Habit; import org.isoron.uhabits.models.Score; -import java.io.File; import java.util.Date; import java.util.GregorianCalendar; import java.util.LinkedList; @@ -85,156 +71,13 @@ import java.util.List; public class ListHabitsFragment extends Fragment implements OnSavedListener, OnItemClickListener, OnLongClickListener, DropListener, - OnClickListener, HabitListLoader.Listener, AdapterView.OnItemLongClickListener + OnClickListener, HabitListLoader.Listener, AdapterView.OnItemLongClickListener, + HabitSelectionCallback.Listener { - private class ListHabitsActionBarCallback implements ActionMode.Callback - { - @Override - public boolean onCreateActionMode(ActionMode mode, Menu menu) - { - getActivity().getMenuInflater().inflate(R.menu.list_habits_context, menu); - updateTitle(mode); - updateActions(menu); - return true; - } - - @Override - public boolean onPrepareActionMode(ActionMode mode, Menu menu) - { - updateTitle(mode); - updateActions(menu); - return true; - } - - private void updateActions(Menu menu) - { - boolean showEdit = (selectedPositions.size() == 1); - boolean showColor = true; - boolean showArchive = true; - boolean showUnarchive = true; - - if(showEdit) showColor = false; - for(int i : selectedPositions) - { - Habit h = loader.habitsList.get(i); - if(h.isArchived()) - { - showColor = false; - showArchive = false; - } - else showUnarchive = false; - } - - MenuItem itemEdit = menu.findItem(R.id.action_edit_habit); - MenuItem itemColor = menu.findItem(R.id.action_color); - MenuItem itemArchive = menu.findItem(R.id.action_archive_habit); - MenuItem itemUnarchive = menu.findItem(R.id.action_unarchive_habit); - - itemEdit.setVisible(showEdit); - itemColor.setVisible(showColor); - itemArchive.setVisible(showArchive); - itemUnarchive.setVisible(showUnarchive); - } - - private void updateTitle(ActionMode mode) - { - mode.setTitle("" + selectedPositions.size()); - } - - @Override - public boolean onActionItemClicked(final ActionMode mode, MenuItem item) - { - final LinkedList selectedHabits = new LinkedList<>(); - for(int i : selectedPositions) - selectedHabits.add(loader.habitsList.get(i)); - - Habit firstHabit = selectedHabits.getFirst(); - - switch(item.getItemId()) - { - case R.id.action_archive_habit: - executeCommand(new ArchiveHabitsCommand(selectedHabits), null); - mode.finish(); - return true; - - case R.id.action_unarchive_habit: - executeCommand(new UnarchiveHabitsCommand(selectedHabits), null); - mode.finish(); - return true; - - case R.id.action_edit_habit: - { - EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(firstHabit.getId()); - frag.setOnSavedListener(ListHabitsFragment.this); - frag.show(getFragmentManager(), "dialog"); - return true; - } - - case R.id.action_color: - { - ColorPickerDialog picker = ColorPickerDialog.newInstance( - R.string.color_picker_default_title, ColorHelper.palette, - firstHabit.color, 4, ColorPickerDialog.SIZE_SMALL); - - picker.setOnColorSelectedListener(new ColorPickerSwatch.OnColorSelectedListener() - { - public void onColorSelected(int color) - { - executeCommand(new ChangeHabitColorCommand(selectedHabits, color), null); - mode.finish(); - } - }); - picker.show(getFragmentManager(), "picker"); - return true; - } - - case R.id.action_delete: - { - new AlertDialog.Builder(activity) - .setTitle(R.string.delete_habits) - .setMessage(R.string.delete_habits_message) - .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() - { - @Override - public void onClick(DialogInterface dialog, int which) - { - executeCommand(new DeleteHabitsCommand(selectedHabits), null); - mode.finish(); - } - }).setNegativeButton(android.R.string.no, null) - .show(); - - return true; - } - - case R.id.action_export_csv: - { - onExportHabitsClick(selectedHabits); - return true; - } - } - - return false; - } - - @Override - public void onDestroyActionMode(ActionMode mode) - { - actionMode = null; - - selectedPositions.clear(); - adapter.notifyDataSetChanged(); - - listView.setDragEnabled(true); - } - } public static final int INACTIVE_COLOR = Color.rgb(200, 200, 200); public static final int INACTIVE_CHECKMARK_COLOR = Color.rgb(230, 230, 230); - public static final int HINT_INTERVAL = 5; - public static final int HINT_INTERVAL_OFFSET = 2; - public interface OnHabitClickListener { void onHabitClicked(Habit habit); @@ -249,7 +92,6 @@ public class ListHabitsFragment extends Fragment private int tvNameWidth; private int buttonCount; private View llEmpty; - private View llHint; private OnHabitClickListener habitClickListener; private boolean isShortToggleEnabled; @@ -260,9 +102,10 @@ public class ListHabitsFragment extends Fragment private ActionMode actionMode; private List selectedPositions; - private DragSortController dragSortController; private ProgressBar progressBar; + private HintManager hintManager; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) @@ -302,26 +145,29 @@ public class ListHabitsFragment extends Fragment } }); - dragSortController = new DragSortController(listView) { - @Override - public View onCreateFloatView(int position) - { - return adapter.getView(position, null, null); - } + DragSortController dragSortController = new DragSortController(listView) + { + @Override + public View onCreateFloatView(int position) + { + return adapter.getView(position, null, null); + } @Override public void onDestroyFloatView(View floatView) { } }; + dragSortController.setRemoveEnabled(false); listView.setFloatViewManager(dragSortController); listView.setDragEnabled(true); listView.setLongClickable(true); - llHint = view.findViewById(R.id.llHint); + View llHint = view.findViewById(R.id.llHint); llHint.setOnClickListener(this); + hintManager = new HintManager(activity, llHint); Typeface fontawesome = Typeface.createFromAsset(getActivity().getAssets(), "fontawesome-webfont.ttf"); @@ -332,7 +178,6 @@ public class ListHabitsFragment extends Fragment setHasOptionsMenu(true); selectedPositions = new LinkedList<>(); - return view; } @@ -358,7 +203,7 @@ public class ListHabitsFragment extends Fragment updateEmptyMessage(); updateHeader(); - showNextHint(); + hintManager.showHintIfAppropriate(); adapter.notifyDataSetChanged(); isShortToggleEnabled = prefs.getBoolean("pref_short_toggle", false); @@ -485,8 +330,13 @@ public class ListHabitsFragment extends Fragment if(actionMode == null) { - actionMode = getActivity().startActionMode(new ListHabitsActionBarCallback()); -// listView.setDragEnabled(false); + HabitSelectionCallback callback = new HabitSelectionCallback(activity, loader); + callback.setSelectedPositions(selectedPositions); + callback.setProgressBar(progressBar); + callback.setOnSavedListener(this); + callback.setListener(this); + + actionMode = getActivity().startActionMode(callback); } if(actionMode != null) actionMode.invalidate(); @@ -555,43 +405,6 @@ public class ListHabitsFragment extends Fragment activity.executeCommand(c, refreshKey); } - private void hideHint() - { - llHint.animate().alpha(0f).setDuration(500).setListener(new AnimatorListenerAdapter() - { - @Override - public void onAnimationEnd(Animator animation) - { - llHint.setVisibility(View.GONE); - } - }); - } - - private void showNextHint() - { - Integer lastHintNumber = prefs.getInt("last_hint_number", -1); - Long lastHintTimestamp = prefs.getLong("last_hint_timestamp", -1); - - if(DateHelper.getStartOfToday() > lastHintTimestamp) - showHint(lastHintNumber + 1); - } - - private void showHint(int hintNumber) - { - String[] hints = activity.getResources().getStringArray(R.array.hints); - if(hintNumber >= hints.length) return; - - prefs.edit().putInt("last_hint_number", hintNumber).apply(); - prefs.edit().putLong("last_hint_timestamp", DateHelper.getStartOfToday()).apply(); - - TextView tvContent = (TextView) llHint.findViewById(R.id.hintContent); - tvContent.setText(hints[hintNumber]); - - llHint.setAlpha(0.0f); - llHint.setVisibility(View.VISIBLE); - llHint.animate().alpha(1f).setDuration(500); - } - @Override public void drop(int from, int to) { @@ -614,7 +427,7 @@ public class ListHabitsFragment extends Fragment break; case R.id.llHint: - hideHint(); + hintManager.dismissHint(); break; } } @@ -798,42 +611,11 @@ public class ListHabitsFragment extends Fragment else loader.updateHabit(refreshKey); } - private void onExportHabitsClick(final LinkedList selectedHabits) + public void onActionModeDestroyed(ActionMode mode) { - new AsyncTask() - { - String filename; - - @Override - protected void onPreExecute() - { - progressBar.setIndeterminate(true); - progressBar.setVisibility(View.VISIBLE); - } - - @Override - protected void onPostExecute(Void aVoid) - { - if(filename != null) - { - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_SEND); - intent.setType("application/zip"); - intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(filename))); - - startActivity(intent); - } - - progressBar.setVisibility(View.GONE); - } - - @Override - protected Void doInBackground(Void... params) - { - CSVExporter exporter = new CSVExporter(activity, selectedHabits); - filename = exporter.writeArchive(); - return null; - } - }.execute(); + actionMode = null; + selectedPositions.clear(); + adapter.notifyDataSetChanged(); + listView.setDragEnabled(true); } } From 8a60dda74ea8991945c2aa24084d5efc23568b97 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 08:33:17 -0500 Subject: [PATCH 05/59] Further simplify ListHabitsFragment --- .../uhabits/fragments/HabitListAdapter.java | 130 +++++++++++ .../uhabits/fragments/ListHabitsFragment.java | 214 ++---------------- .../uhabits/helpers/ListHabitsHelper.java | 127 +++++++++++ 3 files changed, 274 insertions(+), 197 deletions(-) create mode 100644 app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java create mode 100644 app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java diff --git a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java new file mode 100644 index 000000000..75611a769 --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java @@ -0,0 +1,130 @@ +package org.isoron.uhabits.fragments; + +import android.content.Context; +import android.graphics.Typeface; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.isoron.helpers.DateHelper; +import org.isoron.uhabits.R; +import org.isoron.uhabits.helpers.ListHabitsHelper; +import org.isoron.uhabits.loaders.HabitListLoader; +import org.isoron.uhabits.models.Habit; + +import java.util.List; + +class HabitListAdapter extends BaseAdapter +{ + private final int buttonCount; + private final int tvNameWidth; + private LayoutInflater inflater; + private Typeface fontawesome; + private HabitListLoader loader; + private ListHabitsHelper helper; + private List selectedPositions; + private View.OnLongClickListener onCheckmarkLongClickListener; + private View.OnClickListener onCheckmarkClickListener; + + public HabitListAdapter(Context context, HabitListLoader loader) + { + this.loader = loader; + + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + fontawesome = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf"); + helper = new ListHabitsHelper(context, loader); + + buttonCount = helper.getButtonCount(); + tvNameWidth = helper.getHabitNameWidth(); + } + + @Override + public int getCount() + { + return loader.habits.size(); + } + + @Override + public Object getItem(int position) + { + return loader.habitsList.get(position); + } + + @Override + public long getItemId(int position) + { + return ((Habit) getItem(position)).getId(); + } + + @Override + public View getView(int position, View view, ViewGroup parent) + { + final Habit habit = loader.habitsList.get(position); + + if (view == null || (Long) view.getTag(R.id.timestamp_key) != DateHelper.getStartOfToday()) + { + view = inflater.inflate(R.layout.list_habits_item, null); + ((TextView) view.findViewById(R.id.tvStar)).setTypeface(fontawesome); + + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(tvNameWidth, + LinearLayout.LayoutParams.WRAP_CONTENT, 1); + view.findViewById(R.id.label).setLayoutParams(params); + + inflateCheckmarkButtons(view); + + view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday()); + } + + TextView tvStar = ((TextView) view.findViewById(R.id.tvStar)); + TextView tvName = (TextView) view.findViewById(R.id.label); + LinearLayout llInner = (LinearLayout) view.findViewById(R.id.llInner); + LinearLayout llButtons = (LinearLayout) view.findViewById(R.id.llButtons); + + llInner.setTag(R.string.habit_key, habit.getId()); + + helper.updateNameAndIcon(habit, tvStar, tvName); + helper.updateCheckmarkButtons(habit, llButtons); + + boolean selected = selectedPositions.contains(position); + if (selected) llInner.setBackgroundResource(R.drawable.selected_box); + else + { + if (android.os.Build.VERSION.SDK_INT >= 21) + llInner.setBackgroundResource(R.drawable.ripple_white); + else llInner.setBackgroundResource(R.drawable.card_background); + } + + return view; + } + + private void inflateCheckmarkButtons(View view) + { + for (int i = 0; i < buttonCount; i++) + { + View check = inflater.inflate(R.layout.list_habits_item_check, null); + TextView btCheck = (TextView) check.findViewById(R.id.tvCheck); + btCheck.setTypeface(fontawesome); + btCheck.setOnLongClickListener(onCheckmarkLongClickListener); + btCheck.setOnClickListener(onCheckmarkClickListener); + ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); + } + } + + public void setSelectedPositions(List selectedPositions) + { + this.selectedPositions = selectedPositions; + } + + public void setOnCheckmarkLongClickListener(View.OnLongClickListener listener) + { + this.onCheckmarkLongClickListener = listener; + } + + public void setOnCheckmarkClickListener(View.OnClickListener listener) + { + this.onCheckmarkClickListener = listener; + } +} diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java index e94a2d3e4..1fe715da4 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java @@ -18,13 +18,10 @@ package org.isoron.uhabits.fragments; import android.app.Activity; import android.app.Fragment; -import android.content.Context; import android.content.SharedPreferences; -import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import android.preference.PreferenceManager; -import android.util.DisplayMetrics; import android.view.ActionMode; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; @@ -39,10 +36,8 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; -import android.widget.BaseAdapter; import android.widget.Button; import android.widget.LinearLayout; -import android.widget.LinearLayout.LayoutParams; import android.widget.ProgressBar; import android.widget.TextView; @@ -59,10 +54,10 @@ import org.isoron.uhabits.R; import org.isoron.uhabits.commands.ToggleRepetitionCommand; import org.isoron.uhabits.dialogs.HabitSelectionCallback; import org.isoron.uhabits.dialogs.HintManager; +import org.isoron.uhabits.helpers.ListHabitsHelper; import org.isoron.uhabits.helpers.ReminderHelper; import org.isoron.uhabits.loaders.HabitListLoader; import org.isoron.uhabits.models.Habit; -import org.isoron.uhabits.models.Score; import java.util.Date; import java.util.GregorianCalendar; @@ -74,23 +69,17 @@ public class ListHabitsFragment extends Fragment OnClickListener, HabitListLoader.Listener, AdapterView.OnItemLongClickListener, HabitSelectionCallback.Listener { - - public static final int INACTIVE_COLOR = Color.rgb(200, 200, 200); - public static final int INACTIVE_CHECKMARK_COLOR = Color.rgb(230, 230, 230); - public interface OnHabitClickListener { void onHabitClicked(Habit habit); } - ListHabitsAdapter adapter; + HabitListAdapter adapter; DragSortListView listView; ReplayableActivity activity; TextView tvNameHeader; long lastLongClick = 0; - private int tvNameWidth; - private int buttonCount; private View llEmpty; private OnHabitClickListener habitClickListener; @@ -105,19 +94,18 @@ public class ListHabitsFragment extends Fragment private ProgressBar progressBar; private HintManager hintManager; + private ListHabitsHelper helper; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - DisplayMetrics dm = getResources().getDisplayMetrics(); - int width = (int) (dm.widthPixels / dm.density); - buttonCount = Math.max(0, (int) ((width - 160) / 42.0)); - tvNameWidth = (int) ((width - 30 - buttonCount * 42) * dm.density); - + selectedPositions = new LinkedList<>(); loader = new HabitListLoader(); + helper = new ListHabitsHelper(activity, loader); + loader.setListener(this); - loader.setCheckmarkCount(buttonCount); + loader.setCheckmarkCount(helper.getButtonCount()); View view = inflater.inflate(R.layout.list_habits_fragment, container, false); tvNameHeader = (TextView) view.findViewById(R.id.tvNameHeader); @@ -125,7 +113,11 @@ public class ListHabitsFragment extends Fragment progressBar = (ProgressBar) view.findViewById(R.id.progressBar); loader.setProgressBar(progressBar); - adapter = new ListHabitsAdapter(getActivity()); + adapter = new HabitListAdapter(getActivity(), loader); + adapter.setSelectedPositions(selectedPositions); + adapter.setOnCheckmarkClickListener(this); + adapter.setOnCheckmarkLongClickListener(this); + listView = (DragSortListView) view.findViewById(R.id.listView); listView.setAdapter(adapter); listView.setOnItemClickListener(this); @@ -177,7 +169,6 @@ public class ListHabitsFragment extends Fragment loader.updateAllHabits(true); setHasOptionsMenu(true); - selectedPositions = new LinkedList<>(); return view; } @@ -221,7 +212,7 @@ public class ListHabitsFragment extends Fragment LinearLayout llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader); llButtonsHeader.removeAllViews(); - for (int i = 0; i < buttonCount; i++) + for (int i = 0; i < helper.getButtonCount(); i++) { View tvDay = inflater.inflate(R.layout.list_habits_header_check, null); Button btCheck = (Button) tvDay.findViewById(R.id.tvCheck); @@ -394,8 +385,10 @@ public class ListHabitsFragment extends Fragment long timestamp = DateHelper.getStartOfDay( DateHelper.getLocalTime() - offset * DateHelper.millisecondsInOneDay); - if (v.getTag(R.string.toggle_key).equals(2)) updateCheckmark(habit.color, (TextView) v, 0); - else updateCheckmark(habit.color, (TextView) v, 2); + if (v.getTag(R.string.toggle_key).equals(2)) + helper.updateCheckmark(habit.color, (TextView) v, 0); + else + helper.updateCheckmark(habit.color, (TextView) v, 2); executeCommand(new ToggleRepetitionCommand(habit, timestamp), habit.getId()); } @@ -432,179 +425,6 @@ public class ListHabitsFragment extends Fragment } } - class ListHabitsAdapter extends BaseAdapter - { - private LayoutInflater inflater; - private Typeface fontawesome; - - public ListHabitsAdapter(Context context) - { - - inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - fontawesome = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf"); - } - - @Override - public int getCount() - { - return loader.habits.size(); - } - - @Override - public Object getItem(int position) - { - return loader.habitsList.get(position); - } - - @Override - public long getItemId(int position) - { - return ((Habit) getItem(position)).getId(); - } - - @Override - public View getView(int position, View view, ViewGroup parent) - { - final Habit habit = loader.habitsList.get(position); - - if (view == null || - (Long) view.getTag(R.id.timestamp_key) != DateHelper.getStartOfToday()) - { - view = inflater.inflate(R.layout.list_habits_item, null); - ((TextView) view.findViewById(R.id.tvStar)).setTypeface(fontawesome); - - LinearLayout.LayoutParams params = - new LinearLayout.LayoutParams(tvNameWidth, LayoutParams.WRAP_CONTENT, 1); - view.findViewById(R.id.label).setLayoutParams(params); - - inflateCheckmarkButtons(view); - - view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday()); - } - - TextView tvStar = ((TextView) view.findViewById(R.id.tvStar)); - TextView tvName = (TextView) view.findViewById(R.id.label); - LinearLayout llInner = (LinearLayout) view.findViewById(R.id.llInner); - LinearLayout llButtons = (LinearLayout) view.findViewById(R.id.llButtons); - - llInner.setTag(R.string.habit_key, habit.getId()); - - updateNameAndIcon(habit, tvStar, tvName); - updateCheckmarkButtons(habit, llButtons); - - boolean selected = selectedPositions.contains(position); - if(selected) - llInner.setBackgroundResource(R.drawable.selected_box); - else - { - if (android.os.Build.VERSION.SDK_INT >= 21) - llInner.setBackgroundResource(R.drawable.ripple_white); - else - llInner.setBackgroundResource(R.drawable.card_background); - } - - return view; - } - - private void inflateCheckmarkButtons(View view) - { - for (int i = 0; i < buttonCount; i++) - { - View check = inflater.inflate(R.layout.list_habits_item_check, null); - TextView btCheck = (TextView) check.findViewById(R.id.tvCheck); - btCheck.setTypeface(fontawesome); - btCheck.setOnLongClickListener(ListHabitsFragment.this); - btCheck.setOnClickListener(ListHabitsFragment.this); - ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); - } - } - } - - private void updateCheckmarkButtons(Habit habit, LinearLayout llButtons) - { - int activeColor = getActiveColor(habit); - int m = llButtons.getChildCount(); - Long habitId = habit.getId(); - - int isChecked[] = loader.checkmarks.get(habitId); - - for (int i = 0; i < m; i++) - { - - TextView tvCheck = (TextView) llButtons.getChildAt(i); - tvCheck.setTag(R.string.habit_key, habitId); - tvCheck.setTag(R.string.offset_key, i); - if(isChecked.length > i) - updateCheckmark(activeColor, tvCheck, isChecked[i]); - } - } - - private void updateNameAndIcon(Habit habit, TextView tvStar, TextView tvName) - { - int activeColor = getActiveColor(habit); - - tvName.setText(habit.name); - tvName.setTextColor(activeColor); - - if (habit.isArchived()) - { - tvStar.setText(getString(R.string.fa_archive)); - tvStar.setTextColor(activeColor); - } - else - { - int score = loader.scores.get(habit.getId()); - - if (score < Score.HALF_STAR_CUTOFF) - { - tvStar.setText(getString(R.string.fa_star_o)); - tvStar.setTextColor(INACTIVE_COLOR); - } - else if (score < Score.FULL_STAR_CUTOFF) - { - tvStar.setText(getString(R.string.fa_star_half_o)); - tvStar.setTextColor(INACTIVE_COLOR); - } - else - { - tvStar.setText(getString(R.string.fa_star)); - tvStar.setTextColor(activeColor); - } - } - } - - private int getActiveColor(Habit habit) - { - int activeColor = habit.color; - if(habit.isArchived()) activeColor = INACTIVE_COLOR; - - return activeColor; - } - - private void updateCheckmark(int activeColor, TextView tvCheck, int check) - { - switch (check) - { - case 2: - tvCheck.setText(R.string.fa_check); - tvCheck.setTextColor(activeColor); - tvCheck.setTag(R.string.toggle_key, 2); - break; - - case 1: - tvCheck.setText(R.string.fa_check); - tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR); - tvCheck.setTag(R.string.toggle_key, 1); - break; - - case 0: - tvCheck.setText(R.string.fa_times); - tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR); - tvCheck.setTag(R.string.toggle_key, 0); - break; - } - } - public void onPostExecuteCommand(Long refreshKey) { if (refreshKey == null) loader.updateAllHabits(true); diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java new file mode 100644 index 000000000..79230ab10 --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java @@ -0,0 +1,127 @@ +package org.isoron.uhabits.helpers; + +import android.content.Context; +import android.graphics.Color; +import android.util.DisplayMetrics; +import android.widget.LinearLayout; +import android.widget.TextView; + +import org.isoron.uhabits.R; +import org.isoron.uhabits.loaders.HabitListLoader; +import org.isoron.uhabits.models.Habit; +import org.isoron.uhabits.models.Score; + +public class ListHabitsHelper +{ + public static final int INACTIVE_COLOR = Color.rgb(200, 200, 200); + public static final int INACTIVE_CHECKMARK_COLOR = Color.rgb(230, 230, 230); + + private final Context context; + private final HabitListLoader loader; + + public ListHabitsHelper(Context context, HabitListLoader loader) + { + this.context = context; + this.loader = loader; + } + + public int getButtonCount() + { + DisplayMetrics dm = context.getResources().getDisplayMetrics(); + int width = (int) (dm.widthPixels / dm.density); + return Math.max(0, (int) ((width - 160) / 42.0)); + } + + public int getHabitNameWidth() + { + DisplayMetrics dm = context.getResources().getDisplayMetrics(); + int width = (int) (dm.widthPixels / dm.density); + return (int) ((width - 30 - getButtonCount() * 42) * dm.density); + } + + public void updateCheckmarkButtons(Habit habit, LinearLayout llButtons) + { + int activeColor = getActiveColor(habit); + int m = llButtons.getChildCount(); + Long habitId = habit.getId(); + + int isChecked[] = loader.checkmarks.get(habitId); + + for (int i = 0; i < m; i++) + { + + TextView tvCheck = (TextView) llButtons.getChildAt(i); + tvCheck.setTag(R.string.habit_key, habitId); + tvCheck.setTag(R.string.offset_key, i); + if(isChecked.length > i) + updateCheckmark(activeColor, tvCheck, isChecked[i]); + } + } + + public int getActiveColor(Habit habit) + { + int activeColor = habit.color; + if(habit.isArchived()) activeColor = INACTIVE_COLOR; + + return activeColor; + } + + public void updateNameAndIcon(Habit habit, TextView tvStar, + TextView tvName) + { + int activeColor = getActiveColor(habit); + + tvName.setText(habit.name); + tvName.setTextColor(activeColor); + + if (habit.isArchived()) + { + tvStar.setText(context.getString(R.string.fa_archive)); + tvStar.setTextColor(activeColor); + } + else + { + int score = loader.scores.get(habit.getId()); + + if (score < Score.HALF_STAR_CUTOFF) + { + tvStar.setText(context.getString(R.string.fa_star_o)); + tvStar.setTextColor(INACTIVE_COLOR); + } + else if (score < Score.FULL_STAR_CUTOFF) + { + tvStar.setText(context.getString(R.string.fa_star_half_o)); + tvStar.setTextColor(INACTIVE_COLOR); + } + else + { + tvStar.setText(context.getString(R.string.fa_star)); + tvStar.setTextColor(activeColor); + } + } + } + + public void updateCheckmark(int activeColor, TextView tvCheck, int check) + { + switch (check) + { + case 2: + tvCheck.setText(R.string.fa_check); + tvCheck.setTextColor(activeColor); + tvCheck.setTag(R.string.toggle_key, 2); + break; + + case 1: + tvCheck.setText(R.string.fa_check); + tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR); + tvCheck.setTag(R.string.toggle_key, 1); + break; + + case 0: + tvCheck.setText(R.string.fa_times); + tvCheck.setTextColor(INACTIVE_CHECKMARK_COLOR); + tvCheck.setTag(R.string.toggle_key, 0); + break; + } + } +} From ced5b751be4745d3db2ec412373bd650af6d3b95 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 08:43:09 -0500 Subject: [PATCH 06/59] Move methods to helper --- .../uhabits/fragments/HabitListAdapter.java | 29 ++------------- .../uhabits/helpers/ListHabitsHelper.java | 37 +++++++++++++++++++ 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java index 75611a769..bdf1cbc48 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java @@ -1,7 +1,6 @@ package org.isoron.uhabits.fragments; import android.content.Context; -import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -22,7 +21,6 @@ class HabitListAdapter extends BaseAdapter private final int buttonCount; private final int tvNameWidth; private LayoutInflater inflater; - private Typeface fontawesome; private HabitListLoader loader; private ListHabitsHelper helper; private List selectedPositions; @@ -34,7 +32,6 @@ class HabitListAdapter extends BaseAdapter this.loader = loader; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - fontawesome = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf"); helper = new ListHabitsHelper(context, loader); buttonCount = helper.getButtonCount(); @@ -67,13 +64,14 @@ class HabitListAdapter extends BaseAdapter if (view == null || (Long) view.getTag(R.id.timestamp_key) != DateHelper.getStartOfToday()) { view = inflater.inflate(R.layout.list_habits_item, null); - ((TextView) view.findViewById(R.id.tvStar)).setTypeface(fontawesome); + ((TextView) view.findViewById(R.id.tvStar)).setTypeface(helper.getFontawesome()); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(tvNameWidth, LinearLayout.LayoutParams.WRAP_CONTENT, 1); view.findViewById(R.id.label).setLayoutParams(params); - inflateCheckmarkButtons(view); + helper.inflateCheckmarkButtons(view, onCheckmarkLongClickListener, + onCheckmarkClickListener, inflater); view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday()); } @@ -89,30 +87,11 @@ class HabitListAdapter extends BaseAdapter helper.updateCheckmarkButtons(habit, llButtons); boolean selected = selectedPositions.contains(position); - if (selected) llInner.setBackgroundResource(R.drawable.selected_box); - else - { - if (android.os.Build.VERSION.SDK_INT >= 21) - llInner.setBackgroundResource(R.drawable.ripple_white); - else llInner.setBackgroundResource(R.drawable.card_background); - } + helper.updateHabitBackground(llInner, selected); return view; } - private void inflateCheckmarkButtons(View view) - { - for (int i = 0; i < buttonCount; i++) - { - View check = inflater.inflate(R.layout.list_habits_item_check, null); - TextView btCheck = (TextView) check.findViewById(R.id.tvCheck); - btCheck.setTypeface(fontawesome); - btCheck.setOnLongClickListener(onCheckmarkLongClickListener); - btCheck.setOnClickListener(onCheckmarkClickListener); - ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); - } - } - public void setSelectedPositions(List selectedPositions) { this.selectedPositions = selectedPositions; diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java index 79230ab10..4c7b5dd1d 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java @@ -2,7 +2,10 @@ package org.isoron.uhabits.helpers; import android.content.Context; import android.graphics.Color; +import android.graphics.Typeface; import android.util.DisplayMetrics; +import android.view.LayoutInflater; +import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; @@ -18,11 +21,19 @@ public class ListHabitsHelper private final Context context; private final HabitListLoader loader; + private Typeface fontawesome; public ListHabitsHelper(Context context, HabitListLoader loader) { this.context = context; this.loader = loader; + + fontawesome = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf"); + } + + public Typeface getFontawesome() + { + return fontawesome; } public int getButtonCount() @@ -124,4 +135,30 @@ public class ListHabitsHelper break; } } + + public void updateHabitBackground(View view, boolean isSelected) + { + if (isSelected) + view.setBackgroundResource(R.drawable.selected_box); + else + { + if (android.os.Build.VERSION.SDK_INT >= 21) + view.setBackgroundResource(R.drawable.ripple_white); + else view.setBackgroundResource(R.drawable.card_background); + } + } + + public void inflateCheckmarkButtons(View view, View.OnLongClickListener onLongClickListener, + View.OnClickListener onClickListener, LayoutInflater inflater) + { + for (int i = 0; i < getButtonCount(); i++) + { + View check = inflater.inflate(R.layout.list_habits_item_check, null); + TextView btCheck = (TextView) check.findViewById(R.id.tvCheck); + btCheck.setTypeface(fontawesome); + btCheck.setOnLongClickListener(onLongClickListener); + btCheck.setOnClickListener(onClickListener); + ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); + } + } } From f8dc64cc6b11f7aaeea348024b8953a4faae5bde Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 5 Mar 2016 16:13:48 -0500 Subject: [PATCH 07/59] Move time and color pickers resources into separate file --- .../main/res/values/dimens_color_picker.xml | 7 ----- .../{dimens_date_time.xml => pickers.xml} | 27 +++++++++++++++-- app/src/main/res/values/strings.xml | 29 ++++--------------- app/src/main/res/values/styles_show_habit.xml | 2 -- 4 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 app/src/main/res/values/dimens_color_picker.xml rename app/src/main/res/values/{dimens_date_time.xml => pickers.xml} (59%) delete mode 100644 app/src/main/res/values/styles_show_habit.xml diff --git a/app/src/main/res/values/dimens_color_picker.xml b/app/src/main/res/values/dimens_color_picker.xml deleted file mode 100644 index 27517fbae..000000000 --- a/app/src/main/res/values/dimens_color_picker.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 64dip - 48dip - 8dip - 4dip - \ No newline at end of file diff --git a/app/src/main/res/values/dimens_date_time.xml b/app/src/main/res/values/pickers.xml similarity index 59% rename from app/src/main/res/values/dimens_date_time.xml rename to app/src/main/res/values/pickers.xml index 201590689..a515da332 100644 --- a/app/src/main/res/values/dimens_date_time.xml +++ b/app/src/main/res/values/pickers.xml @@ -1,5 +1,10 @@ - - + + + 64dip + 48dip + 8dip + 4dip + 0.82 0.85 0.16 @@ -39,4 +44,22 @@ 16sp 64dp 22dp + + Color %1$d + Color %1$d selected + + + Hours circular slider + Minutes circular slider + Month grid of days + Year list + Select month and day + Select year + %1$s selected + %1$s deleted + -- + : + sans-serif + sans-serif + sans-serif \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cd1e5b642..2a68a68c0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - + Loop Habit Tracker Habits @@ -21,28 +21,6 @@ Habits archived. Habits unarchived. - Color %1$d - Color %1$d selected - - - Done - Clear - Hours circular slider - Minutes circular slider - Select hours - Select minutes - Month grid of days - Year list - Select month and day - Select year - %1$s selected - %1$s deleted - -- - : - sans-serif - sans-serif - sans-serif - Overview Habit strength @@ -111,6 +89,11 @@ Select days Export data + Done + Clear + Select hours + Select minutes + @string/hint_drag @string/hint_landscape diff --git a/app/src/main/res/values/styles_show_habit.xml b/app/src/main/res/values/styles_show_habit.xml deleted file mode 100644 index a6b3daec9..000000000 --- a/app/src/main/res/values/styles_show_habit.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file From aaf2789a21abceda32a6d6924653f671b66866f2 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sun, 6 Mar 2016 06:00:12 -0500 Subject: [PATCH 08/59] Include contributing section --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 065430702..435a18fff 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,25 @@ There are absolutely no advertisements, annoying notifications or intrusive perm [![Habit history and streaks][screen4th]][screen4] [![Widgets][screen5th]][screen5] +## Contributing + +Loop is an open source project developed entirely by volunteers. If you would like to +contribute to the project, you are very welcome. There are many ways to contribute, +even if you are not a software developer. + +* **Report bugs, suggest features.** The easiest way to contribute is to simply + use the app and let us know if you find any problems or have any suggestions to improve + it. You can either use the link inside the app, or open an issue at GitHub. + +* **Translate the app into your own language.** If you are not a native English speaker, and would + like to see the app translated into your own language, please join our [open translation project + at POEditor][poedit]. + +* **Write some code.** If you are an Android developer, code contributions are very welcome. This + repository uses the [git-flow branching model][gitflow]. Please, submit pull requests against the + dev branch. This is the branch that will eventually become the next version of the app. + + [screen1]: screenshots/original/uhabits1.png [screen2]: screenshots/original/uhabits2.png [screen3]: screenshots/original/uhabits3.png @@ -45,3 +64,5 @@ There are absolutely no advertisements, annoying notifications or intrusive perm [screen3th]: screenshots/thumbs/uhabits3.png [screen4th]: screenshots/thumbs/uhabits4.png [screen5th]: screenshots/thumbs/uhabits5.png +[poedit]: https://poeditor.com/join/project/8DWX5pfjS0 +[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/ From e0527dc8ffc10fa351539e2cc3e586c8c7c04c69 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sun, 6 Mar 2016 08:33:03 -0500 Subject: [PATCH 09/59] Implement about screen --- app/src/main/AndroidManifest.xml | 44 ++++----- .../org/isoron/uhabits/AboutActivity.java | 93 ++++++++++++++++++ .../java/org/isoron/uhabits/MainActivity.java | 9 ++ app/src/main/res/layout/about.xml | 98 +++++++++++++++++++ app/src/main/res/menu/list_habits_menu.xml | 6 ++ app/src/main/res/values-pt/strings.xml | 6 +- app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 13 ++- app/src/main/res/values/styles.xml | 14 +++ app/src/main/res/xml/preferences.xml | 37 ++----- 10 files changed, 260 insertions(+), 62 deletions(-) create mode 100644 app/src/main/java/org/isoron/uhabits/AboutActivity.java create mode 100644 app/src/main/res/layout/about.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c224ffa93..382aaf243 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,20 +1,16 @@ - - - + + - + android:maxSdkVersion="18"/> + android:maxSdkVersion="18"/> - - - @@ -39,15 +32,14 @@ - + + - + - + - + - + - + @@ -119,13 +111,15 @@ - - - + + diff --git a/app/src/main/java/org/isoron/uhabits/AboutActivity.java b/app/src/main/java/org/isoron/uhabits/AboutActivity.java new file mode 100644 index 000000000..56bd2ac0b --- /dev/null +++ b/app/src/main/java/org/isoron/uhabits/AboutActivity.java @@ -0,0 +1,93 @@ +/* Copyright (C) 2016 Alinson Santos Xavier + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.isoron.uhabits; + +import android.app.Activity; +import android.content.Intent; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import org.isoron.helpers.ColorHelper; + +public class AboutActivity extends Activity implements View.OnClickListener +{ + + @Override + protected void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + setContentView(R.layout.about); + + if (android.os.Build.VERSION.SDK_INT >= 21) + { + int color = getResources().getColor(R.color.blue_700); + int darkerColor = ColorHelper.mixColors(color, Color.BLACK, 0.75f); + getActionBar().setBackgroundDrawable(new ColorDrawable(color)); + getWindow().setStatusBarColor(darkerColor); + } + + TextView tvVersion = (TextView) findViewById(R.id.tvVersion); + TextView tvRate = (TextView) findViewById(R.id.tvRate); + TextView tvFeedback = (TextView) findViewById(R.id.tvFeedback); + TextView tvSource = (TextView) findViewById(R.id.tvSource); + + tvVersion.setText(String.format("%s %s", getResources().getString(R.string.version), + BuildConfig.VERSION_NAME)); + tvRate.setOnClickListener(this); + tvFeedback.setOnClickListener(this); + tvSource.setOnClickListener(this); + } + + @Override + public void onClick(View v) + { + switch (v.getId()) + { + case R.id.tvRate: + { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse("market://details?id=org.isoron.uhabits")); + startActivity(intent); + break; + } + + case R.id.tvFeedback: + { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_SENDTO); + intent.setData(Uri.parse("mailto:isoron+habits@gmail.com?" + + "subject=Feedback%20about%20Loop%20Habit%20Tracker")); + startActivity(intent); + break; + } + + case R.id.tvSource: + { + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse("https://github.com/iSoron/uhabits")); + startActivity(intent); + break; + } + } + } +} diff --git a/app/src/main/java/org/isoron/uhabits/MainActivity.java b/app/src/main/java/org/isoron/uhabits/MainActivity.java index e9f07bd01..1a449dcfa 100644 --- a/app/src/main/java/org/isoron/uhabits/MainActivity.java +++ b/app/src/main/java/org/isoron/uhabits/MainActivity.java @@ -117,9 +117,18 @@ public class MainActivity extends ReplayableActivity switch (item.getItemId()) { case R.id.action_settings: + { Intent intent = new Intent(this, SettingsActivity.class); startActivity(intent); return true; + } + + case R.id.action_about: + { + Intent intent = new Intent(this, AboutActivity.class); + startActivity(intent); + return true; + } default: return super.onOptionsItemSelected(item); diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml new file mode 100644 index 000000000..86639ca2c --- /dev/null +++ b/app/src/main/res/layout/about.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/list_habits_menu.xml b/app/src/main/res/menu/list_habits_menu.xml index c87717e70..94bbaf1e9 100644 --- a/app/src/main/res/menu/list_habits_menu.xml +++ b/app/src/main/res/menu/list_habits_menu.xml @@ -15,4 +15,10 @@ android:title="@string/action_settings" app:showAsAction="never"/> + + diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 1c98c7aac..ec5923c36 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,7 +19,7 @@ --> - Hábitos + Loop Habit Tracker Configurações Adicionar hábito Arquivar @@ -102,4 +102,8 @@ Qualquer dia Selecionar dias Exportar dados + Sobre + Desenvolvedores + Tradutores + Versão \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6748fdb6c..5c1f87568 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -259,7 +259,7 @@ - + #1976D2 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cd1e5b642..944911ba8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -21,8 +21,8 @@ Habits archived. Habits unarchived. - Color %1$d - Color %1$d selected + Color %1$d + Color %1$d selected Done @@ -35,8 +35,8 @@ Year list Select month and day Select year - %1$s selected - %1$s deleted + %1$s selected + %1$s deleted -- : sans-serif @@ -116,4 +116,9 @@ @string/hint_landscape + About + Translators + Developers + Version + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index aa7af6379..883c1a90d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -61,4 +61,18 @@ wrap_content + + + + diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 5d5cfab56..153cf80e6 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -21,36 +21,11 @@ - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file From ea8606be9748a65d76697a9456904bc212d8fbc2 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sun, 6 Mar 2016 21:58:02 -0500 Subject: [PATCH 10/59] More details to the code contribution subsection --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 435a18fff..27d0d736d 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,11 @@ even if you are not a software developer. like to see the app translated into your own language, please join our [open translation project at POEditor][poedit]. -* **Write some code.** If you are an Android developer, code contributions are very welcome. This - repository uses the [git-flow branching model][gitflow]. Please, submit pull requests against the +* **Write some code.** If you are an Android developer, you are very welcome to contribute with code. + If you already have an idea in mind, you can either implement it and then send a pull request, or open an issue + first, to discuss your idea before you start your work. If you are out of ideas, have a look at the open issues. + Tasks that are easier to implement have the green label *small-task*. + This repository uses the [git-flow branching model][gitflow]. Please, submit pull requests against the dev branch. This is the branch that will eventually become the next version of the app. From 4fb386be86fcc4c104edbb13dd89b708fb921396 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 05:29:05 -0500 Subject: [PATCH 11/59] Include building and installing instructions Closes #11 --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 27d0d736d..720996f85 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,21 @@ even if you are not a software developer. This repository uses the [git-flow branching model][gitflow]. Please, submit pull requests against the dev branch. This is the branch that will eventually become the next version of the app. +## Installing + +The easiest way to install Loop is through the [Google Play Store][playstore]. You may also download and install +the APK from the [releases page][releases]; note, however, that the app will not be updated automatically. +To build this app from the source code, you will need to install the [Android SDK Manager][sdk], then run the following commands. + + git clone https://github.com/iSoron/uhabits.git + cd uhabits + git submodule update --init + ./gradlew assembleDebug + +The generated APK will be located in `app/build/outputs/apk/`. It can be installed on the +device through [adb][adb]: + + adb install app/build/outputs/apk/app-debug.apk [screen1]: screenshots/original/uhabits1.png [screen2]: screenshots/original/uhabits2.png @@ -69,3 +84,7 @@ even if you are not a software developer. [screen5th]: screenshots/thumbs/uhabits5.png [poedit]: https://poeditor.com/join/project/8DWX5pfjS0 [gitflow]: http://nvie.com/posts/a-successful-git-branching-model/ +[sdk]: https://developer.android.com/sdk/installing/index.html?pkg=studio +[playstore]: https://play.google.com/store/apps/details?id=org.isoron.uhabits +[releases]: https://github.com/iSoron/uhabits/releases +[adb]: https://developer.android.com/tools/help/adb.html From 9014acc548c86b7b2acac804e2435ba562aa1a0c Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sun, 6 Mar 2016 08:46:21 -0500 Subject: [PATCH 12/59] Remove settings menu from ShowHabitActivity --- .../org/isoron/uhabits/ShowHabitActivity.java | 24 ------------------- .../res/menu/show_habit_activity_menu.xml | 12 ---------- 2 files changed, 36 deletions(-) delete mode 100644 app/src/main/res/menu/show_habit_activity_menu.xml diff --git a/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java b/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java index 3eba606ba..cc4c6002d 100644 --- a/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java +++ b/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java @@ -17,12 +17,9 @@ package org.isoron.uhabits; import android.content.ContentUris; -import android.content.Intent; import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Bundle; -import android.view.Menu; -import android.view.MenuItem; import org.isoron.helpers.ReplayableActivity; import org.isoron.uhabits.models.Habit; @@ -48,25 +45,4 @@ public class ShowHabitActivity extends ReplayableActivity setContentView(R.layout.show_habit_activity); } - - @Override - public boolean onCreateOptionsMenu(Menu menu) - { - getMenuInflater().inflate(R.menu.show_habit_activity_menu, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) - { - switch (item.getItemId()) - { - case R.id.action_settings: - Intent intent = new Intent(this, SettingsActivity.class); - startActivity(intent); - return true; - } - - return super.onOptionsItemSelected(item); - } } diff --git a/app/src/main/res/menu/show_habit_activity_menu.xml b/app/src/main/res/menu/show_habit_activity_menu.xml deleted file mode 100644 index 7d2a0cf17..000000000 --- a/app/src/main/res/menu/show_habit_activity_menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - From 09f615a5e6da57e8d0a591584df941243926a2db Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 05:38:49 -0500 Subject: [PATCH 13/59] Update translations --- app/src/main/java/org/isoron/uhabits/AboutActivity.java | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-zh/strings.xml | 5 +++++ app/src/main/res/values/strings.xml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/AboutActivity.java b/app/src/main/java/org/isoron/uhabits/AboutActivity.java index 56bd2ac0b..f649d6036 100644 --- a/app/src/main/java/org/isoron/uhabits/AboutActivity.java +++ b/app/src/main/java/org/isoron/uhabits/AboutActivity.java @@ -49,7 +49,7 @@ public class AboutActivity extends Activity implements View.OnClickListener TextView tvFeedback = (TextView) findViewById(R.id.tvFeedback); TextView tvSource = (TextView) findViewById(R.id.tvSource); - tvVersion.setText(String.format("%s %s", getResources().getString(R.string.version), + tvVersion.setText(String.format(getResources().getString(R.string.version_n), BuildConfig.VERSION_NAME)); tvRate.setOnClickListener(this); tvFeedback.setOnClickListener(this); diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index ec5923c36..47600b1d5 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -105,5 +105,5 @@ Sobre Desenvolvedores Tradutores - Versão + Versão %s \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index e1a260566..cb198a11b 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -92,4 +92,9 @@ 选择天数 习惯恢复成功 周末 + 关于应用 + 开发者 + 翻译者 + 导出数据 + %s版 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 944911ba8..a256b43ef 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -119,6 +119,6 @@ About Translators Developers - Version + Version %s \ No newline at end of file From 0114b48197e0a69a2dbc0cc79fbd4e1146a5171f Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 05:44:02 -0500 Subject: [PATCH 14/59] Fix formatting; include license section --- README.md | 104 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 720996f85..3d8b13c77 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,42 @@ # Loop Habit Tracker -Loop is a simple Android app that helps you create and maintain good habits, allowing you to achieve your long-term goals. Detailed graphs and statistics show you how your habits improved over time. It is completely ad-free and open source. +Loop is a simple Android app that helps you create and maintain good habits, +allowing you to achieve your long-term goals. Detailed graphs and statistics +show you how your habits improved over time. It is completely ad-free and open +source. Get it on Google Play ## Features -Simple, beautiful and modern interface -Loop has a minimalistic interface that is easy to use and follows the material design guidelines. +* **Simple, beautiful and modern interface.** Loop has a minimalistic interface + that is easy to use and follows the material design guidelines. -Habit score -In addition to showing your current streak, Loop has an advanced algorithm for calculating the strength of your habits. Every repetition makes your habit stronger, and every missed day makes it weaker. A few missed days after a long streak, however, will not completely destroy your entire progress. +* **Habit score.** In addition to showing your current streak, Loop has an + advanced algorithm for calculating the strength of your habits. Every + repetition makes your habit stronger, and every missed day makes it weaker. A + few missed days after a long streak, however, will not completely destroy + your entire progress. -Detailed graphs and statistics -Clearly see how your habits improved over time with beautiful and detailed graphs. Scroll back to see the complete history of your habits. +* **Detailed graphs and statistics.** Clearly see how your habits improved over + time with beautiful and detailed graphs. Scroll back to see the complete + history of your habits. -Flexible schedules -Supports both daily habits and habits with more complex schedules, such as 3 times every week; one time every other week; or every other day. +* **Flexible schedules.** Supports both daily habits and habits with more + complex schedules, such as 3 times every week; one time every other week; or + every other day. -Reminders -Create an individual reminder for each habit, at a chosen hour of the day. Easily check, dismiss or snooze your habit directly from the notification, without opening the app. +* **Reminders.** Create an individual reminder for each habit, at a chosen hour + of the day. Easily check, dismiss or snooze your habit directly from the + notification, without opening the app. -Optimized for smartwatches -Reminders can be checked, snoozed or dismissed directly from your Android Wear watch. +* **Optimized for smartwatches.** Reminders can be checked, snoozed or + dismissed directly from your Android Wear watch. -Completely ad-free and open source -There are absolutely no advertisements, annoying notifications or intrusive permissions in this app, and there will never be. The complete source code is available under the GPLv3. +* **Completely ad-free and open source.** There are absolutely no + advertisements, annoying notifications or intrusive permissions in this app, + and there will never be. The complete source code is available under the + GPLv3. ## Screenshots @@ -37,41 +48,62 @@ There are absolutely no advertisements, annoying notifications or intrusive perm ## Contributing -Loop is an open source project developed entirely by volunteers. If you would like to -contribute to the project, you are very welcome. There are many ways to contribute, -even if you are not a software developer. +Loop is an open source project developed entirely by volunteers. If you would +like to contribute to the project, you are very welcome. There are many ways to +contribute, even if you are not a software developer. * **Report bugs, suggest features.** The easiest way to contribute is to simply - use the app and let us know if you find any problems or have any suggestions to improve - it. You can either use the link inside the app, or open an issue at GitHub. - -* **Translate the app into your own language.** If you are not a native English speaker, and would - like to see the app translated into your own language, please join our [open translation project - at POEditor][poedit]. - -* **Write some code.** If you are an Android developer, you are very welcome to contribute with code. - If you already have an idea in mind, you can either implement it and then send a pull request, or open an issue - first, to discuss your idea before you start your work. If you are out of ideas, have a look at the open issues. - Tasks that are easier to implement have the green label *small-task*. - This repository uses the [git-flow branching model][gitflow]. Please, submit pull requests against the - dev branch. This is the branch that will eventually become the next version of the app. + use the app and let us know if you find any problems or have any suggestions + to improve it. You can either use the link inside the app, or open an issue + at GitHub. + +* **Translate the app into your own language.** If you are not a native English + speaker, and would like to see the app translated into your own language, + please join our [open translation project at POEditor][poedit]. + +* **Write some code.** If you are an Android developer, you are very welcome to + contribute with code. If you already have an idea in mind, you can either + implement it and then send a pull request, or open an issue first, to discuss + your idea before you start your work. If you are out of ideas, have a look at + the open issues. Tasks that are easier to implement have the green label + *small-task*. This repository uses the [git-flow branching model][gitflow]. + Please, submit pull requests against the dev branch. This is the branch that + will eventually become the next version of the app. ## Installing -The easiest way to install Loop is through the [Google Play Store][playstore]. You may also download and install -the APK from the [releases page][releases]; note, however, that the app will not be updated automatically. -To build this app from the source code, you will need to install the [Android SDK Manager][sdk], then run the following commands. +The easiest way to install Loop is through the [Google Play Store][playstore]. +You may also download and install the APK from the [releases page][releases]; +note, however, that the app will not be updated automatically. To build this +app from the source code, you will need to install the [Android SDK +Manager][sdk], then run the following commands. git clone https://github.com/iSoron/uhabits.git cd uhabits git submodule update --init ./gradlew assembleDebug -The generated APK will be located in `app/build/outputs/apk/`. It can be installed on the -device through [adb][adb]: +The generated APK will be located in `app/build/outputs/apk/`. It can be +installed on the device through [adb][adb]: adb install app/build/outputs/apk/app-debug.apk + +## License + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . + [screen1]: screenshots/original/uhabits1.png [screen2]: screenshots/original/uhabits2.png [screen3]: screenshots/original/uhabits3.png From 49af55a2dee1cdbd471113f8701687964325a9d9 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 07:31:06 -0500 Subject: [PATCH 15/59] Move more methods to helper --- .../uhabits/fragments/ListHabitsFragment.java | 63 +++++-------------- .../uhabits/helpers/ListHabitsHelper.java | 36 +++++++++++ 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java index 1fe715da4..0c6c779ed 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java @@ -36,7 +36,6 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; -import android.widget.Button; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -60,7 +59,6 @@ import org.isoron.uhabits.loaders.HabitListLoader; import org.isoron.uhabits.models.Habit; import java.util.Date; -import java.util.GregorianCalendar; import java.util.LinkedList; import java.util.List; @@ -74,10 +72,12 @@ public class ListHabitsFragment extends Fragment void onHabitClicked(Habit habit); } - HabitListAdapter adapter; - DragSortListView listView; - ReplayableActivity activity; - TextView tvNameHeader; + private HabitListAdapter adapter; + private DragSortListView listView; + private ReplayableActivity activity; + private TextView tvNameHeader; + private LinearLayout llButtonsHeader; + long lastLongClick = 0; private View llEmpty; @@ -161,9 +161,8 @@ public class ListHabitsFragment extends Fragment llHint.setOnClickListener(this); hintManager = new HintManager(activity, llHint); - Typeface fontawesome = Typeface.createFromAsset(getActivity().getAssets(), - "fontawesome-webfont.ttf"); - ((TextView) view.findViewById(R.id.tvStarEmpty)).setTypeface(fontawesome); + ((TextView) view.findViewById(R.id.tvStarEmpty)).setTypeface(helper.getFontawesome()); + llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader); llEmpty = view.findViewById(R.id.llEmpty); loader.updateAllHabits(true); @@ -192,42 +191,19 @@ public class ListHabitsFragment extends Fragment if (timestamp != null && timestamp != DateHelper.getStartOfToday()) loader.updateAllHabits(true); - updateEmptyMessage(); - updateHeader(); + helper.updateEmptyMessage(llEmpty); + helper.updateHeader(llButtonsHeader); hintManager.showHintIfAppropriate(); adapter.notifyDataSetChanged(); isShortToggleEnabled = prefs.getBoolean("pref_short_toggle", false); } - private void updateHeader() - { - LayoutInflater inflater = activity.getLayoutInflater(); - View view = getView(); - - if (view == null) return; - - GregorianCalendar day = DateHelper.getStartOfTodayCalendar(); - - LinearLayout llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader); - llButtonsHeader.removeAllViews(); - - for (int i = 0; i < helper.getButtonCount(); i++) - { - View tvDay = inflater.inflate(R.layout.list_habits_header_check, null); - Button btCheck = (Button) tvDay.findViewById(R.id.tvCheck); - btCheck.setText(DateHelper.formatHeaderDate(day)); - llButtonsHeader.addView(tvDay); - - day.add(GregorianCalendar.DAY_OF_MONTH, -1); - } - } - @Override public void onLoadFinished() { adapter.notifyDataSetChanged(); - updateEmptyMessage(); + helper.updateEmptyMessage(llEmpty); } @Override @@ -347,12 +323,6 @@ public class ListHabitsFragment extends Fragment if(actionMode != null) actionMode.finish(); } - private void updateEmptyMessage() - { - if (loader.getLastLoadTimestamp() == null) llEmpty.setVisibility(View.GONE); - else llEmpty.setVisibility(loader.habits.size() > 0 ? View.GONE : View.VISIBLE); - } - @Override public boolean onLongClick(View v) { @@ -379,17 +349,14 @@ public class ListHabitsFragment extends Fragment private void toggleCheck(View v) { Long tag = (Long) v.getTag(R.string.habit_key); - Habit habit = loader.habits.get(tag); - - int offset = (Integer) v.getTag(R.string.offset_key); + Integer offset = (Integer) v.getTag(R.string.offset_key); long timestamp = DateHelper.getStartOfDay( DateHelper.getLocalTime() - offset * DateHelper.millisecondsInOneDay); - if (v.getTag(R.string.toggle_key).equals(2)) - helper.updateCheckmark(habit.color, (TextView) v, 0); - else - helper.updateCheckmark(habit.color, (TextView) v, 2); + Habit habit = loader.habits.get(tag); + if(habit == null) return; + helper.toggleCheckmarkView(v, habit); executeCommand(new ToggleRepetitionCommand(habit, timestamp), habit.getId()); } diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java index 4c7b5dd1d..813259259 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java @@ -6,14 +6,19 @@ import android.graphics.Typeface; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; +import org.isoron.helpers.DateHelper; import org.isoron.uhabits.R; import org.isoron.uhabits.loaders.HabitListLoader; import org.isoron.uhabits.models.Habit; import org.isoron.uhabits.models.Score; +import java.util.GregorianCalendar; + public class ListHabitsHelper { public static final int INACTIVE_COLOR = Color.rgb(200, 200, 200); @@ -161,4 +166,35 @@ public class ListHabitsHelper ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); } } + + public void updateHeader(ViewGroup header) + { + LayoutInflater inflater = LayoutInflater.from(context); + GregorianCalendar day = DateHelper.getStartOfTodayCalendar(); + header.removeAllViews(); + + for (int i = 0; i < getButtonCount(); i++) + { + View tvDay = inflater.inflate(R.layout.list_habits_header_check, null); + Button btCheck = (Button) tvDay.findViewById(R.id.tvCheck); + btCheck.setText(DateHelper.formatHeaderDate(day)); + header.addView(tvDay); + + day.add(GregorianCalendar.DAY_OF_MONTH, -1); + } + } + + public void updateEmptyMessage(View view) + { + if (loader.getLastLoadTimestamp() == null) view.setVisibility(View.GONE); + else view.setVisibility(loader.habits.size() > 0 ? View.GONE : View.VISIBLE); + } + + public void toggleCheckmarkView(View v, Habit habit) + { + if (v.getTag(R.string.toggle_key).equals(2)) + updateCheckmark(habit.color, (TextView) v, 0); + else + updateCheckmark(habit.color, (TextView) v, 2); + } } From 0c00e9ec2dcbe9c4d79d503f1d09698a01d60855 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 07:51:48 -0500 Subject: [PATCH 16/59] Simplify constructor --- .../uhabits/fragments/ListHabitsFragment.java | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java index 0c6c779ed..2268a3269 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java @@ -19,7 +19,6 @@ package org.isoron.uhabits.fragments; import android.app.Activity; import android.app.Fragment; import android.content.SharedPreferences; -import android.graphics.Typeface; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.ActionMode; @@ -67,104 +66,66 @@ public class ListHabitsFragment extends Fragment OnClickListener, HabitListLoader.Listener, AdapterView.OnItemLongClickListener, HabitSelectionCallback.Listener { - public interface OnHabitClickListener - { - void onHabitClicked(Habit habit); - } - - private HabitListAdapter adapter; - private DragSortListView listView; - private ReplayableActivity activity; - private TextView tvNameHeader; - private LinearLayout llButtonsHeader; - long lastLongClick = 0; - - private View llEmpty; - - private OnHabitClickListener habitClickListener; private boolean isShortToggleEnabled; - - private HabitListLoader loader; private boolean showArchived; - private SharedPreferences prefs; private ActionMode actionMode; - private List selectedPositions; - private ProgressBar progressBar; - + private HabitListAdapter adapter; + private HabitListLoader loader; private HintManager hintManager; private ListHabitsHelper helper; + private List selectedPositions; + private OnHabitClickListener habitClickListener; + private ReplayableActivity activity; + private SharedPreferences prefs; + + private DragSortListView listView; + private LinearLayout llButtonsHeader; + private ProgressBar progressBar; + private View llEmpty; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.list_habits_fragment, container, false); + View llHint = view.findViewById(R.id.llHint); + TextView tvStarEmpty = (TextView) view.findViewById(R.id.tvStarEmpty); + listView = (DragSortListView) view.findViewById(R.id.listView); + llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader); + llEmpty = view.findViewById(R.id.llEmpty); + progressBar = (ProgressBar) view.findViewById(R.id.progressBar); + selectedPositions = new LinkedList<>(); loader = new HabitListLoader(); helper = new ListHabitsHelper(activity, loader); + hintManager = new HintManager(activity, llHint); loader.setListener(this); loader.setCheckmarkCount(helper.getButtonCount()); - - View view = inflater.inflate(R.layout.list_habits_fragment, container, false); - tvNameHeader = (TextView) view.findViewById(R.id.tvNameHeader); - - progressBar = (ProgressBar) view.findViewById(R.id.progressBar); loader.setProgressBar(progressBar); + llHint.setOnClickListener(this); + tvStarEmpty.setTypeface(helper.getFontawesome()); + adapter = new HabitListAdapter(getActivity(), loader); adapter.setSelectedPositions(selectedPositions); adapter.setOnCheckmarkClickListener(this); adapter.setOnCheckmarkLongClickListener(this); - listView = (DragSortListView) view.findViewById(R.id.listView); + DragSortListView.DragListener dragListener = new HabitsDragListener(); + DragSortController dragSortController = new HabitsDragSortController(); + listView.setAdapter(adapter); listView.setOnItemClickListener(this); listView.setOnItemLongClickListener(this); listView.setDropListener(this); - listView.setDragListener(new DragSortListView.DragListener() - { - @Override - public void drag(int from, int to) - { - } - - @Override - public void startDrag(int position) - { - selectItem(position); - } - }); - - DragSortController dragSortController = new DragSortController(listView) - { - @Override - public View onCreateFloatView(int position) - { - return adapter.getView(position, null, null); - } - - @Override - public void onDestroyFloatView(View floatView) - { - } - }; - - dragSortController.setRemoveEnabled(false); - + listView.setDragListener(dragListener); listView.setFloatViewManager(dragSortController); listView.setDragEnabled(true); listView.setLongClickable(true); - View llHint = view.findViewById(R.id.llHint); - llHint.setOnClickListener(this); - hintManager = new HintManager(activity, llHint); - - ((TextView) view.findViewById(R.id.tvStarEmpty)).setTypeface(helper.getFontawesome()); - llButtonsHeader = (LinearLayout) view.findViewById(R.id.llButtonsHeader); - llEmpty = view.findViewById(R.id.llEmpty); - loader.updateAllHabits(true); setHasOptionsMenu(true); @@ -405,4 +366,43 @@ public class ListHabitsFragment extends Fragment adapter.notifyDataSetChanged(); listView.setDragEnabled(true); } + + public interface OnHabitClickListener + { + void onHabitClicked(Habit habit); + } + + private class HabitsDragSortController extends DragSortController + { + public HabitsDragSortController() + { + super(ListHabitsFragment.this.listView); + setRemoveEnabled(false); + } + + @Override + public View onCreateFloatView(int position) + { + return adapter.getView(position, null, null); + } + + @Override + public void onDestroyFloatView(View floatView) + { + } + } + + private class HabitsDragListener implements DragSortListView.DragListener + { + @Override + public void drag(int from, int to) + { + } + + @Override + public void startDrag(int position) + { + selectItem(position); + } + } } From 146c743fb898f574ac93f69966478791e4c1eaa3 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 08:03:30 -0500 Subject: [PATCH 17/59] Simplify list adapter --- .../uhabits/fragments/HabitListAdapter.java | 16 ++-------------- .../isoron/uhabits/helpers/ListHabitsHelper.java | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java index bdf1cbc48..32379e678 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java @@ -18,8 +18,6 @@ import java.util.List; class HabitListAdapter extends BaseAdapter { - private final int buttonCount; - private final int tvNameWidth; private LayoutInflater inflater; private HabitListLoader loader; private ListHabitsHelper helper; @@ -31,11 +29,8 @@ class HabitListAdapter extends BaseAdapter { this.loader = loader; - inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + inflater = LayoutInflater.from(context); helper = new ListHabitsHelper(context, loader); - - buttonCount = helper.getButtonCount(); - tvNameWidth = helper.getHabitNameWidth(); } @Override @@ -64,16 +59,9 @@ class HabitListAdapter extends BaseAdapter if (view == null || (Long) view.getTag(R.id.timestamp_key) != DateHelper.getStartOfToday()) { view = inflater.inflate(R.layout.list_habits_item, null); - ((TextView) view.findViewById(R.id.tvStar)).setTypeface(helper.getFontawesome()); - - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(tvNameWidth, - LinearLayout.LayoutParams.WRAP_CONTENT, 1); - view.findViewById(R.id.label).setLayoutParams(params); - + helper.initializeLabelAndIcon(view); helper.inflateCheckmarkButtons(view, onCheckmarkLongClickListener, onCheckmarkClickListener, inflater); - - view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday()); } TextView tvStar = ((TextView) view.findViewById(R.id.tvStar)); diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java index 813259259..e06015db7 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java @@ -82,8 +82,17 @@ public class ListHabitsHelper return activeColor; } - public void updateNameAndIcon(Habit habit, TextView tvStar, - TextView tvName) + public void initializeLabelAndIcon(View itemView) + { + TextView tvStar = (TextView) itemView.findViewById(R.id.tvStar); + tvStar.setTypeface(getFontawesome()); + + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getHabitNameWidth(), + LinearLayout.LayoutParams.WRAP_CONTENT, 1); + itemView.findViewById(R.id.label).setLayoutParams(params); + } + + public void updateNameAndIcon(Habit habit, TextView tvStar, TextView tvName) { int activeColor = getActiveColor(habit); @@ -165,6 +174,8 @@ public class ListHabitsHelper btCheck.setOnClickListener(onClickListener); ((LinearLayout) view.findViewById(R.id.llButtons)).addView(check); } + + view.setTag(R.id.timestamp_key, DateHelper.getStartOfToday()); } public void updateHeader(ViewGroup header) From 2cfc8094900f533395f8fb9b1e2a30959e600002 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 7 Mar 2016 15:48:34 -0500 Subject: [PATCH 18/59] Update copyright notices in all files --- app/src/main/AndroidManifest.xml | 19 +++++++++++++++ .../java/org/isoron/helpers/ColorHelper.java | 23 ++++++++++-------- .../main/java/org/isoron/helpers/Command.java | 23 ++++++++++-------- .../java/org/isoron/helpers/DateHelper.java | 23 ++++++++++-------- .../java/org/isoron/helpers/DialogHelper.java | 23 ++++++++++-------- .../isoron/helpers/ReplayableActivity.java | 23 ++++++++++-------- .../org/isoron/uhabits/AboutActivity.java | 23 ++++++++++-------- .../uhabits/HabitBroadcastReceiver.java | 23 ++++++++++-------- .../org/isoron/uhabits/HabitsBackupAgent.java | 23 ++++++++++-------- .../org/isoron/uhabits/IntroActivity.java | 23 ++++++++++-------- .../java/org/isoron/uhabits/MainActivity.java | 23 ++++++++++-------- .../org/isoron/uhabits/SettingsActivity.java | 23 ++++++++++-------- .../org/isoron/uhabits/ShowHabitActivity.java | 23 ++++++++++-------- .../commands/ArchiveHabitsCommand.java | 23 ++++++++++-------- .../commands/ChangeHabitColorCommand.java | 23 ++++++++++-------- .../uhabits/commands/CreateHabitCommand.java | 23 ++++++++++-------- .../uhabits/commands/DeleteHabitsCommand.java | 23 ++++++++++-------- .../uhabits/commands/EditHabitCommand.java | 23 ++++++++++-------- .../commands/ToggleRepetitionCommand.java | 23 ++++++++++-------- .../commands/UnarchiveHabitsCommand.java | 23 ++++++++++-------- .../dialogs/HabitSelectionCallback.java | 23 ++++++++++-------- .../isoron/uhabits/dialogs/HintManager.java | 23 ++++++++++-------- .../uhabits/dialogs/WeekdayPickerDialog.java | 19 +++++++++++++++ .../uhabits/fragments/EditHabitFragment.java | 23 ++++++++++-------- .../uhabits/fragments/HabitListAdapter.java | 19 +++++++++++++++ .../uhabits/fragments/ListHabitsFragment.java | 23 ++++++++++-------- .../uhabits/fragments/SettingsFragment.java | 23 ++++++++++-------- .../uhabits/fragments/ShowHabitFragment.java | 23 ++++++++++-------- .../uhabits/helpers/ListHabitsHelper.java | 19 +++++++++++++++ .../uhabits/helpers/ReminderHelper.java | 23 ++++++++++-------- .../org/isoron/uhabits/io/CSVExporter.java | 19 +++++++++++++++ .../uhabits/loaders/HabitListLoader.java | 24 +++++++++---------- .../org/isoron/uhabits/models/Checkmark.java | 23 ++++++++++-------- .../isoron/uhabits/models/CheckmarkList.java | 23 ++++++++++-------- .../java/org/isoron/uhabits/models/Habit.java | 23 ++++++++++-------- .../org/isoron/uhabits/models/Repetition.java | 23 ++++++++++-------- .../isoron/uhabits/models/RepetitionList.java | 23 ++++++++++-------- .../java/org/isoron/uhabits/models/Score.java | 23 ++++++++++-------- .../org/isoron/uhabits/models/ScoreList.java | 23 ++++++++++-------- .../org/isoron/uhabits/models/Streak.java | 23 ++++++++++-------- .../org/isoron/uhabits/models/StreakList.java | 23 ++++++++++-------- .../isoron/uhabits/views/CheckmarkView.java | 23 ++++++++++-------- .../uhabits/views/HabitHistoryView.java | 23 ++++++++++-------- .../isoron/uhabits/views/HabitScoreView.java | 23 ++++++++++-------- .../isoron/uhabits/views/HabitStreakView.java | 23 ++++++++++-------- .../org/isoron/uhabits/views/RingView.java | 23 ++++++++++-------- .../uhabits/views/ScrollableDataView.java | 24 +++++++++---------- .../uhabits/widgets/BaseWidgetProvider.java | 23 ++++++++++-------- .../widgets/CheckmarkWidgetProvider.java | 23 ++++++++++-------- .../uhabits/widgets/HabitPickerDialog.java | 23 ++++++++++-------- .../widgets/HistoryWidgetProvider.java | 23 ++++++++++-------- .../uhabits/widgets/ScoreWidgetProvider.java | 23 ++++++++++-------- .../uhabits/widgets/StreakWidgetProvider.java | 23 ++++++++++-------- .../drawable-v21/habits_item_check_normal.xml | 19 +++++++++++++++ .../habits_item_check_pressed.xml | 19 +++++++++++++++ .../res/drawable-v21/ripple_transparent.xml | 19 +++++++++++++++ .../main/res/drawable-v21/ripple_white.xml | 19 +++++++++++++++ app/src/main/res/drawable/card_background.xml | 19 +++++++++++++++ .../res/drawable/habits_item_check_normal.xml | 19 +++++++++++++++ .../drawable/habits_item_check_pressed.xml | 19 +++++++++++++++ .../habits_list_header_background.xml | 19 +++++++++++++++ app/src/main/res/drawable/selected_box.xml | 19 +++++++++++++++ .../main/res/drawable/widget_background.xml | 19 +++++++++++++++ app/src/main/res/layout/about.xml | 19 +++++++++++++++ app/src/main/res/layout/edit_habit.xml | 19 +++++++++++++++ .../main/res/layout/list_habits_activity.xml | 19 +++++++++++++++ .../main/res/layout/list_habits_fragment.xml | 19 +++++++++++++++ .../res/layout/list_habits_header_check.xml | 19 +++++++++++++++ app/src/main/res/layout/list_habits_item.xml | 19 +++++++++++++++ .../res/layout/list_habits_item_check.xml | 19 +++++++++++++++ app/src/main/res/layout/show_habit.xml | 19 +++++++++++++++ .../main/res/layout/show_habit_activity.xml | 19 +++++++++++++++ .../main/res/layout/small_widget_preview.xml | 19 +++++++++++++++ app/src/main/res/layout/widget_checkmark.xml | 19 +++++++++++++++ .../res/layout/widget_configure_activity.xml | 19 +++++++++++++++ app/src/main/res/layout/widget_graph.xml | 19 +++++++++++++++ .../main/res/menu-v21/list_habits_context.xml | 19 +++++++++++++++ .../main/res/menu-v21/list_habits_options.xml | 19 +++++++++++++++ .../res/menu-v21/show_habit_fragment_menu.xml | 19 +++++++++++++++ app/src/main/res/menu/list_habits_context.xml | 19 +++++++++++++++ app/src/main/res/menu/list_habits_menu.xml | 19 +++++++++++++++ app/src/main/res/menu/list_habits_options.xml | 19 +++++++++++++++ .../res/menu/show_habit_fragment_menu.xml | 19 +++++++++++++++ app/src/main/res/values-hdpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-ldpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-mdpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-pt/strings.xml | 24 +++++++++---------- app/src/main/res/values-v21/styles.xml | 19 +++++++++++++++ .../res/values-v21/styles_list_habits.xml | 19 +++++++++++++++ app/src/main/res/values-w820dp/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-xhdpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-xxhdpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-xxxhdpi/dimens.xml | 19 +++++++++++++++ app/src/main/res/values-zh/strings.xml | 19 +++++++++++++++ app/src/main/res/values/dimens.xml | 19 +++++++++++++++ app/src/main/res/values/fontawesome.xml | 19 +++++++++++++++ app/src/main/res/values/keys.xml | 24 +++++++++---------- app/src/main/res/values/pickers.xml | 19 +++++++++++++++ app/src/main/res/values/strings.xml | 19 +++++++++++++++ app/src/main/res/values/styles.xml | 19 +++++++++++++++ app/src/main/res/values/styles_dialog.xml | 19 +++++++++++++++ .../main/res/values/styles_list_habits.xml | 19 +++++++++++++++ app/src/main/res/xml/preferences.xml | 19 +++++++++++++++ .../main/res/xml/widget_checkmark_info.xml | 19 +++++++++++++++ app/src/main/res/xml/widget_history_info.xml | 19 +++++++++++++++ app/src/main/res/xml/widget_score_info.xml | 19 +++++++++++++++ app/src/main/res/xml/widget_streak_info.xml | 19 +++++++++++++++ 107 files changed, 1729 insertions(+), 508 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 382aaf243..8d7e8eff2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,4 +1,23 @@ + + * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.helpers; diff --git a/app/src/main/java/org/isoron/helpers/Command.java b/app/src/main/java/org/isoron/helpers/Command.java index 913292d11..7472b096f 100644 --- a/app/src/main/java/org/isoron/helpers/Command.java +++ b/app/src/main/java/org/isoron/helpers/Command.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.helpers; diff --git a/app/src/main/java/org/isoron/helpers/DateHelper.java b/app/src/main/java/org/isoron/helpers/DateHelper.java index 45b9144cf..0aef8c0c6 100644 --- a/app/src/main/java/org/isoron/helpers/DateHelper.java +++ b/app/src/main/java/org/isoron/helpers/DateHelper.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.helpers; diff --git a/app/src/main/java/org/isoron/helpers/DialogHelper.java b/app/src/main/java/org/isoron/helpers/DialogHelper.java index 48d2cad02..e65a50430 100644 --- a/app/src/main/java/org/isoron/helpers/DialogHelper.java +++ b/app/src/main/java/org/isoron/helpers/DialogHelper.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.helpers; diff --git a/app/src/main/java/org/isoron/helpers/ReplayableActivity.java b/app/src/main/java/org/isoron/helpers/ReplayableActivity.java index 11f2ee34b..d2fcdc350 100644 --- a/app/src/main/java/org/isoron/helpers/ReplayableActivity.java +++ b/app/src/main/java/org/isoron/helpers/ReplayableActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.helpers; diff --git a/app/src/main/java/org/isoron/uhabits/AboutActivity.java b/app/src/main/java/org/isoron/uhabits/AboutActivity.java index f649d6036..20af24efe 100644 --- a/app/src/main/java/org/isoron/uhabits/AboutActivity.java +++ b/app/src/main/java/org/isoron/uhabits/AboutActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java b/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java index 3942f8e52..a7b8dcfc7 100644 --- a/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java +++ b/app/src/main/java/org/isoron/uhabits/HabitBroadcastReceiver.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/HabitsBackupAgent.java b/app/src/main/java/org/isoron/uhabits/HabitsBackupAgent.java index 7243d6f61..6baa562f2 100644 --- a/app/src/main/java/org/isoron/uhabits/HabitsBackupAgent.java +++ b/app/src/main/java/org/isoron/uhabits/HabitsBackupAgent.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/IntroActivity.java b/app/src/main/java/org/isoron/uhabits/IntroActivity.java index e802e2248..e7685aa87 100644 --- a/app/src/main/java/org/isoron/uhabits/IntroActivity.java +++ b/app/src/main/java/org/isoron/uhabits/IntroActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/MainActivity.java b/app/src/main/java/org/isoron/uhabits/MainActivity.java index 1a449dcfa..769e58a8f 100644 --- a/app/src/main/java/org/isoron/uhabits/MainActivity.java +++ b/app/src/main/java/org/isoron/uhabits/MainActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/SettingsActivity.java b/app/src/main/java/org/isoron/uhabits/SettingsActivity.java index a39e8ffaa..9e43b1bba 100644 --- a/app/src/main/java/org/isoron/uhabits/SettingsActivity.java +++ b/app/src/main/java/org/isoron/uhabits/SettingsActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java b/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java index cc4c6002d..a2e770551 100644 --- a/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java +++ b/app/src/main/java/org/isoron/uhabits/ShowHabitActivity.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits; diff --git a/app/src/main/java/org/isoron/uhabits/commands/ArchiveHabitsCommand.java b/app/src/main/java/org/isoron/uhabits/commands/ArchiveHabitsCommand.java index 0d1ae561f..3aee23dc1 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/ArchiveHabitsCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/ArchiveHabitsCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/ChangeHabitColorCommand.java b/app/src/main/java/org/isoron/uhabits/commands/ChangeHabitColorCommand.java index 547024b42..f9b00ba89 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/ChangeHabitColorCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/ChangeHabitColorCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/CreateHabitCommand.java b/app/src/main/java/org/isoron/uhabits/commands/CreateHabitCommand.java index aa758cbb7..e3fba3e35 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/CreateHabitCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/CreateHabitCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java b/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java index 7e4e201eb..0a069d14d 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/DeleteHabitsCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java b/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java index 985275f40..ccd641c8b 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/EditHabitCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/ToggleRepetitionCommand.java b/app/src/main/java/org/isoron/uhabits/commands/ToggleRepetitionCommand.java index c19ff5a5d..fe573ddaf 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/ToggleRepetitionCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/ToggleRepetitionCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/commands/UnarchiveHabitsCommand.java b/app/src/main/java/org/isoron/uhabits/commands/UnarchiveHabitsCommand.java index 258627321..08d34af69 100644 --- a/app/src/main/java/org/isoron/uhabits/commands/UnarchiveHabitsCommand.java +++ b/app/src/main/java/org/isoron/uhabits/commands/UnarchiveHabitsCommand.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.commands; diff --git a/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java b/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java index 2283ffb9d..6577ec440 100644 --- a/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java +++ b/app/src/main/java/org/isoron/uhabits/dialogs/HabitSelectionCallback.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.dialogs; diff --git a/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java b/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java index eee95a27d..0a3d4dead 100644 --- a/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java +++ b/app/src/main/java/org/isoron/uhabits/dialogs/HintManager.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.dialogs; diff --git a/app/src/main/java/org/isoron/uhabits/dialogs/WeekdayPickerDialog.java b/app/src/main/java/org/isoron/uhabits/dialogs/WeekdayPickerDialog.java index be68359b9..300dcd3ea 100644 --- a/app/src/main/java/org/isoron/uhabits/dialogs/WeekdayPickerDialog.java +++ b/app/src/main/java/org/isoron/uhabits/dialogs/WeekdayPickerDialog.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * This file is part of Loop Habit Tracker. + * + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + package org.isoron.uhabits.dialogs; import android.app.AlertDialog; diff --git a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java index cef7fa916..04cf6847c 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/EditHabitFragment.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.fragments; diff --git a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java index 32379e678..432582701 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/HabitListAdapter.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * This file is part of Loop Habit Tracker. + * + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + package org.isoron.uhabits.fragments; import android.content.Context; diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java index 2268a3269..d6aa8b9a1 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ListHabitsFragment.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.fragments; diff --git a/app/src/main/java/org/isoron/uhabits/fragments/SettingsFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/SettingsFragment.java index 66de86d12..fb5c04f60 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/SettingsFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/SettingsFragment.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.fragments; diff --git a/app/src/main/java/org/isoron/uhabits/fragments/ShowHabitFragment.java b/app/src/main/java/org/isoron/uhabits/fragments/ShowHabitFragment.java index 812f832ef..c8b0e548c 100644 --- a/app/src/main/java/org/isoron/uhabits/fragments/ShowHabitFragment.java +++ b/app/src/main/java/org/isoron/uhabits/fragments/ShowHabitFragment.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.fragments; diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java index e06015db7..846283a63 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/ListHabitsHelper.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * This file is part of Loop Habit Tracker. + * + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + package org.isoron.uhabits.helpers; import android.content.Context; diff --git a/app/src/main/java/org/isoron/uhabits/helpers/ReminderHelper.java b/app/src/main/java/org/isoron/uhabits/helpers/ReminderHelper.java index cbc1bd9c1..9a0e691d0 100644 --- a/app/src/main/java/org/isoron/uhabits/helpers/ReminderHelper.java +++ b/app/src/main/java/org/isoron/uhabits/helpers/ReminderHelper.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.helpers; diff --git a/app/src/main/java/org/isoron/uhabits/io/CSVExporter.java b/app/src/main/java/org/isoron/uhabits/io/CSVExporter.java index 4af223161..c1a2c9599 100644 --- a/app/src/main/java/org/isoron/uhabits/io/CSVExporter.java +++ b/app/src/main/java/org/isoron/uhabits/io/CSVExporter.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * This file is part of Loop Habit Tracker. + * + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + package org.isoron.uhabits.io; import android.content.Context; diff --git a/app/src/main/java/org/isoron/uhabits/loaders/HabitListLoader.java b/app/src/main/java/org/isoron/uhabits/loaders/HabitListLoader.java index 204b5e243..8a0d93661 100644 --- a/app/src/main/java/org/isoron/uhabits/loaders/HabitListLoader.java +++ b/app/src/main/java/org/isoron/uhabits/loaders/HabitListLoader.java @@ -1,20 +1,20 @@ /* - * Copyright (C) 2016 Alinson Santos Xavier + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.loaders; diff --git a/app/src/main/java/org/isoron/uhabits/models/Checkmark.java b/app/src/main/java/org/isoron/uhabits/models/Checkmark.java index d62f2376f..e1007a26f 100644 --- a/app/src/main/java/org/isoron/uhabits/models/Checkmark.java +++ b/app/src/main/java/org/isoron/uhabits/models/Checkmark.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/CheckmarkList.java b/app/src/main/java/org/isoron/uhabits/models/CheckmarkList.java index 61187ea30..04c8fe458 100644 --- a/app/src/main/java/org/isoron/uhabits/models/CheckmarkList.java +++ b/app/src/main/java/org/isoron/uhabits/models/CheckmarkList.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/Habit.java b/app/src/main/java/org/isoron/uhabits/models/Habit.java index fc3163b21..02e3e67b6 100644 --- a/app/src/main/java/org/isoron/uhabits/models/Habit.java +++ b/app/src/main/java/org/isoron/uhabits/models/Habit.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/Repetition.java b/app/src/main/java/org/isoron/uhabits/models/Repetition.java index 5ef848084..a2503706f 100644 --- a/app/src/main/java/org/isoron/uhabits/models/Repetition.java +++ b/app/src/main/java/org/isoron/uhabits/models/Repetition.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/RepetitionList.java b/app/src/main/java/org/isoron/uhabits/models/RepetitionList.java index 6828101ab..92d3b0cf0 100644 --- a/app/src/main/java/org/isoron/uhabits/models/RepetitionList.java +++ b/app/src/main/java/org/isoron/uhabits/models/RepetitionList.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/Score.java b/app/src/main/java/org/isoron/uhabits/models/Score.java index 44af97588..2c3cd1b9d 100644 --- a/app/src/main/java/org/isoron/uhabits/models/Score.java +++ b/app/src/main/java/org/isoron/uhabits/models/Score.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/ScoreList.java b/app/src/main/java/org/isoron/uhabits/models/ScoreList.java index 8312a15e2..2a34a4571 100644 --- a/app/src/main/java/org/isoron/uhabits/models/ScoreList.java +++ b/app/src/main/java/org/isoron/uhabits/models/ScoreList.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/Streak.java b/app/src/main/java/org/isoron/uhabits/models/Streak.java index b5e8b5cac..35a20f444 100644 --- a/app/src/main/java/org/isoron/uhabits/models/Streak.java +++ b/app/src/main/java/org/isoron/uhabits/models/Streak.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/models/StreakList.java b/app/src/main/java/org/isoron/uhabits/models/StreakList.java index d83a29d85..5f34e0634 100644 --- a/app/src/main/java/org/isoron/uhabits/models/StreakList.java +++ b/app/src/main/java/org/isoron/uhabits/models/StreakList.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.models; diff --git a/app/src/main/java/org/isoron/uhabits/views/CheckmarkView.java b/app/src/main/java/org/isoron/uhabits/views/CheckmarkView.java index 223217aad..d6b6fcd5c 100644 --- a/app/src/main/java/org/isoron/uhabits/views/CheckmarkView.java +++ b/app/src/main/java/org/isoron/uhabits/views/CheckmarkView.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/views/HabitHistoryView.java b/app/src/main/java/org/isoron/uhabits/views/HabitHistoryView.java index d99ba765b..d967db6e1 100644 --- a/app/src/main/java/org/isoron/uhabits/views/HabitHistoryView.java +++ b/app/src/main/java/org/isoron/uhabits/views/HabitHistoryView.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/views/HabitScoreView.java b/app/src/main/java/org/isoron/uhabits/views/HabitScoreView.java index 68855e50a..6ec91bc6f 100644 --- a/app/src/main/java/org/isoron/uhabits/views/HabitScoreView.java +++ b/app/src/main/java/org/isoron/uhabits/views/HabitScoreView.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/views/HabitStreakView.java b/app/src/main/java/org/isoron/uhabits/views/HabitStreakView.java index 5872d96c9..1ac4f5a0c 100644 --- a/app/src/main/java/org/isoron/uhabits/views/HabitStreakView.java +++ b/app/src/main/java/org/isoron/uhabits/views/HabitStreakView.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/views/RingView.java b/app/src/main/java/org/isoron/uhabits/views/RingView.java index e897fb5fb..80c04c095 100644 --- a/app/src/main/java/org/isoron/uhabits/views/RingView.java +++ b/app/src/main/java/org/isoron/uhabits/views/RingView.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/views/ScrollableDataView.java b/app/src/main/java/org/isoron/uhabits/views/ScrollableDataView.java index 7360456da..7ee55f55d 100644 --- a/app/src/main/java/org/isoron/uhabits/views/ScrollableDataView.java +++ b/app/src/main/java/org/isoron/uhabits/views/ScrollableDataView.java @@ -1,20 +1,20 @@ /* - * Copyright (C) 2016 Alinson Santos Xavier + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.views; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/BaseWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/BaseWidgetProvider.java index d890ea1b3..6f95d5713 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/BaseWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/BaseWidgetProvider.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java index 2710435f9..849fdf52e 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/CheckmarkWidgetProvider.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/HabitPickerDialog.java b/app/src/main/java/org/isoron/uhabits/widgets/HabitPickerDialog.java index f44127cac..d09881acf 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/HabitPickerDialog.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/HabitPickerDialog.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/HistoryWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/HistoryWidgetProvider.java index 7f6b50aea..2fd440910 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/HistoryWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/HistoryWidgetProvider.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/ScoreWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/ScoreWidgetProvider.java index 3cede1dee..5eb9c1097 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/ScoreWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/ScoreWidgetProvider.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/java/org/isoron/uhabits/widgets/StreakWidgetProvider.java b/app/src/main/java/org/isoron/uhabits/widgets/StreakWidgetProvider.java index c125654d2..40916a8fc 100644 --- a/app/src/main/java/org/isoron/uhabits/widgets/StreakWidgetProvider.java +++ b/app/src/main/java/org/isoron/uhabits/widgets/StreakWidgetProvider.java @@ -1,17 +1,20 @@ -/* Copyright (C) 2016 Alinson Santos Xavier +/* + * Copyright (C) 2016 Álinson Santos Xavier * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. + * This file is part of Loop Habit Tracker. * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * Loop Habit Tracker is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Loop Habit Tracker is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ package org.isoron.uhabits.widgets; diff --git a/app/src/main/res/drawable-v21/habits_item_check_normal.xml b/app/src/main/res/drawable-v21/habits_item_check_normal.xml index db520e5c8..48bf29073 100644 --- a/app/src/main/res/drawable-v21/habits_item_check_normal.xml +++ b/app/src/main/res/drawable-v21/habits_item_check_normal.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/drawable-v21/habits_item_check_pressed.xml b/app/src/main/res/drawable-v21/habits_item_check_pressed.xml index f912c3dfc..372605fdd 100644 --- a/app/src/main/res/drawable-v21/habits_item_check_pressed.xml +++ b/app/src/main/res/drawable-v21/habits_item_check_pressed.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/drawable-v21/ripple_transparent.xml b/app/src/main/res/drawable-v21/ripple_transparent.xml index 856240bf1..77c8ff31b 100644 --- a/app/src/main/res/drawable-v21/ripple_transparent.xml +++ b/app/src/main/res/drawable-v21/ripple_transparent.xml @@ -1,3 +1,22 @@ + + diff --git a/app/src/main/res/drawable-v21/ripple_white.xml b/app/src/main/res/drawable-v21/ripple_white.xml index cdf2f4fa4..5721b50cb 100644 --- a/app/src/main/res/drawable-v21/ripple_white.xml +++ b/app/src/main/res/drawable-v21/ripple_white.xml @@ -1,3 +1,22 @@ + + diff --git a/app/src/main/res/drawable/card_background.xml b/app/src/main/res/drawable/card_background.xml index 0aa19dcb2..60d7d0fa4 100644 --- a/app/src/main/res/drawable/card_background.xml +++ b/app/src/main/res/drawable/card_background.xml @@ -1,4 +1,23 @@ + + + + diff --git a/app/src/main/res/drawable/habits_item_check_pressed.xml b/app/src/main/res/drawable/habits_item_check_pressed.xml index 887279103..1760e40d2 100644 --- a/app/src/main/res/drawable/habits_item_check_pressed.xml +++ b/app/src/main/res/drawable/habits_item_check_pressed.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/drawable/habits_list_header_background.xml b/app/src/main/res/drawable/habits_list_header_background.xml index a935ad4de..83385eaa5 100644 --- a/app/src/main/res/drawable/habits_list_header_background.xml +++ b/app/src/main/res/drawable/habits_list_header_background.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/drawable/selected_box.xml b/app/src/main/res/drawable/selected_box.xml index f311ac13d..754676620 100644 --- a/app/src/main/res/drawable/selected_box.xml +++ b/app/src/main/res/drawable/selected_box.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/drawable/widget_background.xml b/app/src/main/res/drawable/widget_background.xml index 1c66dd34c..2591a3c4f 100644 --- a/app/src/main/res/drawable/widget_background.xml +++ b/app/src/main/res/drawable/widget_background.xml @@ -1,4 +1,23 @@ + + diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml index 86639ca2c..b6482d882 100644 --- a/app/src/main/res/layout/about.xml +++ b/app/src/main/res/layout/about.xml @@ -1,4 +1,23 @@ + + + ~ + ~ This file is part of Loop Habit Tracker. + ~ + ~ Loop Habit Tracker is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by the + ~ Free Software Foundation, either version 3 of the License, or (at your + ~ option) any later version. + ~ + ~ Loop Habit Tracker is distributed in the hope that it will be useful, but + ~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ~ more details. + ~ + ~ You should have received a copy of the GNU General Public License along + ~ with this program. If not, see . + --> + + ~ + ~ This file is part of Loop Habit Tracker. + ~ + ~ Loop Habit Tracker is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by the + ~ Free Software Foundation, either version 3 of the License, or (at your + ~ option) any later version. + ~ + ~ Loop Habit Tracker is distributed in the hope that it will be useful, but + ~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ~ more details. + ~ + ~ You should have received a copy of the GNU General Public License along + ~ with this program. If not, see . + --> + + + + +