}
}
public enum FutureDates {
- None(0), OneMonth(30), TwoMonths(60), ThreeMonths(90), SixMonths(180), OneYear(365),
- All(-1);
+ None(0), OneWeek(7), TwoWeeks(14), OneMonth(30), TwoMonths(60), ThreeMonths(90),
+ SixMonths(180), OneYear(365), All(-1);
private static SparseArray<FutureDates> map = new SparseArray<>();
static {
}
public String getText(Resources resources) {
switch (value) {
+ case 7:
+ return resources.getString(R.string.future_dates_7);
+ case 14:
+ return resources.getString(R.string.future_dates_14);
case 30:
return resources.getString(R.string.future_dates_30);
case 60:
case None:
// already there
break;
+ case OneWeek:
+ dateLimit.add(Calendar.DAY_OF_MONTH, 7);
+ break;
+ case TwoWeeks:
+ dateLimit.add(Calendar.DAY_OF_MONTH, 14);
+ break;
case OneMonth:
dateLimit.add(Calendar.MONTH, 1);
break;
menu.inflate(R.menu.future_dates);
menu.setOnMenuItemClickListener(item -> {
switch (item.getItemId()) {
+ case R.id.menu_future_dates_7:
+ futureDates = MobileLedgerProfile.FutureDates.OneWeek;
+ break;
+ case R.id.menu_future_dates_14:
+ futureDates = MobileLedgerProfile.FutureDates.TwoWeeks;
+ break;
case R.id.menu_future_dates_30:
futureDates = MobileLedgerProfile.FutureDates.OneMonth;
break;
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="@string/future_dates_none" android:id="@+id/menu_future_dates_none"/>
+ <item android:title="@string/future_dates_7" android:id="@+id/menu_future_dates_7"/>
+ <item android:title="@string/future_dates_14" android:id="@+id/menu_future_dates_14"/>
<item android:title="@string/future_dates_30" android:id="@+id/menu_future_dates_30"/>
<item android:title="@string/future_dates_60" android:id="@+id/menu_future_dates_60"/>
<item android:title="@string/future_dates_90" android:id="@+id/menu_future_dates_90"/>
<string name="simulate_save_condensed_label">Симул. съхр.</string>
<string name="simulation_label">СИМУЛАЦИЯ</string>
<string name="future_dates_180">До шест месеца</string>
+ <string name="future_dates_7">До една седмица</string>
+ <string name="future_dates_14">До две седмици</string>
<string name="future_dates_30">До един месец</string>
<string name="future_dates_365">До една година</string>
<string name="future_dates_60">До два месеца</string>
<string name="simulation_label">SIMULATION</string>
<string name="profile_future_dates_label">Allow input of dates in the future</string>
<string name="future_dates_none">No future dates are allowed</string>
+ <string name="future_dates_7">Up to a week</string>
+ <string name="future_dates_14">Up to two weeks</string>
<string name="future_dates_30">Up to a month</string>
<string name="future_dates_60">Up to two months</string>
<string name="future_dates_90">Up to three months</string>