package de.fau.amos.virtualledger.android.views.savings.add;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.fau.amos.virtualledger.R;
import de.fau.amos.virtualledger.android.model.SavingsAccount;

public class AddSavingsAccountAmountSplitFragment extends AddSavingsAccountPage {
    @SuppressWarnings("unused")
    private static final String TAG = AddSavingsAccountAmountSplitFragment.class.getSimpleName();

    @BindView(R.id.add_savings_account_edit_text_sub_goal_name)
    EditText editTextSubGoalName;

    @BindView(R.id.add_savings_account_edit_text_sub_goal_amount)
    EditText editTextSubGoalAmount;

    @BindView(R.id.add_savings_account_button_add_sub_goal)
    Button buttonAddSubGoal;

    @BindView(R.id.add_savings_account_list_view_sub_goals)
    ListView listViewSubGoals;

    @BindView(R.id.add_savings_account_text_view_sub_goal_total)
    TextView textViewSubGoalTotal;

    @Nullable
    @Override
    public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) {
        final View view = inflater.inflate(R.layout.saving_accounts_add_fragment_amount_split, container, false);
        ButterKnife.bind(this, view);

        return view;
    }

    @Override
    public void fillInData(final SavingsAccount savingsAccount) {

    }
}

@@ -222,38 +222,8 @@
 up;%0A
-import android.widget.Button;%0A
 impo
@@ -250,16 +250,16 @@
 itText;%0A
+
 import a
@@ -315,16 +315,68 @@
 tView;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import b
@@ -428,16 +428,44 @@
 rKnife;%0A
+import butterknife.OnClick;%0A
 import d
@@ -554,16 +554,77 @@
 Account;
+%0Aimport de.fau.amos.virtualledger.dtos.SavingsAccountSubGoal;
 %0A%0Apublic
@@ -1033,32 +1033,31 @@
 ount;%0A%0A    @
-BindView
+OnClick
 (R.id.add_sa
@@ -1099,32 +1099,197 @@
     
-Button buttonAddSubGoal;
+void onClickButtonAddSubGoal() %7B%0A        subGoals.add(new SavingsAccountSubGoal(editTextSubGoalName.getText().toString(), Double.valueOf(editTextSubGoalAmount.getText().toString())));%0A    %7D
 %0A%0A  
@@ -1439,24 +1439,24 @@
 goal_total)%0A
-
     TextView
@@ -1479,16 +1479,93 @@
 Total;%0A%0A
+    private final List%3CSavingsAccountSubGoal%3E subGoals = new ArrayList%3C%3E();%0A%0A
     @Nul

Add entered subgoals to list in AddSavingsAccountAmountSplitFragment.java