Android 增加画框(直接代码)

两个画框链接:
https://download.csdn.net/download/hknishi_zs/12447487




------------------------------------------------------------------





/**
 * 增加画框页面
 * 这是dev push 远程仓库,mac准备pull
 */
public class AddPictureFrameActivity extends BaseActivity implements View.OnClickListener, AddPictureFrameAdapter.AddPictureAdapterInterface {


    //    @BindView(R.id.iv_edge)
//    ImageView ivEdge;
    @BindView(R.id.xtab_layout)
    XTabLayout xtabLayout;
    @BindView(R.id.recycle_view)
    RecyclerView recycleView;
    @BindView(R.id.view_pager)
    ViewPager viewPager;
    @BindView(R.id.rl_root)
    RelativeLayout rlRoot;
    @BindView(R.id.tv_next_step)
    TextView tvNextStep;
    @BindView(R.id.rl_vp_parent)
    RelativeLayout rlVpParent;
    private ArrayList<int[]> mList;
    private AddPictureFrameAdapter mAdapter;
    private ArrayList<MediaInfo> mArrayExtra;
    private ArrayList<View> mViewList;
    //    private ArrayList<ArrayList<int[]>> mResList;
    private ArrayList<String> mtitleList;
    private Context mContext;
    private int paddDistance; //边距 - 上左右
    private int paddBottomDistance; //边距 - 下
    private int paddDistanceVP;//请忽略
    private int paddBottomDistanceVP;
    private int tabPosition; //tab索引 -- 指定selectFrameType
    private CenterLayoutManager mLayoutManager;
    ArrayList<Bitmap> mBitMapList;
    private AlertUtil mAlertUtil;
    private int mViewPagerWidth;
    private int mViewPagerHeight;

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

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        mBitMapList = new ArrayList<>();
        paddDistance = AppUtil.dip2px(mContext, 13);
        paddDistanceVP = paddDistance / 2 + 2;
        paddBottomDistance = AppUtil.dip2px(mContext, 22);
        paddBottomDistanceVP = paddBottomDistance / 2 + 3;
        mArrayExtra = getIntent().getParcelableArrayListExtra(VIDEO_PATH_KEY);
        mAlertUtil = AlertUtil.getInstance();
        //获取资源文件
        AddPictureUtils addPictureUtils = new AddPictureUtils(mContext);
        if (null == Globals.mResList) {
            Globals.mResList = addPictureUtils.init();
        }
        mtitleList = addPictureUtils.initTitle();
        //得到vp的宽高
        mViewPagerWidth = AppUtil.getScreenWidth(mContext);
        //viewPager的高度 =  屏幕的高- recycleview 高度、tablayout高度、标题高度、状态栏高度
        mViewPagerHeight = AppUtil.getScreenHeight(mContext) - AppUtil.dp2px(mContext, 77) - AppUtil.dp2px(mContext, 48) - AppUtil.dp2px(mContext, 42) - AppUtil.getStatusHeight(mContext
        );

        initRecycleView();
        handler.sendEmptyMessage(1);

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            switch (msg.what) {
                case 1:
                    mAlertUtil.alert(mContext);
                    new Thread() {
                        @Override
                        public void run() {
                            super.run();
                            compressBitMap();
                        }
                    }.start();
                    break;

            }
        }
    };

    int compressBitmap = 0;

    public void compressBitMap() {

        if (compressBitmap >= mArrayExtra.size()) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    initViewPager();
                    mAlertUtil.closeDialog(mContext);
                }
            });
            return;
        }
        Bitmap bitmap = null;
        int degree = BitmapUtils.readPictureDegree(mArrayExtra.get(compressBitmap).filePath);
        if (degree != 0) {
            try {

                Bitmap rawBitmap = BitmapUtils.rotateToDegrees(fileDecodeBitmap(mArrayExtra.get(compressBitmap).filePath), degree);
                bitmap = combinateFrame(rawBitmap, null);

            } catch (Exception e) {
                e.printStackTrace();
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        GoldToastUtil.showGoldToast(mContext, "数据有误,请重新选择");
                    }
                });
                finish();
            }
        } else {
            bitmap = combinateFrame(fileDecodeBitmap(mArrayExtra.get(compressBitmap).filePath), null);
        }
        mBitMapList.add(bitmap);
        compressBitmap++;
        compressBitMap();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {

            case R.id.tv_next_step:

                if (null != mAlertUtil)
                    mAlertUtil.alert(mContext);
                updataImg();
                break;
        }
    }

    int currentImg = 0; //点前上传的图片

    public void updataImg() {
        if (currentImg >= mArrayExtra.size()) {
            if (null != mAlertUtil)
                mAlertUtil.closeDialog(mContext);
            finishPage();
            return;
        }
        //判断是不是增加边框(根据isAddPicture 判断图片更换地址、宽、高)
        if (mArrayExtra.get(currentImg).isAddPicture) {
            View view = viewPager.findViewWithTag(currentImg);
            if (null != view) {
                ImageView viewById = view.findViewById(R.id.iv_edge);
                saveImageToGallery(mContext, currentImg, ((BitmapDrawable) viewById.getDrawable()).getBitmap());
            }
        } else {
            currentImg++;
            updataImg();
        }
    }

    /**
     * @param context
     * @param selectPosition 需要增加边框图片的索引
     * @param bmp            item 布局中ImageView的BitMap对象
     */
    public void saveImageToGallery(Context context, int selectPosition, Bitmap bmp) {
        // 首先保存图片 创建文件夹
        File appDir = new File(Environment.getExternalStorageDirectory(), "shy");
        if (!appDir.exists()) {
            appDir.mkdir();
        }
        //图片文件名称
        String fileName = "shy_" + System.currentTimeMillis() + ".jpg";
        File file = new File(appDir, fileName);
        try {
            FileOutputStream fos = new FileOutputStream(file);
            bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
            fos.flush();
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

        // 其次把文件插入到系统图库
        String path = file.getAbsolutePath();
        try {
            MediaStore.Images.Media.insertImage(context.getContentResolver(), path, fileName, null);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        // 最后通知图库更新
        Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
        Uri uri = Uri.fromFile(file);
        intent.setData(uri);
        context.sendBroadcast(intent);
        //根据savedPath图片路径获取图片的宽高
        Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/shy/" + fileName);
        mArrayExtra.get(selectPosition).filePath = Environment.getExternalStorageDirectory() + "/shy/" + fileName;
        mArrayExtra.get(selectPosition).width = bitmap.getWidth();
        mArrayExtra.get(selectPosition).height = bitmap.getHeight();
        currentImg++;
        updataImg();

    }

    //返回、传值
    public void finishPage() {
        Intent setIntent = new Intent();
        setIntent.putExtra(VIDEO_PATH_KEY, mArrayExtra);
        setResult(1, setIntent);
        finish();
    }

    //初始化viewPager图片滑动显示,adapter的item是View
    private void initViewPager() {
        mViewList = new ArrayList<>();
        for (int m = 0; m < mArrayExtra.size(); m++) {
            View inflate = LayoutInflater.from(mContext).inflate(R.layout.activity_add_picture_edge_item, null);
            ImageView imageView = inflate.findViewById(R.id.iv_edge);
            imageView.setImageBitmap(mBitMapList.get(m));
            mViewList.add(inflate);
        }
        ViewAdapter viewAdapter = new ViewAdapter(mViewList);
        viewPager.setAdapter(viewAdapter);
        viewPager.setOffscreenPageLimit(mArrayExtra.size());
    }

    @Override
    public int setLayoutId() {
        return R.layout.activity_add_picture_frame;
    }

    @Override
    public String setTitle() {
        return getString(R.string.string_add_picture_frame);
    }

    @Override
    public void wingetListener() {
        tvNextStep.setOnClickListener(this);
        //tabLayout 的选择点击事件
        xtabLayout.setOnTabSelectedListener(new XTabLayout.OnTabSelectedListener() {


            @Override
            public void onTabSelected(XTabLayout.Tab tab) {
                boolean isScroll = false;
                if (null != mList) {

                    try {
                        tabPosition = tab.getPosition();
                        mList.clear();
                        mList.addAll(Globals.mResList.get(tab.getPosition()));
                        //选择tablayout,判断当前是否有选择的样式
                        if (mArrayExtra.get(viewPager.getCurrentItem()).selectFrameType == tabPosition) {
                            mAdapter.selectIndex = mArrayExtra.get(viewPager.getCurrentItem()).selectFrameContent;
                        } else {
                            mAdapter.selectIndex = -1;
                        }
                        mAdapter.notifyDataSetChanged();
                        if (mAdapter.selectIndex != -1) { //滑动到指定的item
                            mLayoutManager.smoothScrollToPosition(recycleView, new RecyclerView.State(), mAdapter.selectIndex);
                        } else {
                            mLayoutManager.smoothScrollToPosition(recycleView, new RecyclerView.State(), 0);
                        }
                        //去掉选择过得画框
//                    changeImageBorder(null);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            @Override
            public void onTabUnselected(XTabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(XTabLayout.Tab tab) {

            }
        });
        viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                //如果滑动的时候当前有增加画框的记录,设置画框
                if (mArrayExtra.get(position).isAddPicture) {
                    changeAlreaySelectImageBorder(position, mArrayExtra.get(position).selectFrameType, mArrayExtra.get(position).selectFrameContent);
                } else {
                    mAdapter.selectIndex = -1;
                    mAdapter.notifyDataSetChanged();
//                    changeImageBorder(null,false);
                    //滑动到开头
                    mLayoutManager.smoothScrollToPosition(recycleView, new RecyclerView.State(), 0);
                }
                if (mAdapter.selectIndex != -1) { //滑动到指定的item

                } else {

                }
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });
    }

    //初始化边框样式
    private void initRecycleView() {
        //添加标题:初始化TabLayout画框分类
        for (int i = 0; i < mtitleList.size(); i++) {
            xtabLayout.addTab(xtabLayout.newTab().setText(mtitleList.get(i)));
        }

        //LinearLayoutManager是用来做列表布局,也就是单列的列表
        mLayoutManager = new CenterLayoutManager(this, RecyclerView.HORIZONTAL, false);
        recycleView.setLayoutManager(mLayoutManager);

        //谷歌提供了一个DividerItemDecoration的实现类来实现分割线
        RecycleLeftDecoration dividerItemDecoration = new RecycleLeftDecoration(this, 7);
        recycleView.addItemDecoration(dividerItemDecoration);

        mList = new ArrayList<>();
        mList.addAll(Globals.mResList.get(0));
        mAdapter = new AddPictureFrameAdapter(mContext, R.layout.add_picture_frame_adapter, mList);
        mAdapter.setAddPictureAdapterInterface(this);
        recycleView.setAdapter(mAdapter);
        mAdapter.notifyDataSetChanged();
    }


    /**
     * 图片与边框组合
     *
     * @param bm  原图片
     * @param res 边框资源
     * @return
     */
    float scaleRatio = 0; //设置图片都比例

    private Bitmap combinateFrame(Bitmap bm, Object res) {
        // 原图片的宽高
        final int bmW = bm.getWidth();
        final int bmH = bm.getHeight();
        final int bigH;
        final int bigW;
        // 组合后图片的宽高
        if (bm.getHeight() > bm.getWidth()) { //长图
            // 50 上下边距    15 上边距   25 下边距
            bigH = mViewPagerHeight - 50 * 2 - (paddDistanceVP + paddBottomDistanceVP);
            bigW = bigH * bm.getWidth() / bm.getHeight();
        } else { //宽图
            // 50上下边距  15*2 左右边距
            bigW = mViewPagerWidth - 50 * 2 - paddDistanceVP * 2;
            bigH = bigW * bm.getHeight() / bm.getWidth();
        }
        if (res instanceof int[]) {
            int[] resInt = (int[]) res;
            // 标识:可需增加边框
            mArrayExtra.get(viewPager.getCurrentItem()).isAddPicture = true;

            Bitmap topBm1 = decodeBitmap(resInt[7]);//根据上边算缩放比率,进行缩放

            if (topBm1.getHeight() * 3.2 <= 128) {
                scaleRatio = 3.2f;
            } else {
                scaleRatio = 128f / (float) topBm1.getHeight();
            }
            Bitmap topBm = big(topBm1);
            Bitmap leftTopBm1 = decodeBitmap(resInt[0]); // 左上角
            Bitmap leftTopBm = big(leftTopBm1);
            Bitmap leftBottomBm1 = decodeBitmap(resInt[2]); // 左下角
            Bitmap leftBottomBm = big(leftBottomBm1);
            Bitmap rightBottomBm1 = decodeBitmap(resInt[4]); // 右下角
            Bitmap rightBottomBm = big(rightBottomBm1);
            Bitmap rightTopBm1 = decodeBitmap(resInt[6]); // 右上角
            Bitmap rightTopBm = big(rightTopBm1);
            Bitmap bottomBm1 = decodeBitmap(resInt[3]); //下边
            Bitmap bottomBm = big(bottomBm1);
            Bitmap leftBm1 = decodeBitmap(resInt[1]); //左边
            Bitmap leftBm = big(leftBm1);
            Bitmap rightBm1 = decodeBitmap(resInt[5]); //右边
            Bitmap rightBm = big(rightBm1);

            //左上角宽度
            int leftTopBmWidth = leftTopBm.getWidth();
            //左上角高度
            int leftTopBmHeight = leftTopBm.getHeight();
            //右上角高度
            int rightTopBmHeight = rightTopBm.getHeight();
            //左边宽度
            int leftBmWidth = leftBm.getWidth();
            //右边宽度
            int rightBmWidth = rightBm.getWidth();
            //下边高度
            int bottomBmHeight = bottomBm.getHeight();
            //上边高度
            int topBmHeight = topBm.getHeight();


            // 组合后图片的宽高
            //组合后最新宽度:左边宽度 + 原图宽度 + 右边宽度   左右边距
            int newW = leftBmWidth + bigW + rightBmWidth + (paddDistance * 2);
            //组合后最新高度: 上边高度 + 原图高度 + 下边高度  上下边距
            int newH = topBmHeight + bigH + bottomBmHeight + (paddDistance + paddBottomDistance);

            // 重新定义大小
            Bitmap newBitmap = Bitmap.createBitmap(newW, newH, Bitmap.Config.RGB_565);
            Canvas canvas = new Canvas(newBitmap);
            Paint p = new Paint();
            p.setColor(Color.WHITE);
            //绘制定义的总大小
            canvas.drawRect(new Rect(0, 0, newW, newH), p);
            Matrix matrix = new Matrix();
//
            matrix.postTranslate(leftBmWidth + paddDistance, topBmHeight + paddDistance);
            matrix.preScale(((float) bigW / bmW), ((float) bigH / bmH));
            canvas.drawBitmap(bm, matrix, null);


            //绘制左上角
            canvas.drawBitmap(leftTopBm, paddDistance, paddDistance, null);
            //绘制左下角  top: 上边高度 + 原图片高度
            canvas.drawBitmap(leftBottomBm, paddDistance, topBmHeight + bigH + paddDistance, null);
            //绘制右上角  left:左边宽度 + 原图片宽度
            canvas.drawBitmap(rightTopBm, leftBmWidth + bigW + paddDistance, paddDistance, null);
            //绘制右下角  left:左边宽度 + 原图片宽度   top:上边高度 + 原图片高度
            canvas.drawBitmap(rightBottomBm, leftBmWidth + bigW + paddDistance, topBmHeight + bigH + paddDistance, null);


            //改变左边宽高 width:原左边宽度   高:原图片高度
//            Bitmap leftitmap = getNewBitmap(leftBm, leftBm.getWidth(), bigH);
            Bitmap leftitmap = getNewBitmap(leftBm, 0, bigH);
            //绘制左边  left:0     top:左上角的高度
            canvas.drawBitmap(leftitmap, paddDistance, leftTopBmHeight + paddDistance, null);

            //改变右边宽高 width:原右边宽度   高:原图片高度
//            Bitmap rightBitmap = getNewBitmap(rightBm, rightBm.getWidth(), bigH);
            Bitmap rightBitmap = getNewBitmap(rightBm, 0, bigH);
            //绘制右边  left:原图片宽度 + 左边宽度     top:右上角的高度
            canvas.drawBitmap(rightBitmap, bigW + leftBmWidth + paddDistance, rightTopBmHeight + paddDistance, null);

            //修改上边距bitmap宽高 : width:原图片宽度   top:原上边高度
//            Bitmap topBitmap = getNewBitmap(topBm, bigW, topBmHeight);
            Bitmap topBitmap = getNewBitmap(topBm, bigW, 0);
            //绘制上边 left:左上角宽度
            canvas.drawBitmap(topBitmap, leftTopBmWidth + paddDistance, paddDistance, null);

            //修改下边距bitmap宽高 : width:原图片宽度   top:原下边高度
//            Bitmap bottomBitmap = getNewBitmap(bottomBm, bigW, bottomBm.getHeight());
            Bitmap bottomBitmap = getNewBitmap(bottomBm, bigW, 0);
            //绘制下边 left:左边宽度   top:上边高度 + 原图片高度
            canvas.drawBitmap(bottomBitmap, leftBmWidth + paddDistance, topBmHeight + bigH + paddDistance, null);


            //释放资源
            bottomBitmap.recycle();
            bottomBitmap = null;
            topBitmap.recycle();
            topBitmap = null;
            rightBitmap.recycle();
            rightBitmap = null;
            leftitmap.recycle();
            leftitmap = null;
            leftTopBm.recycle();
            leftTopBm = null;
            leftBottomBm.recycle();
            leftBottomBm = null;
            rightBottomBm.recycle();
            rightBottomBm = null;
            rightTopBm.recycle();
            rightTopBm = null;
            bottomBm.recycle();
            bottomBm = null;
            topBm.recycle();
            topBm = null;
            leftBm.recycle();
            leftBm = null;
            rightBm.recycle();
            rightBm = null;

            canvas.save();
            canvas.restore();

            return newBitmap;
        } else {
            // 标识:无边框
            mArrayExtra.get(viewPager.getCurrentItem()).isAddPicture = false;


            // 重新定义大小  15 25
//            Bitmap newBitmap = Bitmap.createBitmap(newW, newH, Bitmap.Config.RGB_565);
            Bitmap newBitmap = Bitmap.createBitmap(bigW, bigH, Bitmap.Config.RGB_565);
            Canvas canvas = new Canvas(newBitmap);
            Paint p = new Paint();
            p.setColor(Color.WHITE);
            //绘制定义的总大小
            canvas.drawRect(new Rect(0, 0, bigW, bigH), p);

            // 绘原图  left:左边宽度    top:上边边距
            Matrix matrix = new Matrix();
//        //缩放 (按照图片的比例去缩放)
            matrix.setScale(((float) bigW / bmW), ((float) bigH / bmH));
            canvas.drawBitmap(bm, matrix, null);
            canvas.save();
            canvas.restore();
            return newBitmap;
        }
    }

    //根据资源文件获取BitMap对象
    public Bitmap decodeBitmap(int fileRes) {
        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        // Decode bitmap with inSampleSize set
        options.inJustDecodeBounds = false;
        //避免出现内存溢出的情况,进行相应的属性设置。
        options.inPreferredConfig = Bitmap.Config.RGB_565;
        options.inDither = true;

        return BitmapFactory.decodeResource(getResources(), fileRes, options);
    }

    public Bitmap fileDecodeBitmap(String fileRes) {

        BitmapFactory.Options options = new BitmapFactory.Options();

        options.inPreferredConfig = Bitmap.Config.RGB_565;
        return BitmapFactory.decodeFile(fileRes, options);
    }

    /**
     * 设置宽、高(目的就是包裹图片)
     */
    public Bitmap getNewBitmap(Bitmap bitmap, int newWidth, int newHeight) {
        // 获得图片的宽高.
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        // 计算缩放比例.
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;
        // 取得想要缩放的matrix参数.
        Matrix matrix = new Matrix();
        matrix.postScale(scaleWidth == 0 ? 1 : scaleWidth, scaleHeight == 0 ? 1 : scaleHeight);
        // 得到新的图片.
        Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
        return newBitmap;
    }


    // 选择画框的点击事件
    @Override
    public void pictureItemOnclik(int position, boolean isSelect) {
        //记录当前图片所选的边框并滑到所选position
        if (isSelect) {
            mLayoutManager.smoothScrollToPosition(recycleView, new RecyclerView.State(), position);
        }
        mArrayExtra.get(viewPager.getCurrentItem()).selectFrameType = isSelect ? tabPosition : -1;
        mArrayExtra.get(viewPager.getCurrentItem()).selectFrameContent = isSelect ? position : -1;
        changeImageBorder(isSelect ? mList.get(position) : null, true);
        Log.e("UUUUUU", "isSelect ====" + isSelect + "----posotion ---" + position);
        mAdapter.notifyDataSetChanged();
    }

    //改变画框样式
    public void changeImageBorder(Object obj, boolean isClick) {
        View view = viewPager.findViewWithTag(viewPager.getCurrentItem());
        if (null != view) {
            ImageView viewById = view.findViewById(R.id.iv_edge);
            viewById.setImageBitmap(combinateFrame(mBitMapList.get(viewPager.getCurrentItem()), obj));

        }
    }


    /**
     * 去换已选画框样式
     *
     * @param viewpageCurrentItem 当前选取的那张图片
     * @param selecType           xtablayout 所选的类型
     * @param selectContent       res所选的资源文件(recycleView)
     */
    public void changeAlreaySelectImageBorder(int viewpageCurrentItem, int selecType, int selectContent) {
        if (null == mList || null == mAdapter || null == viewPager) {
            return;
        }
        //更换画框数据
        mList.clear();
        mList.addAll(Globals.mResList.get(selecType));
        mAdapter.selectIndex = selectContent;
        mAdapter.notifyDataSetChanged();
        //滑动到指定的position
        mLayoutManager.smoothScrollToPosition(recycleView, new RecyclerView.State(), mAdapter.selectIndex);
        //将tabLayout移动相应的tab标签下
        xtabLayout.setScrollPosition(selecType, 0, true);
        //更改当前viewpage item画框
        View view = viewPager.findViewWithTag(viewpageCurrentItem);
        if (null != view) {
            ImageView viewById = view.findViewById(R.id.iv_edge);
            viewById.setImageBitmap(combinateFrame(mBitMapList.get(viewpageCurrentItem), mList.get(selectContent)));

        }
    }

    class ViewAdapter extends PagerAdapter {
        private List<View> datas;

        public ViewAdapter(List<View> list) {
            datas = list;
        }

        @Override
        public int getCount() {
            return datas.size();
        }

        @Override
        public boolean isViewFromObject(View view, Object object) {
            return view == object;
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            datas.get(position).setTag(position);
            View view = datas.get(position);
            container.addView(view);
            return view;
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView(datas.get(position));
        }
    }

    /**
     * 长和宽放大缩小的比例
     */
    private Bitmap big(Bitmap bitmap) {
        Matrix matrix = new Matrix();
        matrix.postScale(scaleRatio, scaleRatio);
        Bitmap resizeBmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        return resizeBmp;
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        handler.removeCallbacksAndMessages(null);
        handler = null;
        mBitMapList.clear();
        mBitMapList = null;
        mArrayExtra = null;
    }
}






-------------------------------------------------------------------------------------------

 

 

public class AddPictureFrameAdapter extends BaseQuickAdapter<int[], AddPictureFrameAdapter.MyViewHolder> {


    public int selectIndex = -1; //选择的哪一个
    private Context context;

    public AddPictureFrameAdapter(Context context, int layoutResId, @Nullable ArrayList<int[]> data) {
        super(layoutResId, data);
        this.context = context;
    }

    public interface AddPictureAdapterInterface {
        void pictureItemOnclik(int position, boolean isSelect);
    }

    private AddPictureAdapterInterface mAddPictureAdapterInterface;

    public void setAddPictureAdapterInterface(AddPictureAdapterInterface addPictureAdapterInterface) {
        this.mAddPictureAdapterInterface = addPictureAdapterInterface;
    }


    @Override
    protected void convert(MyViewHolder helper, int[] item) {
        helper.ivEdgeItem.setImageResource(item[8]);
        helper.ivEdgeItem.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (null != mAddPictureAdapterInterface) {
                    if (selectIndex == -1 || selectIndex != helper.getPosition())
                        selectIndex = helper.getPosition();
                    else if (selectIndex == helper.getPosition())
                        selectIndex = -1;
                    mAddPictureAdapterInterface.pictureItemOnclik(helper.getPosition(), selectIndex == -1 ? false : true);
                }
            }
        });
        //选中设置边框
        helper.llPictureBorder.setBackground((selectIndex == helper.getPosition()) ? context.getResources().getDrawable(R.drawable.ccab86_round_stroke_2dp) : null);
    }

    public class MyViewHolder extends BaseViewHolder {
        private ImageView ivEdgeItem;
        private LinearLayout llPictureBorder;

        public MyViewHolder(View view) {
            super(view);
            llPictureBorder = view.findViewById(R.id.ll_picture_border);
            ivEdgeItem = view.findViewById(R.id.iv_edge_item);
        }
    }
}

 

 

------------------------------------------------------

 

 

public class AddPictureUtils {
    ArrayList<int[]> caiqianList = new ArrayList<>();
    ArrayList<int[]> chahuaList = new ArrayList<>();
    ArrayList<int[]> dancaiList = new ArrayList<>();
    ArrayList<int[]> guohuaList = new ArrayList<>();
    ArrayList<int[]> shufaList = new ArrayList<>();
    ArrayList<int[]> shuicaiList = new ArrayList<>();
    ArrayList<int[]> youhuaList = new ArrayList<>();
    ArrayList<ArrayList<int[]>> mAddPictureList = new ArrayList<>();
    private Context mContext;

    public AddPictureUtils(Context context) {
        this.mContext = context;
    }

    public ArrayList<ArrayList<int[]>> init() {
        caiqianList.add(edge_caiqian_1);
        caiqianList.add(edge_caiqian_2);
        caiqianList.add(edge_caiqian_3);
        caiqianList.add(edge_caiqian_4);
        caiqianList.add(edge_caiqian_5);
        caiqianList.add(edge_caiqian_6);
        caiqianList.add(edge_caiqian_7);
        caiqianList.add(edge_caiqian_8);
        caiqianList.add(edge_caiqian_9);
        caiqianList.add(edge_caiqian_10);
        caiqianList.add(edge_caiqian_11);
        caiqianList.add(edge_caiqian_12);
        caiqianList.add(edge_caiqian_13);
        caiqianList.add(edge_caiqian_14);
        caiqianList.add(edge_caiqian_15);
        mAddPictureList.add(caiqianList);
//        -----------------------
        chahuaList.add(edge_chahua_1);
        chahuaList.add(edge_chahua_2);
        chahuaList.add(edge_chahua_3);
        chahuaList.add(edge_chahua_4);
        chahuaList.add(edge_chahua_5);
        chahuaList.add(edge_chahua_6);
        chahuaList.add(edge_chahua_7);
        chahuaList.add(edge_chahua_8);
        chahuaList.add(edge_chahua_9);
        chahuaList.add(edge_chahua_10);
        chahuaList.add(edge_chahua_11);
        chahuaList.add(edge_chahua_12);
        chahuaList.add(edge_chahua_13);
        mAddPictureList.add(chahuaList);
//        ----------------------
        dancaiList.add(edge_dancai_1);
        dancaiList.add(edge_dancai_2);
        dancaiList.add(edge_dancai_3);
        dancaiList.add(edge_dancai_4);
        dancaiList.add(edge_dancai_5);
        dancaiList.add(edge_dancai_6);
        dancaiList.add(edge_dancai_7);
        dancaiList.add(edge_dancai_8);
        mAddPictureList.add(dancaiList);
//        ------------------------
        guohuaList.add(edge_guohua_1);
        guohuaList.add(edge_guohua_2);
        guohuaList.add(edge_guohua_3);
        guohuaList.add(edge_guohua_4);
        guohuaList.add(edge_guohua_5);
        guohuaList.add(edge_guohua_6);
        guohuaList.add(edge_guohua_7);
        guohuaList.add(edge_guohua_8);
        guohuaList.add(edge_guohua_9);
        guohuaList.add(edge_guohua_10);
        guohuaList.add(edge_guohua_11);
        guohuaList.add(edge_guohua_12);
        guohuaList.add(edge_guohua_13);
        guohuaList.add(edge_guohua_14);
        guohuaList.add(edge_guohua_15);
        guohuaList.add(edge_guohua_16);
        guohuaList.add(edge_guohua_17);
        guohuaList.add(edge_guohua_18);
        guohuaList.add(edge_guohua_19);
        guohuaList.add(edge_guohua_20);
        guohuaList.add(edge_guohua_21);
        guohuaList.add(edge_guohua_22);
        mAddPictureList.add(guohuaList);
//        --------------------------
        shufaList.add(edge_shufa_1);
        shufaList.add(edge_shufa_2);
        shufaList.add(edge_shufa_3);
        shufaList.add(edge_shufa_4);
        shufaList.add(edge_shufa_5);
        shufaList.add(edge_shufa_6);
        shufaList.add(edge_shufa_7);
        shufaList.add(edge_shufa_8);
        shufaList.add(edge_shufa_9);
        shufaList.add(edge_shufa_10);
        shufaList.add(edge_shufa_11);
        shufaList.add(edge_shufa_12);
        shufaList.add(edge_shufa_13);
        shufaList.add(edge_shufa_14);
        shufaList.add(edge_shufa_15);
        shufaList.add(edge_shufa_16);
        mAddPictureList.add(shufaList);
//        ---------------------
        shuicaiList.add(edge_shuicai_1);
        shuicaiList.add(edge_shuicai_2);
        shuicaiList.add(edge_shuicai_3);
        shuicaiList.add(edge_shuicai_4);
        shuicaiList.add(edge_shuicai_5);
        shuicaiList.add(edge_shuicai_6);
        shuicaiList.add(edge_shuicai_7);
        shuicaiList.add(edge_shuicai_8);
        shuicaiList.add(edge_shuicai_9);
        shuicaiList.add(edge_shuicai_10);
        shuicaiList.add(edge_shuicai_11);
        shuicaiList.add(edge_shuicai_12);
        shuicaiList.add(edge_shuicai_13);
        shuicaiList.add(edge_shuicai_14);
        shuicaiList.add(edge_shuicai_15);
        shuicaiList.add(edge_shuicai_16);
        mAddPictureList.add(shuicaiList);
//        -----------------------
        youhuaList.add(edge_youhua_1);
        youhuaList.add(edge_youhua_2);
        youhuaList.add(edge_youhua_3);
        youhuaList.add(edge_youhua_4);
        youhuaList.add(edge_youhua_5);
        youhuaList.add(edge_youhua_6);
        youhuaList.add(edge_youhua_7);
        youhuaList.add(edge_youhua_8);
        youhuaList.add(edge_youhua_9);
        youhuaList.add(edge_youhua_10);
        youhuaList.add(edge_youhua_11);
        youhuaList.add(edge_youhua_12);
        youhuaList.add(edge_youhua_13);
        youhuaList.add(edge_youhua_14);
        youhuaList.add(edge_youhua_15);
        youhuaList.add(edge_youhua_16);
        mAddPictureList.add(youhuaList);
        return mAddPictureList;
    }

    public ArrayList<String> initTitle() {
        ArrayList<String> titleList = new ArrayList<>();
        titleList.add(mContext.getString(R.string.string_caiqian));
        titleList.add(mContext.getString(R.string.string_chahua_or_manhua));
        titleList.add(mContext.getString(R.string.string_dancai_or_suxie));
        titleList.add(mContext.getString(R.string.string_guohua));
        titleList.add(mContext.getString(R.string.string_shufa));
        titleList.add(mContext.getString(R.string.string_shuicai));
        titleList.add(mContext.getString(R.string.string_youhua_or_bingxi));
        return titleList;
    }

    //彩铅
    int[] edge_caiqian_1 = new int[]{R.mipmap.edge_caiqian_1_0, R.mipmap.edge_caiqian_1_1, R.mipmap.edge_caiqian_1_2, R.mipmap.edge_caiqian_1_3, R.mipmap.edge_caiqian_1_4, R.mipmap.edge_caiqian_1_5, R.mipmap.edge_caiqian_1_6, R.mipmap.edge_caiqian_1_7, R.mipmap.edge_caiqian_1_show};
    int[] edge_caiqian_2 = new int[]{R.mipmap.edge_caiqian_2_0, R.mipmap.edge_caiqian_2_1, R.mipmap.edge_caiqian_2_2, R.mipmap.edge_caiqian_2_3, R.mipmap.edge_caiqian_2_4, R.mipmap.edge_caiqian_2_5, R.mipmap.edge_caiqian_2_6, R.mipmap.edge_caiqian_2_7, R.mipmap.edge_caiqian_2_show};
    int[] edge_caiqian_3 = new int[]{R.mipmap.edge_caiqian_3_0, R.mipmap.edge_caiqian_3_1, R.mipmap.edge_caiqian_3_2, R.mipmap.edge_caiqian_3_3, R.mipmap.edge_caiqian_3_4, R.mipmap.edge_caiqian_3_5, R.mipmap.edge_caiqian_3_6, R.mipmap.edge_caiqian_3_7, R.mipmap.edge_caiqian_3_show};
    int[] edge_caiqian_4 = new int[]{R.mipmap.edge_caiqian_4_0, R.mipmap.edge_caiqian_4_1, R.mipmap.edge_caiqian_4_2, R.mipmap.edge_caiqian_4_3, R.mipmap.edge_caiqian_4_4, R.mipmap.edge_caiqian_4_5, R.mipmap.edge_caiqian_4_6, R.mipmap.edge_caiqian_4_7, R.mipmap.edge_caiqian_4_show};
    int[] edge_caiqian_5 = new int[]{R.mipmap.edge_caiqian_5_0, R.mipmap.edge_caiqian_5_1, R.mipmap.edge_caiqian_5_2, R.mipmap.edge_caiqian_5_3, R.mipmap.edge_caiqian_5_4, R.mipmap.edge_caiqian_5_5, R.mipmap.edge_caiqian_5_6, R.mipmap.edge_caiqian_5_7, R.mipmap.edge_caiqian_5_show};
    int[] edge_caiqian_6 = new int[]{R.mipmap.edge_caiqian_6_0, R.mipmap.edge_caiqian_6_1, R.mipmap.edge_caiqian_6_2, R.mipmap.edge_caiqian_6_3, R.mipmap.edge_caiqian_6_4, R.mipmap.edge_caiqian_6_5, R.mipmap.edge_caiqian_6_6, R.mipmap.edge_caiqian_6_7, R.mipmap.edge_caiqian_6_show};
    int[] edge_caiqian_7 = new int[]{R.mipmap.edge_caiqian_7_0, R.mipmap.edge_caiqian_7_1, R.mipmap.edge_caiqian_7_2, R.mipmap.edge_caiqian_7_3, R.mipmap.edge_caiqian_7_4, R.mipmap.edge_caiqian_7_5, R.mipmap.edge_caiqian_7_6, R.mipmap.edge_caiqian_7_7, R.mipmap.edge_caiqian_7_show};
    int[] edge_caiqian_8 = new int[]{R.mipmap.edge_caiqian_8_0, R.mipmap.edge_caiqian_8_1, R.mipmap.edge_caiqian_8_2, R.mipmap.edge_caiqian_8_3, R.mipmap.edge_caiqian_8_4, R.mipmap.edge_caiqian_8_5, R.mipmap.edge_caiqian_8_6, R.mipmap.edge_caiqian_8_7, R.mipmap.edge_caiqian_8_show};
    int[] edge_caiqian_9 = new int[]{R.mipmap.edge_caiqian_9_0, R.mipmap.edge_caiqian_9_1, R.mipmap.edge_caiqian_9_2, R.mipmap.edge_caiqian_9_3, R.mipmap.edge_caiqian_9_4, R.mipmap.edge_caiqian_9_5, R.mipmap.edge_caiqian_9_6, R.mipmap.edge_caiqian_9_7, R.mipmap.edge_caiqian_9_show};
    int[] edge_caiqian_10 = new int[]{R.mipmap.edge_caiqian_10_0, R.mipmap.edge_caiqian_10_1, R.mipmap.edge_caiqian_10_2, R.mipmap.edge_caiqian_10_3, R.mipmap.edge_caiqian_10_4, R.mipmap.edge_caiqian_10_5, R.mipmap.edge_caiqian_10_6, R.mipmap.edge_caiqian_10_7, R.mipmap.edge_caiqian_10_show};
    int[] edge_caiqian_11 = new int[]{R.mipmap.edge_caiqian_11_0, R.mipmap.edge_caiqian_11_1, R.mipmap.edge_caiqian_11_2, R.mipmap.edge_caiqian_11_3, R.mipmap.edge_caiqian_11_4, R.mipmap.edge_caiqian_11_5, R.mipmap.edge_caiqian_11_6, R.mipmap.edge_caiqian_11_7, R.mipmap.edge_caiqian_11_show};
    int[] edge_caiqian_12 = new int[]{R.mipmap.edge_caiqian_12_0, R.mipmap.edge_caiqian_12_1, R.mipmap.edge_caiqian_12_2, R.mipmap.edge_caiqian_12_3, R.mipmap.edge_caiqian_12_4, R.mipmap.edge_caiqian_12_5, R.mipmap.edge_caiqian_12_6, R.mipmap.edge_caiqian_12_7, R.mipmap.edge_caiqian_12_show};
    int[] edge_caiqian_13 = new int[]{R.mipmap.edge_caiqian_13_0, R.mipmap.edge_caiqian_13_1, R.mipmap.edge_caiqian_13_2, R.mipmap.edge_caiqian_13_3, R.mipmap.edge_caiqian_13_4, R.mipmap.edge_caiqian_13_5, R.mipmap.edge_caiqian_13_6, R.mipmap.edge_caiqian_13_7, R.mipmap.edge_caiqian_13_show};
    int[] edge_caiqian_14 = new int[]{R.mipmap.edge_caiqian_14_0, R.mipmap.edge_caiqian_14_1, R.mipmap.edge_caiqian_14_2, R.mipmap.edge_caiqian_14_3, R.mipmap.edge_caiqian_14_4, R.mipmap.edge_caiqian_14_5, R.mipmap.edge_caiqian_14_6, R.mipmap.edge_caiqian_14_7, R.mipmap.edge_caiqian_14_show};
    int[] edge_caiqian_15 = new int[]{R.mipmap.edge_caiqian_15_0, R.mipmap.edge_caiqian_15_1, R.mipmap.edge_caiqian_15_2, R.mipmap.edge_caiqian_15_3, R.mipmap.edge_caiqian_15_4, R.mipmap.edge_caiqian_15_5, R.mipmap.edge_caiqian_15_6, R.mipmap.edge_caiqian_15_7, R.mipmap.edge_caiqian_15_show};
    //插画漫画
    int[] edge_chahua_1 = new int[]{R.mipmap.edge_chahua_1_0, R.mipmap.edge_chahua_1_1, R.mipmap.edge_chahua_1_2, R.mipmap.edge_chahua_1_3, R.mipmap.edge_chahua_1_4, R.mipmap.edge_chahua_1_5, R.mipmap.edge_chahua_1_6, R.mipmap.edge_chahua_1_7, R.mipmap.edge_chahua_1_show};
    int[] edge_chahua_2 = new int[]{R.mipmap.edge_chahua_2_0, R.mipmap.edge_chahua_2_1, R.mipmap.edge_chahua_2_2, R.mipmap.edge_chahua_2_3, R.mipmap.edge_chahua_2_4, R.mipmap.edge_chahua_2_5, R.mipmap.edge_chahua_2_6, R.mipmap.edge_chahua_2_7, R.mipmap.edge_chahua_2_show};
    int[] edge_chahua_3 = new int[]{R.mipmap.edge_chahua_3_0, R.mipmap.edge_chahua_3_1, R.mipmap.edge_chahua_3_2, R.mipmap.edge_chahua_3_3, R.mipmap.edge_chahua_3_4, R.mipmap.edge_chahua_3_5, R.mipmap.edge_chahua_3_6, R.mipmap.edge_chahua_3_7, R.mipmap.edge_chahua_3_show};
    int[] edge_chahua_4 = new int[]{R.mipmap.edge_chahua_4_0, R.mipmap.edge_chahua_4_1, R.mipmap.edge_chahua_4_2, R.mipmap.edge_chahua_4_3, R.mipmap.edge_chahua_4_4, R.mipmap.edge_chahua_4_5, R.mipmap.edge_chahua_4_6, R.mipmap.edge_chahua_4_7, R.mipmap.edge_chahua_4_show};
    int[] edge_chahua_5 = new int[]{R.mipmap.edge_chahua_5_0, R.mipmap.edge_chahua_5_1, R.mipmap.edge_chahua_5_2, R.mipmap.edge_chahua_5_3, R.mipmap.edge_chahua_5_4, R.mipmap.edge_chahua_5_5, R.mipmap.edge_chahua_5_6, R.mipmap.edge_chahua_5_7, R.mipmap.edge_chahua_5_show};
    int[] edge_chahua_6 = new int[]{R.mipmap.edge_chahua_6_0, R.mipmap.edge_chahua_6_1, R.mipmap.edge_chahua_6_2, R.mipmap.edge_chahua_6_3, R.mipmap.edge_chahua_6_4, R.mipmap.edge_chahua_6_5, R.mipmap.edge_chahua_6_6, R.mipmap.edge_chahua_6_7, R.mipmap.edge_chahua_6_show};
    int[] edge_chahua_7 = new int[]{R.mipmap.edge_chahua_7_0, R.mipmap.edge_chahua_7_1, R.mipmap.edge_chahua_7_2, R.mipmap.edge_chahua_7_3, R.mipmap.edge_chahua_7_4, R.mipmap.edge_chahua_7_5, R.mipmap.edge_chahua_7_6, R.mipmap.edge_chahua_7_7, R.mipmap.edge_chahua_7_show};
    int[] edge_chahua_8 = new int[]{R.mipmap.edge_chahua_8_0, R.mipmap.edge_chahua_8_1, R.mipmap.edge_chahua_8_2, R.mipmap.edge_chahua_8_3, R.mipmap.edge_chahua_8_4, R.mipmap.edge_chahua_8_5, R.mipmap.edge_chahua_8_6, R.mipmap.edge_chahua_8_7, R.mipmap.edge_chahua_8_show};
    int[] edge_chahua_9 = new int[]{R.mipmap.edge_chahua_9_0, R.mipmap.edge_chahua_9_1, R.mipmap.edge_chahua_9_2, R.mipmap.edge_chahua_9_3, R.mipmap.edge_chahua_9_4, R.mipmap.edge_chahua_9_5, R.mipmap.edge_chahua_9_6, R.mipmap.edge_chahua_9_7, R.mipmap.edge_chahua_9_show};
    int[] edge_chahua_10 = new int[]{R.mipmap.edge_chahua_10_0, R.mipmap.edge_chahua_10_1, R.mipmap.edge_chahua_10_2, R.mipmap.edge_chahua_10_3, R.mipmap.edge_chahua_10_4, R.mipmap.edge_chahua_10_5, R.mipmap.edge_chahua_10_6, R.mipmap.edge_chahua_10_7, R.mipmap.edge_chahua_10_show};
    int[] edge_chahua_11 = new int[]{R.mipmap.edge_chahua_11_0, R.mipmap.edge_chahua_11_1, R.mipmap.edge_chahua_11_2, R.mipmap.edge_chahua_11_3, R.mipmap.edge_chahua_11_4, R.mipmap.edge_chahua_11_5, R.mipmap.edge_chahua_11_6, R.mipmap.edge_chahua_11_7, R.mipmap.edge_chahua_11_show};
    int[] edge_chahua_12 = new int[]{R.mipmap.edge_chahua_12_0, R.mipmap.edge_chahua_12_1, R.mipmap.edge_chahua_12_2, R.mipmap.edge_chahua_12_3, R.mipmap.edge_chahua_12_4, R.mipmap.edge_chahua_12_5, R.mipmap.edge_chahua_12_6, R.mipmap.edge_chahua_12_7, R.mipmap.edge_chahua_12_show};
    int[] edge_chahua_13 = new int[]{R.mipmap.edge_chahua_13_0, R.mipmap.edge_chahua_13_1, R.mipmap.edge_chahua_13_2, R.mipmap.edge_chahua_13_3, R.mipmap.edge_chahua_13_4, R.mipmap.edge_chahua_13_5, R.mipmap.edge_chahua_13_6, R.mipmap.edge_chahua_13_7, R.mipmap.edge_chahua_13_show};
    //淡彩
    int[] edge_dancai_1 = new int[]{R.mipmap.edge_dancai_1_0, R.mipmap.edge_dancai_1_1, R.mipmap.edge_dancai_1_2, R.mipmap.edge_dancai_1_3, R.mipmap.edge_dancai_1_4, R.mipmap.edge_dancai_1_5, R.mipmap.edge_dancai_1_6, R.mipmap.edge_dancai_1_7, R.mipmap.edge_dancai_1_show};
    int[] edge_dancai_2 = new int[]{R.mipmap.edge_dancai_2_0, R.mipmap.edge_dancai_2_1, R.mipmap.edge_dancai_2_2, R.mipmap.edge_dancai_2_3, R.mipmap.edge_dancai_2_4, R.mipmap.edge_dancai_2_5, R.mipmap.edge_dancai_2_6, R.mipmap.edge_dancai_2_7, R.mipmap.edge_dancai_2_show};
    int[] edge_dancai_3 = new int[]{R.mipmap.edge_dancai_3_0, R.mipmap.edge_dancai_3_1, R.mipmap.edge_dancai_3_2, R.mipmap.edge_dancai_3_3, R.mipmap.edge_dancai_3_4, R.mipmap.edge_dancai_3_5, R.mipmap.edge_dancai_3_6, R.mipmap.edge_dancai_3_7, R.mipmap.edge_dancai_3_show};
    int[] edge_dancai_4 = new int[]{R.mipmap.edge_dancai_4_0, R.mipmap.edge_dancai_4_1, R.mipmap.edge_dancai_4_2, R.mipmap.edge_dancai_4_3, R.mipmap.edge_dancai_4_4, R.mipmap.edge_dancai_4_5, R.mipmap.edge_dancai_4_6, R.mipmap.edge_dancai_4_7, R.mipmap.edge_dancai_4_show};
    int[] edge_dancai_5 = new int[]{R.mipmap.edge_dancai_5_0, R.mipmap.edge_dancai_5_1, R.mipmap.edge_dancai_5_2, R.mipmap.edge_dancai_5_3, R.mipmap.edge_dancai_5_4, R.mipmap.edge_dancai_5_5, R.mipmap.edge_dancai_5_6, R.mipmap.edge_dancai_5_7, R.mipmap.edge_dancai_5_show};
    int[] edge_dancai_6 = new int[]{R.mipmap.edge_dancai_6_0, R.mipmap.edge_dancai_6_1, R.mipmap.edge_dancai_6_2, R.mipmap.edge_dancai_6_3, R.mipmap.edge_dancai_6_4, R.mipmap.edge_dancai_6_5, R.mipmap.edge_dancai_6_6, R.mipmap.edge_dancai_6_7, R.mipmap.edge_dancai_6_show};
    int[] edge_dancai_7 = new int[]{R.mipmap.edge_dancai_7_0, R.mipmap.edge_dancai_7_1, R.mipmap.edge_dancai_7_2, R.mipmap.edge_dancai_7_3, R.mipmap.edge_dancai_7_4, R.mipmap.edge_dancai_7_5, R.mipmap.edge_dancai_7_6, R.mipmap.edge_dancai_7_7, R.mipmap.edge_dancai_7_show};
    int[] edge_dancai_8 = new int[]{R.mipmap.edge_dancai_8_0, R.mipmap.edge_dancai_8_1, R.mipmap.edge_dancai_8_2, R.mipmap.edge_dancai_8_3, R.mipmap.edge_dancai_8_4, R.mipmap.edge_dancai_8_5, R.mipmap.edge_dancai_8_6, R.mipmap.edge_dancai_8_7, R.mipmap.edge_dancai_8_show};
    //国画
    int[] edge_guohua_1 = new int[]{R.mipmap.edge_guohua_1_0, R.mipmap.edge_guohua_1_1, R.mipmap.edge_guohua_1_2, R.mipmap.edge_guohua_1_3, R.mipmap.edge_guohua_1_4, R.mipmap.edge_guohua_1_5, R.mipmap.edge_guohua_1_6, R.mipmap.edge_guohua_1_7, R.mipmap.edge_guohua_1_show};
    int[] edge_guohua_2 = new int[]{R.mipmap.edge_guohua_2_0, R.mipmap.edge_guohua_2_1, R.mipmap.edge_guohua_2_2, R.mipmap.edge_guohua_2_3, R.mipmap.edge_guohua_2_4, R.mipmap.edge_guohua_2_5, R.mipmap.edge_guohua_2_6, R.mipmap.edge_guohua_2_7, R.mipmap.edge_guohua_2_show};
    int[] edge_guohua_3 = new int[]{R.mipmap.edge_guohua_3_0, R.mipmap.edge_guohua_3_1, R.mipmap.edge_guohua_3_2, R.mipmap.edge_guohua_3_3, R.mipmap.edge_guohua_3_4, R.mipmap.edge_guohua_3_5, R.mipmap.edge_guohua_3_6, R.mipmap.edge_guohua_3_7, R.mipmap.edge_guohua_3_show};
    int[] edge_guohua_4 = new int[]{R.mipmap.edge_guohua_4_0, R.mipmap.edge_guohua_4_1, R.mipmap.edge_guohua_4_2, R.mipmap.edge_guohua_4_3, R.mipmap.edge_guohua_4_4, R.mipmap.edge_guohua_4_5, R.mipmap.edge_guohua_4_6, R.mipmap.edge_guohua_4_7, R.mipmap.edge_guohua_4_show};
    int[] edge_guohua_5 = new int[]{R.mipmap.edge_guohua_5_0, R.mipmap.edge_guohua_5_1, R.mipmap.edge_guohua_5_2, R.mipmap.edge_guohua_5_3, R.mipmap.edge_guohua_5_4, R.mipmap.edge_guohua_5_5, R.mipmap.edge_guohua_5_6, R.mipmap.edge_guohua_5_7, R.mipmap.edge_guohua_5_show};
    int[] edge_guohua_6 = new int[]{R.mipmap.edge_guohua_6_0, R.mipmap.edge_guohua_6_1, R.mipmap.edge_guohua_6_2, R.mipmap.edge_guohua_6_3, R.mipmap.edge_guohua_6_4, R.mipmap.edge_guohua_6_5, R.mipmap.edge_guohua_6_6, R.mipmap.edge_guohua_6_7, R.mipmap.edge_guohua_6_show};
    int[] edge_guohua_7 = new int[]{R.mipmap.edge_guohua_7_0, R.mipmap.edge_guohua_7_1, R.mipmap.edge_guohua_7_2, R.mipmap.edge_guohua_7_3, R.mipmap.edge_guohua_7_4, R.mipmap.edge_guohua_7_5, R.mipmap.edge_guohua_7_6, R.mipmap.edge_guohua_7_7, R.mipmap.edge_guohua_7_show};
    int[] edge_guohua_8 = new int[]{R.mipmap.edge_guohua_8_0, R.mipmap.edge_guohua_8_1, R.mipmap.edge_guohua_8_2, R.mipmap.edge_guohua_8_3, R.mipmap.edge_guohua_8_4, R.mipmap.edge_guohua_8_5, R.mipmap.edge_guohua_8_6, R.mipmap.edge_guohua_8_7, R.mipmap.edge_guohua_8_show};
    int[] edge_guohua_9 = new int[]{R.mipmap.edge_guohua_9_0, R.mipmap.edge_guohua_9_1, R.mipmap.edge_guohua_9_2, R.mipmap.edge_guohua_9_3, R.mipmap.edge_guohua_9_4, R.mipmap.edge_guohua_9_5, R.mipmap.edge_guohua_9_6, R.mipmap.edge_guohua_9_7, R.mipmap.edge_guohua_9_show};
    int[] edge_guohua_10 = new int[]{R.mipmap.edge_guohua_10_0, R.mipmap.edge_guohua_10_1, R.mipmap.edge_guohua_10_2, R.mipmap.edge_guohua_10_3, R.mipmap.edge_guohua_10_4, R.mipmap.edge_guohua_10_5, R.mipmap.edge_guohua_10_6, R.mipmap.edge_guohua_10_7, R.mipmap.edge_guohua_10_show};
    int[] edge_guohua_11 = new int[]{R.mipmap.edge_guohua_11_0, R.mipmap.edge_guohua_11_1, R.mipmap.edge_guohua_11_2, R.mipmap.edge_guohua_11_3, R.mipmap.edge_guohua_11_4, R.mipmap.edge_guohua_11_5, R.mipmap.edge_guohua_11_6, R.mipmap.edge_guohua_11_7, R.mipmap.edge_guohua_11_show};
    int[] edge_guohua_12 = new int[]{R.mipmap.edge_guohua_12_0, R.mipmap.edge_guohua_12_1, R.mipmap.edge_guohua_12_2, R.mipmap.edge_guohua_12_3, R.mipmap.edge_guohua_12_4, R.mipmap.edge_guohua_12_5, R.mipmap.edge_guohua_12_6, R.mipmap.edge_guohua_12_7, R.mipmap.edge_guohua_12_show};
    int[] edge_guohua_13 = new int[]{R.mipmap.edge_guohua_13_0, R.mipmap.edge_guohua_13_1, R.mipmap.edge_guohua_13_2, R.mipmap.edge_guohua_13_3, R.mipmap.edge_guohua_13_4, R.mipmap.edge_guohua_13_5, R.mipmap.edge_guohua_13_6, R.mipmap.edge_guohua_13_7, R.mipmap.edge_guohua_13_show};
    int[] edge_guohua_14 = new int[]{R.mipmap.edge_guohua_14_0, R.mipmap.edge_guohua_14_1, R.mipmap.edge_guohua_14_2, R.mipmap.edge_guohua_14_3, R.mipmap.edge_guohua_14_4, R.mipmap.edge_guohua_14_5, R.mipmap.edge_guohua_14_6, R.mipmap.edge_guohua_14_7, R.mipmap.edge_guohua_14_show};
    int[] edge_guohua_15 = new int[]{R.mipmap.edge_guohua_15_0, R.mipmap.edge_guohua_15_1, R.mipmap.edge_guohua_15_2, R.mipmap.edge_guohua_15_3, R.mipmap.edge_guohua_15_4, R.mipmap.edge_guohua_15_5, R.mipmap.edge_guohua_15_6, R.mipmap.edge_guohua_15_7, R.mipmap.edge_guohua_15_show};
    int[] edge_guohua_16 = new int[]{R.mipmap.edge_guohua_16_0, R.mipmap.edge_guohua_16_1, R.mipmap.edge_guohua_16_2, R.mipmap.edge_guohua_16_3, R.mipmap.edge_guohua_16_4, R.mipmap.edge_guohua_16_5, R.mipmap.edge_guohua_16_6, R.mipmap.edge_guohua_16_7, R.mipmap.edge_guohua_16_show};
    int[] edge_guohua_17 = new int[]{R.mipmap.edge_guohua_17_0, R.mipmap.edge_guohua_17_1, R.mipmap.edge_guohua_17_2, R.mipmap.edge_guohua_17_3, R.mipmap.edge_guohua_17_4, R.mipmap.edge_guohua_17_5, R.mipmap.edge_guohua_17_6, R.mipmap.edge_guohua_17_7, R.mipmap.edge_guohua_17_show};
    int[] edge_guohua_18 = new int[]{R.mipmap.edge_guohua_18_0, R.mipmap.edge_guohua_18_1, R.mipmap.edge_guohua_18_2, R.mipmap.edge_guohua_18_3, R.mipmap.edge_guohua_18_4, R.mipmap.edge_guohua_18_5, R.mipmap.edge_guohua_18_6, R.mipmap.edge_guohua_18_7, R.mipmap.edge_guohua_18_show};
    int[] edge_guohua_19 = new int[]{R.mipmap.edge_guohua_19_0, R.mipmap.edge_guohua_19_1, R.mipmap.edge_guohua_19_2, R.mipmap.edge_guohua_19_3, R.mipmap.edge_guohua_19_4, R.mipmap.edge_guohua_19_5, R.mipmap.edge_guohua_19_6, R.mipmap.edge_guohua_19_7, R.mipmap.edge_guohua_19_show};
    int[] edge_guohua_20 = new int[]{R.mipmap.edge_guohua_20_0, R.mipmap.edge_guohua_20_1, R.mipmap.edge_guohua_20_2, R.mipmap.edge_guohua_20_3, R.mipmap.edge_guohua_20_6, R.mipmap.edge_guohua_20_5, R.mipmap.edge_guohua_20_4, R.mipmap.edge_guohua_20_7, R.mipmap.edge_guohua_20_show};
    int[] edge_guohua_21 = new int[]{R.mipmap.edge_guohua_21_0, R.mipmap.edge_guohua_21_1, R.mipmap.edge_guohua_21_2, R.mipmap.edge_guohua_21_3, R.mipmap.edge_guohua_21_4, R.mipmap.edge_guohua_21_5, R.mipmap.edge_guohua_21_6, R.mipmap.edge_guohua_21_7, R.mipmap.edge_guohua_21_show};
    int[] edge_guohua_22 = new int[]{R.mipmap.edge_guohua_22_0, R.mipmap.edge_guohua_22_1, R.mipmap.edge_guohua_22_2, R.mipmap.edge_guohua_22_3, R.mipmap.edge_guohua_22_4, R.mipmap.edge_guohua_22_5, R.mipmap.edge_guohua_22_6, R.mipmap.edge_guohua_22_7, R.mipmap.edge_guohua_22_show};
    //书法
    int[] edge_shufa_1 = new int[]{R.mipmap.edge_shufa_1_0, R.mipmap.edge_shufa_1_1, R.mipmap.edge_shufa_1_2, R.mipmap.edge_shufa_1_3, R.mipmap.edge_shufa_1_4, R.mipmap.edge_shufa_1_5, R.mipmap.edge_shufa_1_6, R.mipmap.edge_shufa_1_7, R.mipmap.edge_shufa_1_show};
    int[] edge_shufa_2 = new int[]{R.mipmap.edge_shufa_2_0, R.mipmap.edge_shufa_2_1, R.mipmap.edge_shufa_2_2, R.mipmap.edge_shufa_2_3, R.mipmap.edge_shufa_2_4, R.mipmap.edge_shufa_2_5, R.mipmap.edge_shufa_2_6, R.mipmap.edge_shufa_2_7, R.mipmap.edge_shufa_2_show};
    int[] edge_shufa_3 = new int[]{R.mipmap.edge_shufa_3_0, R.mipmap.edge_shufa_3_1, R.mipmap.edge_shufa_3_2, R.mipmap.edge_shufa_3_3, R.mipmap.edge_shufa_3_4, R.mipmap.edge_shufa_3_5, R.mipmap.edge_shufa_3_6, R.mipmap.edge_shufa_3_7, R.mipmap.edge_shufa_3_show};
    int[] edge_shufa_4 = new int[]{R.mipmap.edge_shufa_4_0, R.mipmap.edge_shufa_4_1, R.mipmap.edge_shufa_4_2, R.mipmap.edge_shufa_4_3, R.mipmap.edge_shufa_4_4, R.mipmap.edge_shufa_4_5, R.mipmap.edge_shufa_4_6, R.mipmap.edge_shufa_4_7, R.mipmap.edge_shufa_4_show};
    int[] edge_shufa_5 = new int[]{R.mipmap.edge_shufa_5_0, R.mipmap.edge_shufa_5_1, R.mipmap.edge_shufa_5_2, R.mipmap.edge_shufa_5_3, R.mipmap.edge_shufa_5_4, R.mipmap.edge_shufa_5_5, R.mipmap.edge_shufa_5_6, R.mipmap.edge_shufa_5_7, R.mipmap.edge_shufa_5_show};
    int[] edge_shufa_6 = new int[]{R.mipmap.edge_shufa_6_0, R.mipmap.edge_shufa_6_1, R.mipmap.edge_shufa_6_2, R.mipmap.edge_shufa_6_3, R.mipmap.edge_shufa_6_4, R.mipmap.edge_shufa_6_5, R.mipmap.edge_shufa_6_6, R.mipmap.edge_shufa_6_7, R.mipmap.edge_shufa_6_show};
    int[] edge_shufa_7 = new int[]{R.mipmap.edge_shufa_7_0, R.mipmap.edge_shufa_7_1, R.mipmap.edge_shufa_7_2, R.mipmap.edge_shufa_7_3, R.mipmap.edge_shufa_7_4, R.mipmap.edge_shufa_7_5, R.mipmap.edge_shufa_7_6, R.mipmap.edge_shufa_7_7, R.mipmap.edge_shufa_7_show};
    int[] edge_shufa_8 = new int[]{R.mipmap.edge_shufa_8_0, R.mipmap.edge_shufa_8_1, R.mipmap.edge_shufa_8_2, R.mipmap.edge_shufa_8_3, R.mipmap.edge_shufa_8_4, R.mipmap.edge_shufa_8_5, R.mipmap.edge_shufa_8_6, R.mipmap.edge_shufa_8_7, R.mipmap.edge_shufa_8_show};
    int[] edge_shufa_9 = new int[]{R.mipmap.edge_shufa_9_0, R.mipmap.edge_shufa_9_1, R.mipmap.edge_shufa_9_2, R.mipmap.edge_shufa_9_3, R.mipmap.edge_shufa_9_4, R.mipmap.edge_shufa_9_5, R.mipmap.edge_shufa_9_6, R.mipmap.edge_shufa_9_7, R.mipmap.edge_shufa_9_show};
    int[] edge_shufa_10 = new int[]{R.mipmap.edge_shufa_10_0, R.mipmap.edge_shufa_10_1, R.mipmap.edge_shufa_10_2, R.mipmap.edge_shufa_10_3, R.mipmap.edge_shufa_10_4, R.mipmap.edge_shufa_10_5, R.mipmap.edge_shufa_10_6, R.mipmap.edge_shufa_10_7, R.mipmap.edge_shufa_10_show};
    int[] edge_shufa_11 = new int[]{R.mipmap.edge_shufa_11_0, R.mipmap.edge_shufa_11_1, R.mipmap.edge_shufa_11_2, R.mipmap.edge_shufa_11_3, R.mipmap.edge_shufa_11_4, R.mipmap.edge_shufa_11_5, R.mipmap.edge_shufa_11_6, R.mipmap.edge_shufa_11_7, R.mipmap.edge_shufa_11_show};
    int[] edge_shufa_12 = new int[]{R.mipmap.edge_shufa_12_0, R.mipmap.edge_shufa_12_1, R.mipmap.edge_shufa_12_2, R.mipmap.edge_shufa_12_3, R.mipmap.edge_shufa_12_4, R.mipmap.edge_shufa_12_5, R.mipmap.edge_shufa_12_6, R.mipmap.edge_shufa_12_7, R.mipmap.edge_shufa_12_show};
    int[] edge_shufa_13 = new int[]{R.mipmap.edge_shufa_13_0, R.mipmap.edge_shufa_13_1, R.mipmap.edge_shufa_13_2, R.mipmap.edge_shufa_13_3, R.mipmap.edge_shufa_13_4, R.mipmap.edge_shufa_13_5, R.mipmap.edge_shufa_13_6, R.mipmap.edge_shufa_13_7, R.mipmap.edge_shufa_13_show};
    int[] edge_shufa_14 = new int[]{R.mipmap.edge_shufa_14_0, R.mipmap.edge_shufa_14_1, R.mipmap.edge_shufa_14_2, R.mipmap.edge_shufa_14_3, R.mipmap.edge_shufa_14_4, R.mipmap.edge_shufa_14_5, R.mipmap.edge_shufa_14_6, R.mipmap.edge_shufa_14_7, R.mipmap.edge_shufa_14_show};
    int[] edge_shufa_15 = new int[]{R.mipmap.edge_shufa_15_0, R.mipmap.edge_shufa_15_1, R.mipmap.edge_shufa_15_2, R.mipmap.edge_shufa_15_3, R.mipmap.edge_shufa_15_4, R.mipmap.edge_shufa_15_5, R.mipmap.edge_shufa_15_6, R.mipmap.edge_shufa_15_7, R.mipmap.edge_shufa_15_show};
    int[] edge_shufa_16 = new int[]{R.mipmap.edge_shufa_16_0, R.mipmap.edge_shufa_16_1, R.mipmap.edge_shufa_16_2, R.mipmap.edge_shufa_16_3, R.mipmap.edge_shufa_16_4, R.mipmap.edge_shufa_16_5, R.mipmap.edge_shufa_16_6, R.mipmap.edge_shufa_16_7, R.mipmap.edge_shufa_16_show};
    //水彩
    int[] edge_shuicai_1 = new int[]{R.mipmap.edge_shuicai_1_0, R.mipmap.edge_shuicai_1_1, R.mipmap.edge_shuicai_1_2, R.mipmap.edge_shuicai_1_3, R.mipmap.edge_shuicai_1_4, R.mipmap.edge_shuicai_1_5, R.mipmap.edge_shuicai_1_6, R.mipmap.edge_shuicai_1_7, R.mipmap.edge_shuicai_1_show};
    int[] edge_shuicai_2 = new int[]{R.mipmap.edge_shuicai_2_0, R.mipmap.edge_shuicai_2_1, R.mipmap.edge_shuicai_2_2, R.mipmap.edge_shuicai_2_3, R.mipmap.edge_shuicai_2_4, R.mipmap.edge_shuicai_2_5, R.mipmap.edge_shuicai_2_6, R.mipmap.edge_shuicai_2_7, R.mipmap.edge_shuicai_2_show};
    int[] edge_shuicai_3 = new int[]{R.mipmap.edge_shuicai_3_0, R.mipmap.edge_shuicai_3_1, R.mipmap.edge_shuicai_3_2, R.mipmap.edge_shuicai_3_3, R.mipmap.edge_shuicai_3_4, R.mipmap.edge_shuicai_3_5, R.mipmap.edge_shuicai_3_6, R.mipmap.edge_shuicai_3_7, R.mipmap.edge_shuicai_3_show};
    int[] edge_shuicai_4 = new int[]{R.mipmap.edge_shuicai_4_0, R.mipmap.edge_shuicai_4_1, R.mipmap.edge_shuicai_4_2, R.mipmap.edge_shuicai_4_3, R.mipmap.edge_shuicai_4_4, R.mipmap.edge_shuicai_4_5, R.mipmap.edge_shuicai_4_6, R.mipmap.edge_shuicai_4_7, R.mipmap.edge_shuicai_4_show};
    int[] edge_shuicai_5 = new int[]{R.mipmap.edge_shuicai_5_0, R.mipmap.edge_shuicai_5_1, R.mipmap.edge_shuicai_5_2, R.mipmap.edge_shuicai_5_3, R.mipmap.edge_shuicai_5_4, R.mipmap.edge_shuicai_5_5, R.mipmap.edge_shuicai_5_6, R.mipmap.edge_shuicai_5_7, R.mipmap.edge_shuicai_5_show};
    int[] edge_shuicai_6 = new int[]{R.mipmap.edge_shuicai_6_0, R.mipmap.edge_shuicai_6_1, R.mipmap.edge_shuicai_6_2, R.mipmap.edge_shuicai_6_3, R.mipmap.edge_shuicai_6_4, R.mipmap.edge_shuicai_6_5, R.mipmap.edge_shuicai_6_6, R.mipmap.edge_shuicai_6_7, R.mipmap.edge_shuicai_6_show};
    int[] edge_shuicai_7 = new int[]{R.mipmap.edge_shuicai_7_0, R.mipmap.edge_shuicai_7_1, R.mipmap.edge_shuicai_7_2, R.mipmap.edge_shuicai_7_3, R.mipmap.edge_shuicai_7_4, R.mipmap.edge_shuicai_7_5, R.mipmap.edge_shuicai_7_6, R.mipmap.edge_shuicai_7_7, R.mipmap.edge_shuicai_7_show};
    int[] edge_shuicai_8 = new int[]{R.mipmap.edge_shuicai_8_0, R.mipmap.edge_shuicai_8_1, R.mipmap.edge_shuicai_8_2, R.mipmap.edge_shuicai_8_3, R.mipmap.edge_shuicai_8_4, R.mipmap.edge_shuicai_8_5, R.mipmap.edge_shuicai_8_6, R.mipmap.edge_shuicai_8_7, R.mipmap.edge_shuicai_8_show};
    int[] edge_shuicai_9 = new int[]{R.mipmap.edge_shuicai_9_0, R.mipmap.edge_shuicai_9_1, R.mipmap.edge_shuicai_9_2, R.mipmap.edge_shuicai_9_3, R.mipmap.edge_shuicai_9_4, R.mipmap.edge_shuicai_9_5, R.mipmap.edge_shuicai_9_6, R.mipmap.edge_shuicai_9_7, R.mipmap.edge_shuicai_9_show};
    int[] edge_shuicai_10 = new int[]{R.mipmap.edge_shuicai_10_0, R.mipmap.edge_shuicai_10_1, R.mipmap.edge_shuicai_10_2, R.mipmap.edge_shuicai_10_3, R.mipmap.edge_shuicai_10_4, R.mipmap.edge_shuicai_10_5, R.mipmap.edge_shuicai_10_6, R.mipmap.edge_shuicai_10_7, R.mipmap.edge_shuicai_10_show};
    int[] edge_shuicai_11 = new int[]{R.mipmap.edge_shuicai_11_0, R.mipmap.edge_shuicai_11_1, R.mipmap.edge_shuicai_11_2, R.mipmap.edge_shuicai_11_3, R.mipmap.edge_shuicai_11_4, R.mipmap.edge_shuicai_11_5, R.mipmap.edge_shuicai_11_6, R.mipmap.edge_shuicai_11_7, R.mipmap.edge_shuicai_11_show};
    int[] edge_shuicai_12 = new int[]{R.mipmap.edge_shuicai_12_0, R.mipmap.edge_shuicai_12_1, R.mipmap.edge_shuicai_12_2, R.mipmap.edge_shuicai_12_3, R.mipmap.edge_shuicai_12_4, R.mipmap.edge_shuicai_12_5, R.mipmap.edge_shuicai_12_6, R.mipmap.edge_shuicai_12_7, R.mipmap.edge_shuicai_12_show};
    int[] edge_shuicai_13 = new int[]{R.mipmap.edge_shuicai_13_0, R.mipmap.edge_shuicai_13_1, R.mipmap.edge_shuicai_13_2, R.mipmap.edge_shuicai_13_3, R.mipmap.edge_shuicai_13_4, R.mipmap.edge_shuicai_13_5, R.mipmap.edge_shuicai_13_6, R.mipmap.edge_shuicai_13_7, R.mipmap.edge_shuicai_13_show};
    int[] edge_shuicai_14 = new int[]{R.mipmap.edge_shuicai_14_0, R.mipmap.edge_shuicai_14_1, R.mipmap.edge_shuicai_14_2, R.mipmap.edge_shuicai_14_3, R.mipmap.edge_shuicai_14_4, R.mipmap.edge_shuicai_14_5, R.mipmap.edge_shuicai_14_6, R.mipmap.edge_shuicai_14_7, R.mipmap.edge_shuicai_14_show};
    int[] edge_shuicai_15 = new int[]{R.mipmap.edge_shuicai_15_0, R.mipmap.edge_shuicai_15_1, R.mipmap.edge_shuicai_15_2, R.mipmap.edge_shuicai_15_3, R.mipmap.edge_shuicai_15_4, R.mipmap.edge_shuicai_15_5, R.mipmap.edge_shuicai_15_6, R.mipmap.edge_shuicai_15_7, R.mipmap.edge_shuicai_15_show};
    int[] edge_shuicai_16 = new int[]{R.mipmap.edge_shuicai_16_0, R.mipmap.edge_shuicai_16_1, R.mipmap.edge_shuicai_16_2, R.mipmap.edge_shuicai_16_3, R.mipmap.edge_shuicai_16_4, R.mipmap.edge_shuicai_16_5, R.mipmap.edge_shuicai_16_6, R.mipmap.edge_shuicai_16_7, R.mipmap.edge_shuicai_16_show};
    //油画
    int[] edge_youhua_1 = new int[]{R.mipmap.edge_youhua_1_0, R.mipmap.edge_youhua_1_1, R.mipmap.edge_youhua_1_2, R.mipmap.edge_youhua_1_3, R.mipmap.edge_youhua_1_4, R.mipmap.edge_youhua_1_5, R.mipmap.edge_youhua_1_6, R.mipmap.edge_youhua_1_7, R.mipmap.edge_youhua_1_show};
    int[] edge_youhua_2 = new int[]{R.mipmap.edge_youhua_2_0, R.mipmap.edge_youhua_2_1, R.mipmap.edge_youhua_2_2, R.mipmap.edge_youhua_2_3, R.mipmap.edge_youhua_2_4, R.mipmap.edge_youhua_2_5, R.mipmap.edge_youhua_2_6, R.mipmap.edge_youhua_2_7, R.mipmap.edge_youhua_2_show};
    int[] edge_youhua_3 = new int[]{R.mipmap.edge_youhua_3_0, R.mipmap.edge_youhua_3_1, R.mipmap.edge_youhua_3_2, R.mipmap.edge_youhua_3_3, R.mipmap.edge_youhua_3_4, R.mipmap.edge_youhua_3_5, R.mipmap.edge_youhua_3_6, R.mipmap.edge_youhua_3_7, R.mipmap.edge_youhua_3_show};
    int[] edge_youhua_4 = new int[]{R.mipmap.edge_youhua_4_0, R.mipmap.edge_youhua_4_1, R.mipmap.edge_youhua_4_2, R.mipmap.edge_youhua_4_3, R.mipmap.edge_youhua_4_4, R.mipmap.edge_youhua_4_5, R.mipmap.edge_youhua_4_6, R.mipmap.edge_youhua_4_7, R.mipmap.edge_youhua_4_show};
    int[] edge_youhua_5 = new int[]{R.mipmap.edge_youhua_5_0, R.mipmap.edge_youhua_5_1, R.mipmap.edge_youhua_5_2, R.mipmap.edge_youhua_5_3, R.mipmap.edge_youhua_5_4, R.mipmap.edge_youhua_5_5, R.mipmap.edge_youhua_5_6, R.mipmap.edge_youhua_5_7, R.mipmap.edge_youhua_5_show};
    int[] edge_youhua_6 = new int[]{R.mipmap.edge_youhua_6_0, R.mipmap.edge_youhua_6_1, R.mipmap.edge_youhua_6_2, R.mipmap.edge_youhua_6_3, R.mipmap.edge_youhua_6_4, R.mipmap.edge_youhua_6_5, R.mipmap.edge_youhua_6_6, R.mipmap.edge_youhua_6_7, R.mipmap.edge_youhua_6_show};
    int[] edge_youhua_7 = new int[]{R.mipmap.edge_youhua_7_0, R.mipmap.edge_youhua_7_1, R.mipmap.edge_youhua_7_2, R.mipmap.edge_youhua_7_3, R.mipmap.edge_youhua_7_4, R.mipmap.edge_youhua_7_5, R.mipmap.edge_youhua_7_6, R.mipmap.edge_youhua_7_7, R.mipmap.edge_youhua_7_show};
    int[] edge_youhua_8 = new int[]{R.mipmap.edge_youhua_8_0, R.mipmap.edge_youhua_8_1, R.mipmap.edge_youhua_8_2, R.mipmap.edge_youhua_8_3, R.mipmap.edge_youhua_8_4, R.mipmap.edge_youhua_8_5, R.mipmap.edge_youhua_8_6, R.mipmap.edge_youhua_8_7, R.mipmap.edge_youhua_8_show};
    int[] edge_youhua_9 = new int[]{R.mipmap.edge_youhua_9_0, R.mipmap.edge_youhua_9_1, R.mipmap.edge_youhua_9_2, R.mipmap.edge_youhua_9_3, R.mipmap.edge_youhua_9_4, R.mipmap.edge_youhua_9_5, R.mipmap.edge_youhua_9_6, R.mipmap.edge_youhua_9_7, R.mipmap.edge_youhua_9_show};
    int[] edge_youhua_10 = new int[]{R.mipmap.edge_youhua_10_0, R.mipmap.edge_youhua_10_1, R.mipmap.edge_youhua_10_2, R.mipmap.edge_youhua_10_3, R.mipmap.edge_youhua_10_4, R.mipmap.edge_youhua_10_5, R.mipmap.edge_youhua_10_6, R.mipmap.edge_youhua_10_7, R.mipmap.edge_youhua_10_show};
    int[] edge_youhua_11 = new int[]{R.mipmap.edge_youhua_11_0, R.mipmap.edge_youhua_11_1, R.mipmap.edge_youhua_11_2, R.mipmap.edge_youhua_11_3, R.mipmap.edge_youhua_11_4, R.mipmap.edge_youhua_11_5, R.mipmap.edge_youhua_11_66, R.mipmap.edge_youhua_11_7, R.mipmap.edge_youhua_11_show};
    int[] edge_youhua_12 = new int[]{R.mipmap.edge_youhua_12_0, R.mipmap.edge_youhua_12_1, R.mipmap.edge_youhua_12_2, R.mipmap.edge_youhua_12_3, R.mipmap.edge_youhua_12_4, R.mipmap.edge_youhua_12_5, R.mipmap.edge_youhua_12_6, R.mipmap.edge_youhua_12_7, R.mipmap.edge_youhua_12_show};
    int[] edge_youhua_13 = new int[]{R.mipmap.edge_youhua_13_0, R.mipmap.edge_youhua_13_1, R.mipmap.edge_youhua_13_2, R.mipmap.edge_youhua_13_3, R.mipmap.edge_youhua_13_4, R.mipmap.edge_youhua_13_5, R.mipmap.edge_youhua_13_6, R.mipmap.edge_youhua_13_7, R.mipmap.edge_youhua_13_show};
    int[] edge_youhua_14 = new int[]{R.mipmap.edge_youhua_14_0, R.mipmap.edge_youhua_14_1, R.mipmap.edge_youhua_14_2, R.mipmap.edge_youhua_14_3, R.mipmap.edge_youhua_14_4, R.mipmap.edge_youhua_14_5, R.mipmap.edge_youhua_14_6, R.mipmap.edge_youhua_14_7, R.mipmap.edge_youhua_14_show};
    int[] edge_youhua_15 = new int[]{R.mipmap.edge_youhua_15_0, R.mipmap.edge_youhua_15_1, R.mipmap.edge_youhua_15_2, R.mipmap.edge_youhua_15_3, R.mipmap.edge_youhua_15_4, R.mipmap.edge_youhua_15_5, R.mipmap.edge_youhua_15_6, R.mipmap.edge_youhua_15_7, R.mipmap.edge_youhua_15_show};
    int[] edge_youhua_16 = new int[]{R.mipmap.edge_youhua_16_0, R.mipmap.edge_youhua_16_1, R.mipmap.edge_youhua_16_2, R.mipmap.edge_youhua_16_3, R.mipmap.edge_youhua_16_4, R.mipmap.edge_youhua_16_5, R.mipmap.edge_youhua_16_6, R.mipmap.edge_youhua_16_7, R.mipmap.edge_youhua_16_show};
}

---------------------------------------------------------------

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/rl_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".home.activity.AddPictureFrameActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/ll_parent"
        android:layout_marginLeft="@dimen/margin_10"
        android:layout_marginTop="@dimen/margin_14"
        android:layout_marginRight="@dimen/margin_10"
        android:layout_marginBottom="@dimen/margin_14">


        <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </RelativeLayout>


    <LinearLayout
        android:id="@+id/ll_parent"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/white"
        android:orientation="vertical">


        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycle_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/margin_7" />

        <View style="@style/line" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/margin_48">


            <TextView
                android:id="@+id/tv_next_step"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:layout_alignParentRight="true"
                android:textSize="@dimen/text_15"
                android:textColor="@color/white"
                android:background="@color/color_ccab86"
                android:paddingLeft="@dimen/margin_10"
                android:paddingRight="@dimen/margin_10"
                android:text="下一步 >>" />

            <com.androidkun.xtablayout.XTabLayout
                android:id="@+id/xtab_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_toLeftOf="@+id/tv_next_step"
                android:paddingStart="@dimen/margin_5"
                android:paddingEnd="@dimen/margin_5"
                app:xTabMinWidth="@dimen/margin_23"
                app:xTabDividerWidthWidthText="true"
                app:xTabIndicatorColor="@color/color_ccab86"
                app:xTabIndicatorHeight="2dp"
                app:xTabMode="scrollable"
                app:xTabSelectedTextColor="@color/color_ccab86"
                app:xTabSelectedTextSize="16sp"
                app:xTabTextColor="@color/text_666"
                app:xTabTextSize="13sp" />

        </RelativeLayout>
    </LinearLayout>
</RelativeLayout>

 

 

--------------------------------------------------------------------------------

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/margin_63"
    android:id="@+id/ll_picture_border"
    android:layout_height="@dimen/margin_77">

<!--    <LinearLayout-->
<!--        android:layout_width="match_parent"-->
<!--        android:layout_height="match_parent">-->

        <ImageView
            android:id="@+id/iv_edge_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/margin_7"
            android:layout_marginTop="@dimen/margin_13"
            android:layout_marginRight="@dimen/margin_7"
            android:layout_marginBottom="@dimen/margin_13"
            android:background="@color/colorPrimary"
            android:scaleType="centerCrop" />


<!--    </LinearLayout>-->

</LinearLayout>

 

 

-------------------------------------------

 

 

/**
 * 选择文件属性工具类
 */
public class MediaInfo implements Parcelable {

    public String filePath;
    public String thumbnailPath;
    public String mimeType;
    public String title;
    public long startTime;
    public int duration;
    public int id;
    public long addTime;
    public boolean isSquare;
    public int type;
    public int isSelect = -1;//-1未选择  1选择
    public int width = 0;
    public int height = 0;
    public boolean isAddPicture = false; //判断是否增加边框:false:没有  true :有
    public int selectFrameType = -1;//边框类型
    public int selectFrameContent = -1;//边框内容
//    public Bitmap addPictureBitmap;


    public MediaInfo() {
    }

    protected MediaInfo(Parcel in) {
        filePath = in.readString();
        thumbnailPath = in.readString();
        mimeType = in.readString();
        title = in.readString();
        startTime = in.readLong();
        duration = in.readInt();
        id = in.readInt();
        addTime = in.readLong();
        isSquare = in.readByte() != 0;
        type = in.readInt();
        isSelect = in.readInt();
        width = in.readInt();
        height = in.readInt();
//        isAddPicture = in.readByte() != 0;
//        selectFrameType = in.readInt();
//        selectFrameContent = in.readInt();
//        addPictureBitmap = in.readParcelable(Bitmap.class.getClassLoader());
    }

    public static final Creator<MediaInfo> CREATOR = new Creator<MediaInfo>() {
        @Override
        public MediaInfo createFromParcel(Parcel in) {
            return new MediaInfo(in);
        }

        @Override
        public MediaInfo[] newArray(int size) {
            return new MediaInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(filePath);
        parcel.writeString(thumbnailPath);
        parcel.writeString(mimeType);
        parcel.writeString(title);
        parcel.writeLong(startTime);
        parcel.writeInt(duration);
        parcel.writeInt(id);
        parcel.writeLong(addTime);
        parcel.writeByte((byte) (isSquare ? 1 : 0));
        parcel.writeInt(type);
        parcel.writeInt(isSelect);
        parcel.writeInt(width);
        parcel.writeInt(height);
//        parcel.writeByte((byte) (isAddPicture ? 1 : 0));
//        parcel.writeInt(selectFrameType);
//        parcel.writeInt(selectFrameContent);
//        parcel.writeParcelable(addPictureBitmap, i);
    }

}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值