Make HistoryView not editable by default

pull/30/head
Alinson S. Xavier 10 years ago
parent aa86826bdb
commit 5b151805ff

@ -49,6 +49,7 @@ public class HistoryEditorDialog extends DialogFragment
historyView = new HabitHistoryView(context, null);
historyView.setPadding(p, 0, p, 0);
historyView.setHabit(habit);
historyView.setIsEditable(true);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("History Editor")

@ -67,12 +67,14 @@ public class HabitHistoryView extends ScrollableDataView
private boolean isBackgroundTransparent;
private int textColor;
private boolean isEditable;
public HabitHistoryView(Context context, AttributeSet attrs)
{
super(context, attrs);
this.primaryColor = ColorHelper.palette[7];
this.checkmarks = new int[0];
this.isEditable = false;
init();
}
@ -353,6 +355,8 @@ public class HabitHistoryView extends ScrollableDataView
@Override
public boolean onSingleTapUp(MotionEvent e)
{
if(!isEditable) return false;
int pointerId = e.getPointerId(0);
float x = e.getX(pointerId);
float y = e.getY(pointerId);
@ -397,4 +401,9 @@ public class HabitHistoryView extends ScrollableDataView
return date.getTimeInMillis();
}
public void setIsEditable(boolean isEditable)
{
this.isEditable = isEditable;
}
}

Loading…
Cancel
Save