|
|
|
@ -105,11 +105,10 @@ public class HabitCardListAdapter
|
|
|
|
|
* Returns the item that occupies a certain position on the list
|
|
|
|
|
*
|
|
|
|
|
* @param position position of the item
|
|
|
|
|
* @return the item at given position
|
|
|
|
|
* @throws IndexOutOfBoundsException if position is not valid
|
|
|
|
|
* @return the item at given position or null if position is invalid
|
|
|
|
|
*/
|
|
|
|
|
@Deprecated
|
|
|
|
|
@NonNull
|
|
|
|
|
@Nullable
|
|
|
|
|
public Habit getItem(int position)
|
|
|
|
|
{
|
|
|
|
|
return cache.getHabitByPosition(position);
|
|
|
|
@ -314,6 +313,8 @@ public class HabitCardListAdapter
|
|
|
|
|
public void toggleSelection(int position)
|
|
|
|
|
{
|
|
|
|
|
Habit h = getItem(position);
|
|
|
|
|
if (h == null) return;
|
|
|
|
|
|
|
|
|
|
int k = selected.indexOf(h);
|
|
|
|
|
if (k < 0) selected.add(h);
|
|
|
|
|
else selected.remove(h);
|
|
|
|
|