當前位置: 首頁>>代碼示例>>Java>>正文


Java Click類代碼示例

本文整理匯總了Java中org.androidannotations.annotations.Click的典型用法代碼示例。如果您正苦於以下問題:Java Click類的具體用法?Java Click怎麽用?Java Click使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Click類屬於org.androidannotations.annotations包,在下文中一共展示了Click類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createOBJ

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click({R.id.btn_create_obj})
protected void createOBJ() {
    if (mCurrentImgPath == null) {
        Toast.makeText(BuildMaskActivity.this, "沒有找到人臉圖片", Toast.LENGTH_SHORT).show();
        return;
    }

    String objDir = OBJUtils.getModelDir();
    String objName = FileUtils.getMD5(mCurrentImgPath);
    String objPath = objDir + objName + "_obj";
    File file = new File(objPath);
    if (!file.exists()) {
        OBJUtils.createObjFile(BuildMaskActivity.this, mCurrentImgPath);
        Toast.makeText(BuildMaskActivity.this, "Done!", Toast.LENGTH_SHORT).show();
    } else {
        DialogUtils.showDialog(this, "該人臉OBJ文件已存在", "是否重新生成?", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                OBJUtils.createObjFile(BuildMaskActivity.this, mCurrentImgPath);
            }
        });
    }
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:24,代碼來源:BuildMaskActivity.java

示例2: showDonateMeDialog

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.donate)
void showDonateMeDialog() {
    new ThemeColorMaterialDialogBuilder(this)
            .title(R.string.text_donate)
            .items("支付寶")
            .itemsCallback(new MaterialDialog.ListCallback() {
                @Override
                public void onSelection(MaterialDialog dialog, View itemView, int position, CharSequence text) {
                    if (position == 0) {
                        if (AlipayZeroSdk.hasInstalledAlipayClient(AboutActivity.this)) {
                            AlipayZeroSdk.startAlipayClient(AboutActivity.this, "aex04370fwjf8angrv1te9e");
                        } else {
                            Toast.makeText(AboutActivity.this, "未安裝支付寶", Toast.LENGTH_SHORT).show();
                        }
                    }
                }
            })
            .show();
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:20,代碼來源:AboutActivity.java

示例3: showDonateMeDialog

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.donate)
void showDonateMeDialog() {
    new ThemeColorMaterialDialogBuilder(this)
            .title(R.string.donate)
            .items("支付寶")
            .itemsCallback(new MaterialDialog.ListCallback() {
                @Override
                public void onSelection(MaterialDialog dialog, View itemView, int position, CharSequence text) {
                    if (position == 0) {
                        if (AlipayZeroSdk.hasInstalledAlipayClient(AboutActivity.this)) {
                            AlipayZeroSdk.startAlipayClient(AboutActivity.this, "aex04370fwjf8angrv1te9e");
                        } else {
                            Toast.makeText(AboutActivity.this, "未安裝支付寶", Toast.LENGTH_SHORT).show();
                        }
                    }
                }
            })
            .show();
}
 
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:20,代碼來源:AboutActivity.java

示例4: login

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.login_btn)
void login() {
    if (!checkIsOK()) {
        return;
    }
    UserService.getInstance()
            .login(accountTextInputLayout.getEditText().getText().toString(),
                    passwordTextInputLayout.getEditText().getText().toString())
                .doOnError(error -> {
                    String message = error.getMessage();
                    if (message == null)
                        message = getString(R.string.login_fail);
                    Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();

                })
                .subscribe(tokenCommonResponse -> {
                    Toast.makeText(getApplicationContext(), R.string.login_success, Toast.LENGTH_SHORT).show();
                    finish();
                });

}
 
開發者ID:hyb1996,項目名稱:NodeET,代碼行數:22,代碼來源:LoginActivity.java

示例5: checkUpdate

import org.androidannotations.annotations.Click; //導入依賴的package包/類
/**
 * 檢查更新
 */
@Click(R.id.rl_checkUpdate)
void checkUpdate() {
    UmengUpdateAgent.forceUpdate(getActivity());
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            switch (updateStatus) {
                case UpdateStatus.Yes: // has update
                    UmengUpdateAgent.showUpdateDialog(getActivity(), updateInfo);
                    break;
                case UpdateStatus.No: // has no update
                    ToastUtil.showToast(getActivity(), "當前已是最新版本");
                    break;
                case UpdateStatus.NoneWifi: // none wifi
                    // 注意:我已經在MainActivity中設置,更新時忽略隻在WIFE下更新,所以這個狀態暫時沒用
                    ToastUtil.showToast(getActivity(), "沒有wifi連接,隻在wifi下更新");
                    break;
                case UpdateStatus.Timeout: // time out
                    ToastUtil.showToast(getActivity(), "請求超時,請檢查網絡");
                    break;
            }
        }
    });

}
 
開發者ID:jpaijh,項目名稱:TYT,代碼行數:29,代碼來源:MineFragment.java

示例6: prePayment

import org.androidannotations.annotations.Click; //導入依賴的package包/類
/**
 * 提款
 */
@Click(R.id.btn_payment)
void prePayment() {
    String payee = tv_payee.getText().toString();
    String receive_bank = tv_receive_bank.getText().toString().trim();
    String bankAccount = tv_bankAccount.getText().toString().trim();
    String pay_amount = tv_pay_amount.getText().toString().trim();

    if (TextUtils.isEmpty(payee)) {
        ToastUtil.showToast(this, "請輸入收款單位");
    } else if (TextUtils.isEmpty(receive_bank)) {
        ToastUtil.showToast(this, "請輸入收款銀行");
    } else if (TextUtils.isEmpty(bankAccount)) {
        ToastUtil.showToast(this, "請輸入銀行賬號");
    } else if (TextUtils.isEmpty(pay_amount)) {
        ToastUtil.showToast(this, "請輸入支付金額");
    } else if (Double.valueOf(pay_amount) > generalAccount) {
        ToastUtil.showToast(this, "支付金額超過普通賬戶餘額");
    } else {
        pDialog = new SweetAlertDialog(T_PaymentActivity.this, SweetAlertDialog.PROGRESS_TYPE).setTitleText("正在提款...");
        pDialog.setCancelable(false);
        pDialog.show();
        payment(payee, receive_bank, bankAccount, pay_amount);
    }

}
 
開發者ID:jpaijh,項目名稱:TYT,代碼行數:29,代碼來源:T_PaymentActivity.java

示例7: OnFloatButtonClick

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.floatingMenuButton)
void OnFloatButtonClick() {
    final AlertDialog.Builder builder2 = new AlertDialog.Builder(this.getContext());
    builder2.setTitle("Main menu")
            .setItems(new String[] {"Paste", "Disconnect"}, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    switch (which) {
                        case 0:
                            moveCopyRemote();
                            break;
                        case 1:
                            actionListener.OnWaitStart();
                            ssh.setConnectDisabled(true);
                            break;
                    }
                    dialog.dismiss();
                }
            });
    builder2.create().show();
}
 
開發者ID:konachan700,項目名稱:SSHFileManager,代碼行數:21,代碼來源:FileManagerFragment.java

示例8: clickNotice

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.btn_notice)
void clickNotice() {
    String receiptDate = tv_receiptDate.getText().toString().trim();
    String foreignName = tv_foreignName.getText().toString().trim();

    if (TextUtils.isEmpty(receiptDate)) {
        ToastUtil.showToast(this, "請選擇付匯日期");
    } else if (TextUtils.isEmpty(receiptTypeValue)) {
        ToastUtil.showToast(this, "請選擇付匯類型");
    } else if (TextUtils.isEmpty(foreignName)) {
        ToastUtil.showToast(this, "請選擇外商");
    } else {
        String saleOrder = tv_saleOrder.getText().toString().trim();
        String receiptBank = et_receiptBank.getText().toString().trim();
        String currency = tv_currency.getText().toString().trim();
        String amount = et_amount.getText().toString().trim();
        String customerRemark = et_customerRemark.getText().toString().trim();

        pDialog = new SweetAlertDialog(T_NewNoticeForeignExchangeActivity.this, SweetAlertDialog.PROGRESS_TYPE).setTitleText("正在創建水單通知...");
        pDialog.setCancelable(false);
        pDialog.show();
        notice(receiptDate, foreignName, receiptTypeValue, saleOrder, receiptBank, currency, amount, customerRemark);
    }

}
 
開發者ID:jpaijh,項目名稱:TYT,代碼行數:26,代碼來源:T_NewNoticeForeignExchangeActivity.java

示例9: clickRec

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.fabRec)
void clickRec() {
    if(!isInitRecorder) {
        isInitRecorder = true;
        mAudioFile = new File(
                Environment.getExternalStorageDirectory().getAbsolutePath() +
                        File.separator + "lecrec" + File.separator + System.nanoTime() + ".file.m4a");
        mAudioRecorder.prepareRecord(MediaRecorder.AudioSource.MIC,
                MediaRecorder.OutputFormat.MPEG_4, MediaRecorder.AudioEncoder.AAC,
                mAudioFile);
    }

    if(!isRecording) {
        isRecording = true;
        startTimer();
        mAudioRecorder.startRecord();
        fabRec.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary)));
        fabRec.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_stop_white_24dp));
    } else {
        isRecording = false;
        stopTimer();
        fabRec.setVisibility(View.INVISIBLE);
        mAudioRecorder.stopRecord();
        convertToWav();
    }
}
 
開發者ID:lecrec,項目名稱:lecrec-android,代碼行數:27,代碼來源:ActivityRecordVoice.java

示例10: login

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.register)
void login() {
    String email = mEmail.getText().toString();
    String userName = mUserName.getText().toString();
    String password = mPassword.getText().toString();
    if (!validateInput(email, userName, password)) {
        return;
    }
    MaterialDialog dialog = new MaterialDialog.Builder(this)
            .progress(true, 0)
            .content(R.string.text_registering)
            .cancelable(false)
            .show();
    UserService.getInstance().register(email, userName, password)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(response -> {
                        dialog.dismiss();
                        onRegisterResponse(response.string());
                    }
                    , error -> {
                        dialog.dismiss();
                        mPassword.setError(NodeBB.getErrorMessage(error, RegisterActivity.this, R.string.text_register_fail));
                    });

}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:27,代碼來源:RegisterActivity.java

示例11: login

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.login)
void login() {
    String userName = mUserName.getText().toString();
    String password = mPassword.getText().toString();
    if (!checkNotEmpty(userName, password)) {
        return;
    }
    MaterialDialog dialog = new MaterialDialog.Builder(this)
            .progress(true, 0)
            .content(R.string.text_logining)
            .cancelable(false)
            .show();
    UserService.getInstance().login(userName, password)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(response -> {
                        dialog.dismiss();
                        Toast.makeText(getApplicationContext(), R.string.text_login_succeed, Toast.LENGTH_SHORT).show();
                        finish();
                    }
                    , error -> {
                        dialog.dismiss();
                        mPassword.setError(NodeBB.getErrorMessage(error, LoginActivity.this, R.string.text_login_fail));
                    });

}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:27,代碼來源:LoginActivity.java

示例12: lol

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.icon)
void lol() {
    mLolClickCount++;
    Toast.makeText(this, R.string.text_lll, Toast.LENGTH_LONG).show();
    if (mLolClickCount >= 5) {
        crashTest();
    }
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:9,代碼來源:AboutActivity.java

示例13: stopAllRunningScripts

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.stop_all_running_scripts)
void stopAllRunningScripts() {
    int n = AutoJs.getInstance().getScriptEngineService().stopAll();
    if (n > 0)
        Snackbar.make(getView(), String.format(getString(R.string.text_already_stop_n_scripts), n), Snackbar.LENGTH_SHORT).show();
    else
        Snackbar.make(getView(), R.string.text_no_running_script, Snackbar.LENGTH_SHORT).show();
}
 
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:9,代碼來源:SideMenuFragment.java

示例14: exitCompletely

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click(R.id.exit)
public void exitCompletely() {
    HoverMenuManger.hideHoverMenu();
    stopService(new Intent(this, FloatyService.class));
    AutoJs.getInstance().getScriptEngineService().stopAll();
    finish();
}
 
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:8,代碼來源:MainActivity.java

示例15: launchGallery

import org.androidannotations.annotations.Click; //導入依賴的package包/類
@Click({R.id.btn_load_face})
protected void launchGallery() {
    Toast.makeText(BuildMaskActivity.this, "選擇一張人臉圖片", Toast.LENGTH_SHORT).show();
    Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(galleryIntent, RESULT_LOAD_IMG);
}
 
開發者ID:SimonCherryGZ,項目名稱:face-landmark-android,代碼行數:7,代碼來源:BuildMaskActivity.java


注:本文中的org.androidannotations.annotations.Click類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。