package com.nextzy.mrsmile.mvp_example.calculator;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.nextzy.mrsmile.mvp_example.R;

public class CalculatorActivity extends AppCompatActivity implements CalculatorContractor.View {

    private CalculatorContractor.Presenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calculator);

        presenter = CalculatorPresenter.createPresenter(this);
    }

    @Override
    public void setPresenter(CalculatorContractor.Presenter presenter) {
        this.presenter = presenter;
    }

    @Override
    protected void onStart() {
        super.onStart();
        presenter.onStart();
    }

    @Override
    protected void onStop() {
        super.onStop();
        presenter.onStop();
    }
}

@@ -119,16 +119,72 @@
 .Bundle;
+%0Aimport android.view.View;%0Aimport android.widget.Button;
 %0A%0Aimport
@@ -313,16 +313,38 @@
 tor.View
+, View.OnClickListener
  %7B%0A%0A    
@@ -402,227 +402,2774 @@
     
-@Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.activity_calculator);%0A%0A        presenter = CalculatorPresenter.createPresent
+private Button btnZero;%0A    private Button btnOne;%0A    private Button btnTwo;%0A    private Button btnThere;%0A    private Button btnFour;%0A    private Button btnFive;%0A    private Button btnSix;%0A    private Button btnSeven;%0A    private Button btnEight;%0A    private Button btnNine;%0A%0A    private Button btnOperatorPlus;%0A    private Button btnOperatorMinus;%0A    private Button btnOperatorDivide;%0A    private Button btnOperatorMultiply;%0A    private Button btnOperatorEquals;%0A%0A    private Button btnDot;%0A    private Button btnClear;%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.activity_calculator);%0A%0A        createPresenter();%0A        bindView();%0A        setDefaultView();%0A    %7D%0A%0A    private void createPresenter() %7B%0A        presenter = CalculatorPresenter.createPresenter(this);%0A    %7D%0A%0A    private void bindView() %7B%0A        btnZero = (Button) findViewById(R.id.btn_zero);%0A        btnOne = (Button) findViewById(R.id.btn_one);%0A        btnTwo = (Button) findViewById(R.id.btn_two);%0A        btnThere = (Button) findViewById(R.id.btn_there);%0A        btnFour = (Button) findViewById(R.id.btn_four);%0A        btnFive = (Button) findViewById(R.id.btn_five);%0A        btnSix = (Button) findViewById(R.id.btn_six);%0A        btnSeven = (Button) findViewById(R.id.btn_seven);%0A        btnEight = (Button) findViewById(R.id.btn_eight);%0A        btnNine = (Button) findViewById(R.id.btn_nine);%0A%0A        btnOperatorPlus = (Button) findViewById(R.id.btn_operator_plus);%0A        btnOperatorMinus = (Button) findViewById(R.id.btn_operator_minus);%0A        btnOperatorDivide = (Button) findViewById(R.id.btn_operator_divide);%0A        btnOperatorMultiply = (Button) findViewById(R.id.btn_operator_multiply);%0A        btnOperatorEquals = (Button) findViewById(R.id.btn_operator_equals);%0A%0A        btnDot = (Button) findViewById(R.id.btn_dot);%0A        btnClear = (Button) findViewById(R.id.btn_clear);%0A    %7D%0A%0A    private void setDefaultView() %7B%0A        btnZero.setOnClickListener(this);%0A        btnOne.setOnClickListener(this);%0A        btnTwo.setOnClickListener(this);%0A        btnThere.setOnClickListener(this);%0A        btnFour.setOnClickListener(this);%0A        btnFive.setOnClickListener(this);%0A        btnSix.setOnClickListener(this);%0A        btnSeven.setOnClickListener(this);%0A        btnEight.setOnClickListener(this);%0A        btnNine.setOnClickListener(this);%0A%0A        btnOperatorPlus.setOnClickListener(this);%0A        btnOperatorMinus.setOnClickListener(this);%0A        btnOperatorDivide.setOnClickListener(this);%0A        btnOperatorMultiply.setOnClickListener(this);%0A        btnOperatorEquals.setOnClickListener(this);%0A%0A        btnDot.setOnClickListener(this);%0A        btnClear.setOnClickListen
 er(t
@@ -3518,11 +3518,98 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public void onClick(View v) %7B%0A        presenter.viewClick(v);%0A    %7D
 %0A%7D%0A

update CalculatorActivity bindView and setDefaultView