package in.techware.carrefour.activity.receive;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import in.techware.carrefour.R;
import in.techware.carrefour.activity.FileTransferActivity;

public class ReceiveSelectedActivity extends AppCompatActivity implements View.OnClickListener {

    private Button mGetOrdersButton;
    private Button mBackButton;
    private String selectedSubMenu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_receive_selected);
        mGetOrdersButton = findViewById(R.id.btn_get_orders);
        mBackButton = findViewById(R.id.btn_back);
        if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
            selectedSubMenu = getIntent().getStringExtra("submenu");
        }

        mGetOrdersButton.setOnClickListener(this);
        mBackButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_get_orders:
                Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
                intent.putExtra("submenu", selectedSubMenu);
                startActivity(intent);
                break;

            case R.id.btn_back:
                finish();
                break;
        }
    }
}
