This repository was archived by the owner on Jun 27, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
app/src/main/java/com/blogspot/e_kanivets/moneytracker
activity/account/edit/fragment Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import com.blogspot.e_kanivets.moneytracker.activity.base.BaseFragment
1010import com.blogspot.e_kanivets.moneytracker.controller.FormatController
1111import com.blogspot.e_kanivets.moneytracker.controller.data.AccountController
1212import com.blogspot.e_kanivets.moneytracker.entity.data.Account
13+ import com.blogspot.e_kanivets.moneytracker.util.AnswersProxy
1314import com.blogspot.e_kanivets.moneytracker.util.validator.EditAccountValidator
1415import com.blogspot.e_kanivets.moneytracker.util.validator.IValidator
1516import kotlinx.android.synthetic.main.fragment_edit_account.*
@@ -45,6 +46,7 @@ class EditAccountFragment : BaseFragment() {
4546 }
4647
4748 private fun done () {
49+ AnswersProxy .get().logButton(" Edit Account" )
4850 if (accountValidator.validate()) {
4951 val title = etTitle.text.toString().trim { it <= ' ' }
5052 val goal = etGoal.text.toString().toDouble()
@@ -55,6 +57,7 @@ class EditAccountFragment : BaseFragment() {
5557 )
5658 val updated = accountController.update(newAccount) != null
5759 if (updated) {
60+ AnswersProxy .get().logEvent(" Edit Account" )
5861 activity?.setResult(Activity .RESULT_OK )
5962 activity?.finish()
6063 }
Original file line number Diff line number Diff line change 1919
2020public class EditAccountValidator implements IValidator <Account > {
2121
22- @ NonNull
23- private final Context context ;
22+ @ NonNull private final Context context ;
2423
25- @ BindView (R .id .tilTitle )
26- TextInputLayout tilTitle ;
27- @ BindView (R .id .etTitle )
28- EditText etTitle ;
29- @ BindView (R .id .tilGoal )
30- TextInputLayout tilGoal ;
31- @ BindView (R .id .etGoal )
32- EditText etGoal ;
24+ @ BindView (R .id .tilTitle ) TextInputLayout tilTitle ;
25+ @ BindView (R .id .etTitle ) EditText etTitle ;
26+ @ BindView (R .id .tilGoal ) TextInputLayout tilGoal ;
27+ @ BindView (R .id .etGoal ) EditText etGoal ;
3328
3429 public EditAccountValidator (@ NonNull Context context , @ NonNull View view ) {
3530 this .context = context ;
3631 ButterKnife .bind (this , view );
3732 initTextWatchers ();
3833 }
3934
40- @ Override
41- public boolean validate () {
35+ @ Override public boolean validate () {
4236 String title = etTitle .getText ().toString ().trim ();
4337 double goal = Double .MAX_VALUE ;
4438
You can’t perform that action at this time.
0 commit comments