some refactoring

pull/77/head
Denis 10 years ago
parent 63fe100596
commit d5530a2c6d

@ -63,7 +63,6 @@ public class HabitFrequencyView extends ScrollableDataView implements HabitDataV
private boolean isBackgroundTransparent; private boolean isBackgroundTransparent;
private HashMap<Long, Integer[]> frequency; private HashMap<Long, Integer[]> frequency;
private Integer[] localeWeekdayList;
public HabitFrequencyView(Context context) public HabitFrequencyView(Context context)
{ {
@ -90,8 +89,6 @@ public class HabitFrequencyView extends ScrollableDataView implements HabitDataV
createPaints(); createPaints();
createColors(); createColors();
localeWeekdayList = DateHelper.getLocaleWeekdayList();
dfMonth = DateHelper.getDateFormat("MMM"); dfMonth = DateHelper.getDateFormat("MMM");
dfYear = DateHelper.getDateFormat("yyyy"); dfYear = DateHelper.getDateFormat("yyyy");
@ -231,6 +228,7 @@ public class HabitFrequencyView extends ScrollableDataView implements HabitDataV
float rowHeight = rect.height() / 8.0f; float rowHeight = rect.height() / 8.0f;
prevRect.set(rect); prevRect.set(rect);
Integer[] localeWeekdayList = DateHelper.getLocaleWeekdayList();
for (int j = 0; j < localeWeekdayList.length; j++) for (int j = 0; j < localeWeekdayList.length; j++)
{ {
rect.set(0, 0, baseSize, baseSize); rect.set(0, 0, baseSize, baseSize);
@ -267,7 +265,7 @@ public class HabitFrequencyView extends ScrollableDataView implements HabitDataV
private void drawGrid(Canvas canvas, RectF rGrid) private void drawGrid(Canvas canvas, RectF rGrid)
{ {
int nRows = localeWeekdayList.length; int nRows = 7;
float rowHeight = rGrid.height() / (nRows + 1); float rowHeight = rGrid.height() / (nRows + 1);
pText.setTextAlign(Paint.Align.LEFT); pText.setTextAlign(Paint.Align.LEFT);

Loading…
Cancel
Save