• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DialogSelectionListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.angads25.filepicker.controller.DialogSelectionListener的典型用法代码示例。如果您正苦于以下问题:Java DialogSelectionListener类的具体用法?Java DialogSelectionListener怎么用?Java DialogSelectionListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DialogSelectionListener类属于com.github.angads25.filepicker.controller包,在下文中一共展示了DialogSelectionListener类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setSelectDialog

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
private void setSelectDialog() {
        DialogProperties properties = new DialogProperties();
        properties.selection_mode = DialogConfigs.SINGLE_MODE;
        properties.selection_type = DialogConfigs.FILE_SELECT;
        properties.root = new File(DialogConfigs.DEFAULT_DIR);
        properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
        properties.offset = new File(DialogConfigs.DEFAULT_DIR);
        properties.extensions = null;
        dialog = new FilePickerDialog(MainActivity.this, properties);
        dialog.setTitle("Select a File");
        dialog.setDialogSelectionListener(new DialogSelectionListener() {
            @Override
            public void onSelectedFilePaths(String[] files) {
                //files is the array of the paths of files selected by the Application User.
                videoPath = files[0]; // test
                String suffix = videoPath.substring(videoPath.lastIndexOf("."));
                if(!SUPPORTED_TYPES.contains(suffix)) {
                    Toast.makeText(MainActivity.this, "不支持的格式!", Toast.LENGTH_SHORT).show();
                    return;
                }
                Log.d(TAG, "videoPath" + videoPath);
                videoRenderer.changeVideoPathAndPlay(videoPath);
                pause.setEnabled(true);
//                Log.d(TAG, "clickable" + pause.isClickable());
                pause.setBackgroundResource(R.drawable.pause);
                videoRenderer.pausePlay(PLAY_PAUSE_FLAG);

            }
        });
    }
 
开发者ID:TobiasLee,项目名称:FilterPlayer,代码行数:31,代码来源:MainActivity.java


示例2: load

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
/**
 * Load a configuration. This method displays the file picker. this file picker get the selected file config.
 * This file content is deserialized and given to the callback cbDone
 * @param context
 * @param cbDone
 */
public void load(@NonNull Context context, @NonNull final GollumCallbackGetGeneric<Configuration> cbDone) {
    Logger.d(TAG, "load()");
    DialogProperties dialogProperties = new DialogProperties();
    dialogProperties.selection_type = DialogConfigs.FILE_SELECT;
    dialogProperties.selection_mode = DialogConfigs.SINGLE_MODE;
    dialogProperties.root = Environment.getExternalStorageDirectory();
    dialogProperties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
    dialogProperties.offset = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);
    dialogProperties.extensions = new String[]{"json"};

    FilePickerDialog filePickerDialog = new FilePickerDialog(context, dialogProperties);
    filePickerDialog.setDialogSelectionListener(new DialogSelectionListener() {
        @Override
        public void onSelectedFilePaths(String[] files) {
            if (files.length > 0) {
                Logger.d(TAG, "file selected: " + files[0]);
                Configuration configuration = load(files[0]);
                if (configuration != null) {
                    Logger.d(TAG, "configuration NOT NULL");
                    cbDone.done(configuration, null);
                } else {
                    Logger.d(TAG, "configuration IS NULL");
                    cbDone.done(null, null);
                }
            }
        }
    });
    filePickerDialog.show();
}
 
开发者ID:GRnice,项目名称:PandwarfDefenderProject,代码行数:36,代码来源:FileManager.java


示例3: openFilePickerDialog

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
/**
 * Open a file picker dialog to ease select a new image from external storage.
 */
public void openFilePickerDialog() {
    DialogProperties properties = new DialogProperties();

    properties.selection_mode = DialogConfigs.SINGLE_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    // initial directory should be pictures directory
    properties.offset = new File("/mnt/sdcard" + File.separator + Environment.DIRECTORY_PICTURES);
    // show accepted image format only
    properties.extensions = new String[]{"jpg","jpeg","png","gif","bmp","webp"};

    FilePickerDialog dialog = new FilePickerDialog(getActivity(), properties);
    dialog.setTitle(R.string.dialog_edit_doc_cover_image_select_title);
    dialog.setPositiveBtnName(getString(R.string.dialog_edit_doc_cover_image_select_ok));
    dialog.setNegativeBtnName(getString(android.R.string.cancel));

    dialog.setDialogSelectionListener(new DialogSelectionListener() {
        @Override
        public void onSelectedFilePaths(String[] files) {
            if (files.length > 0) {
                mImagePath = files[0];
                updateImage();
            }
        }
    });

    dialog.show();

    // There is a problem with library dialog theme, it does not support a light
    // primary color because header text color is always white.
    // With this hack (we had to study library layout) it ensures that header background
    // is ok.
    dialog.findViewById(R.id.header).setBackgroundColor(
            ContextCompat.getColor(getActivity(), R.color.colorAccent));
}
 
开发者ID:nfdz,项目名称:foco,代码行数:38,代码来源:EditDocCoverDialog.java


示例4: browseForLibrary

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
private void browseForLibrary() {
    fab.setEnabled(false);
    String rootdir = "/storage/";

    final DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.SINGLE_MODE;
    properties.selection_type = DialogConfigs.DIR_SELECT;
    properties.root = new File(DialogConfigs.DEFAULT_DIR);
    properties.root = new File(rootdir);
    properties.extensions = null;

    final FilePickerDialog dialog = new FilePickerDialog(BookLibrary.this, properties);
    dialog.setDialogSelectionListener(new DialogSelectionListener() {
        @Override
        public void onSelectedFilePaths(String[] files) {
            if (files.length > 0) {
                String[] fileBits = files[0].split("/");
                String libraryName = fileBits[fileBits.length - 1];
                progressBar.setMax(2500);
                progressBar.setProgress(0);
                progressBar.setVisibility(View.VISIBLE);
                progressBarContainer.setVisibility(View.VISIBLE);
                ((BookLibApplication) getApplicationContext()).getLibManager().addLibrary(prgBrHandler, mHandler, libraryName, files[0]);
            }
        }
    });
    dialog.show();
}
 
开发者ID:mrspaceman,项目名称:ebookmgr,代码行数:29,代码来源:BookLibrary.java


示例5: initPicturePanel

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
private void initPicturePanel(final View root) {
    ((ImageView) root.findViewById(R.id.picture_preview)).setImageResource(R.drawable.pause_publish);
    root.findViewById(R.id.picture_preview).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            DialogProperties properties = new DialogProperties();
            properties.selection_mode = DialogConfigs.SINGLE_MODE;
            properties.selection_type = DialogConfigs.FILE_SELECT;
            properties.root = new File(DialogConfigs.STORAGE_DIR);
            properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
            properties.extensions = new String[]{"jpg", "png"};

            FilePickerDialog dialog = new FilePickerDialog(getActivity(), properties);
            dialog.setTitle("Select a File");
            dialog.setDialogSelectionListener(new DialogSelectionListener() {
                @Override
                public void onSelectedFilePaths(String[] files) {
                    ImageView imageView = ((ImageView) getView().findViewById(R.id.picture_preview));
                    if (files != null && files.length > 0){
                        mPictureFilePath = files[0];
                        imageView.setImageBitmap(BitmapFactory.decodeFile(mPictureFilePath));
                    } else {
                        mPictureFilePath = null;
                        imageView.setImageResource(R.drawable.pause_publish);
                    }
                }
            });
            dialog.show();
        }
    });
}
 
开发者ID:pili-engineering,项目名称:PLDroidMediaStreaming,代码行数:32,代码来源:EncodingConfigFragment.java


示例6: promptForFiles

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
/**
 * step 1, users selects files
 */
private void promptForFiles() {
    DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.MULTI_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    properties.root = new File(DialogConfigs.DEFAULT_DIR);
    ;//(Configuration.getInstance().getOsmdroidBasePath());
    properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
    properties.offset = new File(DialogConfigs.DEFAULT_DIR);

    Set<String> registeredExtensions = ArchiveFileFactory.getRegisteredExtensions();
    //api check
    if (Build.VERSION.SDK_INT >= 14)
        registeredExtensions.add("gpkg");
    if (Build.VERSION.SDK_INT >= 10)
        registeredExtensions.add("map");


    String[] ret = new String[registeredExtensions.size()];
    ret = registeredExtensions.toArray(ret);
    properties.extensions = ret;

    FilePickerDialog dialog = new FilePickerDialog(getContext(), properties);
    dialog.setTitle("Select a File");
    dialog.setDialogSelectionListener(new DialogSelectionListener() {
        @Override
        public void onSelectedFilePaths(String[] files) {
            //files is the array of the paths of files selected by the Application User.
            setProviderConfig(files);
        }

    });
    dialog.show();
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:37,代码来源:OfflinePickerSample.java


示例7: setDialogSelectionListener

import com.github.angads25.filepicker.controller.DialogSelectionListener; //导入依赖的package包/类
public void setDialogSelectionListener(DialogSelectionListener callbacks) {
    this.callbacks = callbacks;
}
 
开发者ID:KnIfER,项目名称:wangyi-Lyric-Parser,代码行数:4,代码来源:FilePickerDialog.java



注:本文中的com.github.angads25.filepicker.controller.DialogSelectionListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WordDelimiterFilterFactory类代码示例发布时间:2022-05-22
下一篇:
Java MRBuilderUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap