package com.wd.workoffice.ui.activity.bat.store;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MenuItem;

import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.activity.MainActivity;

import butterknife.ButterKnife;

/**
 * 下单成功
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class StoreOrderSuccessActivity extends WorkToolBarActivity {


    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }

    @Override
    protected void initData() {
    }


    @Override
    protected void initEvent() {
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setSwipeBackEnable(false);
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_store_order_success;
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                startActivity(MainActivity.class);
                finish();
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        startActivity(MainActivity.class);
        finish();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode){
            case KeyEvent.KEYCODE_BACK:
                startActivity(MainActivity.class);
                finish();
                break;
        }
        return super.onKeyDown(keyCode, event);
    }
}
