mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Make HistoryView not editable by default
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user