package com.fxy.mine;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;


import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.entity.LocalMedia;
import com.fxy.baselibrary.base.BaseActivity;
import com.fxy.R;
import com.fxy.common.PictureSelectorUpload;

import java.util.ArrayList;
import java.util.List;


public class PictureSelectorActivity extends BaseActivity {
    private Context mContext=this;
    private List<LocalMedia> selectList = new ArrayList<>();
    private RecyclerView mRecyclerView;

    private PictureSelectorUpload pictureSelectorUpload;


    @Override
    public boolean showToolBar() {
        return false;
    }

    @Override
    public int getContentViewResId() {
        return R.layout.activity_picture_selector;
    }

    @Override
    protected void getBundleExtras(Bundle extras) {

    }

    @Override
    protected void initView() {
        mRecyclerView = findViewById(R.id.recycler);

        pictureSelectorUpload = new PictureSelectorUpload(PictureSelectorActivity.this,mRecyclerView,"tally");
    }

    @Override
    public boolean openEventBus() {
        return false;
    }

    @Override
    public boolean isPlayMusic() {
        return true;
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            if (requestCode == PictureConfig.CHOOSE_REQUEST) {// 图片选择结果回调
                pictureSelectorUpload.getSelectImg(data);
            }
        }
    }
}
