ImportActivity.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:Minerva 作者:
/**
 * What to do when the button on the importer view is clicked.
 */
@OnClick(R.id.import_button)
void onButtonClick() {
    switch (currBtnState) {
        case START_IMPORT:
            if (!Util.checkForStoragePermAndFireEventIfNeeded(R.id.action_import)) return;
            Importer.get().queueFullImport();
            break;
        case CANCEL_IMPORT:
            Importer.get().cancelImportRun();
            break;
        case CHOOSE_DIR:
            if (!Util.checkForStoragePermAndFireEventIfNeeded(R.id.action_choose_lib_dir)) return;
            // Set up most of dialog.
            FolderChooserDialog.Builder builder = new FolderChooserDialog.Builder(this)
                    .chooseButton(R.string.ok)
                    .cancelButton(R.string.cancel);

            // Check to see if the current value is a valid folder.
            String folderPath = Minerva.prefs().getLibDir(null);
            if (folderPath != null && new File(folderPath).exists()) builder.initialPath(folderPath);

            // Show the folder chooser dialog.
            builder.show();
            break;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号