Search in sources :

Example 1 with FolderPopUpWindow

use of com.lzy.imagepicker.view.FolderPopUpWindow in project ImagePicker by jeasonlzy.

the class ImageGridActivity method createPopupFolderList.

/** 创建弹出的ListView */
private void createPopupFolderList() {
    mFolderPopupWindow = new FolderPopUpWindow(this, mImageFolderAdapter);
    mFolderPopupWindow.setOnItemClickListener(new FolderPopUpWindow.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
            mImageFolderAdapter.setSelectIndex(position);
            imagePicker.setCurrentImageFolderPosition(position);
            mFolderPopupWindow.dismiss();
            ImageFolder imageFolder = (ImageFolder) adapterView.getAdapter().getItem(position);
            if (null != imageFolder) {
                mImageGridAdapter.refreshData(imageFolder.images);
                mBtnDir.setText(imageFolder.name);
            }
            //滑动到顶部
            mGridView.smoothScrollToPosition(0);
        }
    });
    mFolderPopupWindow.setMargin(mFooterBar.getHeight());
}
Also used : ImageFolder(com.lzy.imagepicker.bean.ImageFolder) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint) FolderPopUpWindow(com.lzy.imagepicker.view.FolderPopUpWindow)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 GridView (android.widget.GridView)1 ImageFolder (com.lzy.imagepicker.bean.ImageFolder)1 FolderPopUpWindow (com.lzy.imagepicker.view.FolderPopUpWindow)1