|
|
@ -260,9 +260,9 @@ public class ListHabitsFragment extends Fragment
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean onLongClick(View v)
|
|
|
|
public boolean onLongClick(View v)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int id = v.getId();
|
|
|
|
switch(v.getId())
|
|
|
|
|
|
|
|
{
|
|
|
|
if (id == R.id.tvCheck)
|
|
|
|
case R.id.tvCheck:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lastLongClick = new Date().getTime();
|
|
|
|
lastLongClick = new Date().getTime();
|
|
|
|
Habit habit = Habit.get((Long) v.getTag(R.string.habit_key));
|
|
|
|
Habit habit = Habit.get((Long) v.getTag(R.string.habit_key));
|
|
|
@ -277,6 +277,7 @@ public class ListHabitsFragment extends Fragment
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -296,6 +297,12 @@ public class ListHabitsFragment extends Fragment
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v)
|
|
|
|
public void onClick(View v)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
switch(v.getId())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case R.id.tvCheck:
|
|
|
|
|
|
|
|
activity.showToast(R.string.long_press_to_toggle);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ListHabitsAdapter extends BaseAdapter
|
|
|
|
class ListHabitsAdapter extends BaseAdapter
|
|
|
@ -356,6 +363,7 @@ public class ListHabitsFragment extends Fragment
|
|
|
|
TextView btCheck = (TextView) check.findViewById(R.id.tvCheck);
|
|
|
|
TextView btCheck = (TextView) check.findViewById(R.id.tvCheck);
|
|
|
|
btCheck.setTypeface(fontawesome);
|
|
|
|
btCheck.setTypeface(fontawesome);
|
|
|
|
btCheck.setOnLongClickListener(ListHabitsFragment.this);
|
|
|
|
btCheck.setOnLongClickListener(ListHabitsFragment.this);
|
|
|
|
|
|
|
|
btCheck.setOnClickListener(ListHabitsFragment.this);
|
|
|
|
((LinearLayout) view.findViewById(R.id.llButtons)).addView(check);
|
|
|
|
((LinearLayout) view.findViewById(R.id.llButtons)).addView(check);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|