]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/DatePickerFragment.java
machinery for retrieving transaction journal from hledger-web
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / DatePickerFragment.java
index 5dbd2794651f61fee2489fc577016a896f518760..ebee058053726fcb1bbad343ace603bfc701a638 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright © 2018 Damyan Ivanov.
+ * This file is part of Mobile-Ledger.
+ * Mobile-Ledger is free software: you can distribute it and/or modify it
+ * under the term of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your opinion), any later version.
+ *
+ * Mobile-Ledger is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License terms for details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
+ */
+
 package net.ktnx.mobileledger;
 
 import android.annotation.TargetApi;
@@ -47,7 +64,6 @@ implements DatePickerDialog.OnDateSetListener, DatePicker.OnDateChangedListener
         }
 
         DatePickerDialog dpd =  new DatePickerDialog(Objects.requireNonNull(getActivity()), this, year, month, day);
-
         // quicker date selection available in API 26
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             DatePicker dp = dpd.getDatePicker();
@@ -68,6 +84,10 @@ implements DatePickerDialog.OnDateSetListener, DatePicker.OnDateChangedListener
         else {
             date.setText(String.format(Locale.US, "%d/%d", month+1, day));
         }
+
+        TextView description = Objects.requireNonNull(getActivity())
+                .findViewById(R.id.new_transaction_description);
+        description.requestFocus();
     }
 
     @Override
@@ -82,6 +102,10 @@ implements DatePickerDialog.OnDateSetListener, DatePicker.OnDateChangedListener
             date.setText(String.format(Locale.US, "%d/%d", monthOfYear+1, dayOfMonth));
         }
 
+        TextView description = Objects.requireNonNull(getActivity())
+                .findViewById(R.id.new_transaction_description);
+        description.requestFocus();
+
         this.dismiss();
     }
 }