|
|
@@ -37,8 +37,8 @@ public class ReviewCounter {
|
|
|
final long todayMillis;
|
|
|
final LifeplusPreferences preferences;
|
|
|
|
|
|
- protected int COUNT_LIMIT = 6;
|
|
|
- protected int DAY_LIMIT = 10;
|
|
|
+ protected int countLimit = 6;
|
|
|
+ protected int dayLimit = 10;
|
|
|
|
|
|
public ReviewCounter(LifeplusPreferences preferences, String dateString, long todayMillis) {
|
|
|
this.preferences = preferences;
|
|
|
@@ -71,8 +71,8 @@ public class ReviewCounter {
|
|
|
String today = Formatter.format(todayMillis, DATE_PATTERN);
|
|
|
list.add(today);
|
|
|
|
|
|
- // 최근 COUNT_LIMIT 개만 유지
|
|
|
- if (list.size() > COUNT_LIMIT) {
|
|
|
+ // 최근 countLimit 개만 유지
|
|
|
+ if (list.size() > countLimit) {
|
|
|
list.remove(0);
|
|
|
}
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
@@ -107,9 +107,9 @@ public class ReviewCounter {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- // 수 체크 (COUNT_LIMIT)
|
|
|
+ // 수 체크 (countLimit)
|
|
|
String[] dates = date.split(SEPARATOR);
|
|
|
- if (dates.length == 0 || dates.length < COUNT_LIMIT) {
|
|
|
+ if (dates.length == 0 || dates.length < countLimit) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -118,9 +118,9 @@ public class ReviewCounter {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- // 요건 일 체크 (DAY_LIMIT)
|
|
|
+ // 요건 일 체크 (dayLimit)
|
|
|
long firstDayMillis = Formatter.dateStringToMillis(DATE_PATTERN, dates[0]);
|
|
|
- long limitDayMillis = TimeUnit.DAYS.toMillis(DAY_LIMIT);
|
|
|
+ long limitDayMillis = TimeUnit.DAYS.toMillis(dayLimit);
|
|
|
|
|
|
return (firstDayMillis + limitDayMillis) > todayMillis;
|
|
|
}
|