当前位置: 首页>>代码示例>>Java>>正文


Java OptionsItem类代码示例

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


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

示例1: pickFile

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem(R.id.pickFile)
void pickFile() {
    int permissionCheck = ContextCompat.checkSelfPermission(this,
            READ_EXTERNAL_STORAGE);

    if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(
                this,
                new String[]{READ_EXTERNAL_STORAGE},
                PERMISSION_CODE
        );

        return;
    }

    launchPicker();
}
 
开发者ID:barteksc,项目名称:AndroidPdfViewerV2,代码行数:18,代码来源:PDFViewActivity.java

示例2: action_save

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_save() {
    String url = Global.HOST_API + mProjectPath + "/git/edit/" + mVersion + UrlCreate.pathEncode2(file.path);
    RequestParams params = new RequestParams();
    params.put("content", editFragment.getInput());
    mGitAll.getGitFileObject().data = editFragment.getInput();
    params.put("message", "update " +  mGitFileInfoObject.name);
    params.put("lastCommitSha", mGitAll.getCommitId());
    MyAsyncHttpClient.post(this, url, params, new MyJsonResponse(EditCodeActivity.this) {
        @Override
        public void onMySuccess(JSONObject response) {
            super.onMySuccess(response);
            closeAndSave();
        }

        @Override
        public void onFinish() {
            super.onFinish();
            showProgressBar(false);
        }
    });
    showProgressBar(true);
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:24,代码来源:EditCodeActivity.java

示例3: action_download

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
protected final void action_download() {
    //showButtomToast("savePic");
    if (mFile != null && mFile.exists() && mFile.isFile()) {
        showButtomToast("文件已经下载");
        return;
    } else if (isDownloading) {
        showButtomToast("文件正在下载");
        return;
    }
    urlDownload = String.format(urlDownloadBase, mProjectObjectId, mAttachmentFileObject.file_id);
    if (mFileSaveHelp.needShowHint()) {
        String msgFormat = "您的文件将下载到以下路径:\n%s\n您也可以去设置界面设置您的下载路径";

        new AlertDialog.Builder(this)
                .setTitle("提示")
                .setMessage(String.format(msgFormat, mFileSaveHelp.getDefaultPath()))
                .setPositiveButton("确定", (dialog, which) -> download(urlDownload))
                .show();

        mFileSaveHelp.alwaysHideHint();
    } else {
        download(urlDownload);
    }
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:26,代码来源:AttachmentsDetailBaseActivity.java

示例4: action_open_by_other

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
    protected final void action_open_by_other() {
        if (mFile != null && mFile.exists()) {
//            try {
//                Intent mResultIntent = new Intent(Intent.ACTION_VIEW);
//                Uri fileUri = Uri.fromFile(mFile);
//                type = getContentResolver().getType(fileUri);
//                mResultIntent.setDataAndType(fileUri,
//                        type);
//                startActivity(mResultIntent);
//            } catch (Exception e) {
//                Global.errorLog(e);
//                showMiddleToast("没有能打开此文件的程序");
//            }
            AttachmentsDownloadDetailActivity.openFile(this, mFile);
        } else {
            showMiddleToast("文件未下载");
        }
    }
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:20,代码来源:AttachmentsDetailBaseActivity.java

示例5: close

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem(android.R.id.home)
void close() {
    if (mAttachmentFolderObject != null) {
        if (mAttachmentFolderObject.parent != null) {
            mAttachmentFolderObject = mAttachmentFolderObject.parent;
            mData.clear();
            mData.addAll(mAttachmentFolderObject.sub_folders);
            adapter.notifyDataSetChanged();
            //isTopFolder = false;
            getSupportActionBar().setTitle(mAttachmentFolderObject.name);
        } else {
            mAttachmentFolderObject = null;
            mData.clear();
            mData.addAll(mDefaultData);
            adapter.notifyDataSetChanged();
            getSupportActionBar().setTitle(R.string.title_activity_attachment_folder_selector);
            ///isTopFolder = true;
        }

        setBottomBtn();
    } else {
        onBackPressed();
    }
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:25,代码来源:AttachmentsFolderSelectorActivity.java

示例6: action_share

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
protected final void action_share() {
    String urlString = webView.getUrl();
    if (urlString == null) {
        Toast.makeText(WebActivity.this, "获取链接失败", Toast.LENGTH_SHORT).show();
        return;
    }

    String title = actionbarTitle.getText().toString();
    if (title.isEmpty()) {
        Toast.makeText(WebActivity.this, "获取标题失败", Toast.LENGTH_SHORT).show();
        return;
    }

    action_share_third();
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:17,代码来源:WebActivity.java

示例7: action_ok

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_ok() {
    final String customName = nameText.getText().toString().trim();
    if (TextUtils.isEmpty(customName)) {
        Toast.makeText(this, "请输入位置名称", Toast.LENGTH_SHORT).show();
        nameText.requestFocus();
        return;
    }
    final String areaAddress = addressText.getText().toString().trim();
    final String customAddress = TextUtils.isEmpty(areaAddress) ? areaText.getText().toString().trim() : areaAddress;
    BaiduLbsLoader.store(getApplicationContext(), customName, customAddress, latitude, longitude, new BaiduLbsLoader.StorePoiListener() {
        @Override
        public void onStoreResult(boolean success, String id) {
            if (!success) {
                Toast.makeText(LocationEditActivity.this, "保存失败,请重试", Toast.LENGTH_SHORT).show();
            } else {
                final LocationObject data = LocationObject.newCustom(id, customName, customAddress, latitude, longitude);
                data.city = city;
                Intent intent = new Intent();
                intent.putExtra("location", data);
                setResult(RESULT_OK, intent);
                finish();
            }
        }
    });
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:27,代码来源:LocationEditActivity.java

示例8: clickBack

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem(android.R.id.home)
final protected void clickBack() {
    if (mCurrentFragment instanceof BaseProjectHomeFragment) {
        if (((BaseProjectHomeFragment) mCurrentFragment).isBackToRefresh()) {
            InitProUtils.backIntentToMain(this);
            return;
        }
    }

    finish();
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:12,代码来源:ProjectHomeActivity.java

示例9: action_preview

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_preview() {
    file.data = editFragment.getInput();
    previewFragment.loadData();
    switchFragment(previewFragment, editFragment);

    previewMenu.setVisible(false);
    editMenu.setVisible(true);
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:10,代码来源:EditCodeActivity.java

示例10: action_edit

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_edit() {
    switchFragment(editFragment, previewFragment);

    previewMenu.setVisible(true);
    editMenu.setVisible(false);
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:8,代码来源:EditCodeActivity.java

示例11: tips

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem(R.id.action_info)
protected final void tips() {
    if (maskInfo.getVisibility() == View.GONE) {
        maskInfo.getBackground().setAlpha(200);
        maskInfo.setVisibility(View.VISIBLE);
    } else {
        maskInfo.setVisibility(View.GONE);
    }
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:10,代码来源:ProjectTypeActivity.java

示例12: action_filter

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_filter() {
    if (pageIndex != program_title.length) {
        pager.setCurrentItem(program_title.length, false);
    } else {
        pager.setCurrentItem(program_title.length - pageIndex, false);
    }

}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:10,代码来源:ProjectFragment.java

示例13: action_history

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
    protected final void action_history() {
        String peek = pathStack.peek();
        if (peek.isEmpty() && mVersion.isEmpty()) {
            showButtomToast("没有Commit记录");
            return;
        }

        String commitUrl = UrlCreate.gitTreeCommit(mProjectPath, mVersion, peek);
        BranchCommitListActivity_.intent(this).mCommitsUrl(commitUrl).start();
//        RedPointTip.markUsed(getActivity(), RedPointTip.Type.CodeHistory);
    }
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:13,代码来源:ProjectGitFragment.java

示例14: action_save

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_save() {
    if (id != 0) {
        beginSaveTopicLabels();
    } else {
        saveTopicLabels = true;
        finish();
    }
}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:10,代码来源:TopicLabelActivity.java

示例15: action_save

import org.androidannotations.annotations.OptionsItem; //导入依赖的package包/类
@OptionsItem
void action_save() {
    String newName = editText.getText().toString();
    if (TextUtils.isEmpty(newName)) {
        showButtomToast("名字不能为空");
        return;
    }

    labelObject.name = newName;

    String url = Global.HOST_API + projectPath + "/topics/label/" + labelObject.id;
    RequestParams params = new RequestParams();
    params.put("name", labelObject.name);
    String colorStringr = String.format("#%06X", labelObject.getColor() & 0x00FFFFFF);
    params.put("color", colorStringr);
    MyAsyncHttpClient.put(this, url, params, new MyJsonResponse(this) {
        @Override
        public void onMySuccess(JSONObject response) {
            super.onMySuccess(response);

            Intent intent = new Intent();
            intent.putExtra("resultData", labelObject);
            setResult(RESULT_OK, intent);

            finish();
        }

        @Override
        public void onFinish() {
            super.onFinish();
            showProgressBar(false);
        }
    });

    showProgressBar(true);

}
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:38,代码来源:ModifyLabelActivity.java


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