Search in sources :

Example 61 with OnClick

use of butterknife.OnClick in project Telecine by JakeWharton.

the class OverlayView method onStartClicked.

@OnClick(R.id.record_overlay_start)
void onStartClicked() {
    recordingView.setVisibility(VISIBLE);
    int centerX = (int) (startView.getX() + (startView.getWidth() / 2));
    int centerY = (int) (startView.getY() + (startView.getHeight() / 2));
    Animator reveal = createCircularReveal(recordingView, centerX, centerY, 0, getWidth() / 2f);
    reveal.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            buttonsView.setVisibility(GONE);
        }
    });
    reveal.start();
    postDelayed(new Runnable() {

        @Override
        public void run() {
            if (showCountDown) {
                showCountDown();
            } else {
                countdownComplete();
            }
        }
    }, showCountDown ? COUNTDOWN_DELAY : NON_COUNTDOWN_DELAY);
}
Also used : Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) SuppressLint(android.annotation.SuppressLint) OnClick(butterknife.OnClick)

Example 62 with OnClick

use of butterknife.OnClick in project OkHttp3 by MrZhousf.

the class UploadFileActivity method onClick.

@OnClick({ R.id.chooseFileBtn, R.id.uploadFileBtn })
public void onClick(View view) {
    switch(view.getId()) {
        case R.id.chooseFileBtn:
            Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
            //文件
            intent.setType("*/*");
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            startActivityForResult(intent, 1);
            break;
        case R.id.uploadFileBtn:
            uploadFile(filePath);
            //                doUploadBatch();
            break;
    }
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 63 with OnClick

use of butterknife.OnClick in project OkHttp3 by MrZhousf.

the class UploadImageActivity method onClick.

@OnClick({ R.id.uploadImgBtnOne, R.id.chooseImgBtnOne, R.id.uploadImgBtnTwo, R.id.chooseImgBtnTwo, R.id.uploadImgBtnMulti })
public void onClick(View view) {
    switch(view.getId()) {
        case R.id.chooseImgBtnOne:
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(intent, 1);
            break;
        case R.id.chooseImgBtnTwo:
            Intent intentTwo = new Intent();
            intentTwo.setType("image/*");
            intentTwo.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(intentTwo, 2);
            break;
        case R.id.uploadImgBtnOne:
            if (!TextUtils.isEmpty(filePathOne)) {
                uploadImgOne();
            } else {
                Toast.makeText(this, "请先选择上传的图片!", Toast.LENGTH_LONG).show();
            }
            break;
        case R.id.uploadImgBtnTwo:
            if (!TextUtils.isEmpty(filePathTwo)) {
                uploadImgTwo();
            } else {
                Toast.makeText(this, "请先选择上传的图片!", Toast.LENGTH_LONG).show();
            }
            break;
        case R.id.uploadImgBtnMulti:
            if (!TextUtils.isEmpty(filePathOne) && !TextUtils.isEmpty(filePathTwo)) {
                uploadImgMulti();
            } else {
                Toast.makeText(this, "请先选择两张图片!", Toast.LENGTH_LONG).show();
            }
            break;
    }
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 64 with OnClick

use of butterknife.OnClick in project PhotoNoter by yydcdut.

the class AlbumFragment method clickFabLocal.

@OnClick(R.id.fab_local)
public void clickFabLocal(View v) {
    //        Intent intent = new Intent();
    //        intent.setType("image/*");
    //        intent.setAction(Intent.ACTION_GET_CONTENT);
    //        startActivityForResult(intent, INTENT_REQUEST_LOCAL);
    Intent intent = new Intent(getActivity(), GalleryActivity.class);
    startActivityForResult(intent, REQUEST_DATA_IMAGE);
    //过1s自动关闭
    mMainHandler.postDelayed(() -> {
        mFloatingActionsMenu.collapse(false);
        hideAlbumRevealColorView(getLocationInView(mAlbumRevealView, mFloatingView));
    }, 1000);
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 65 with OnClick

use of butterknife.OnClick in project jianshi by wingjay.

the class ViewActivity method share.

@OnClick(R.id.view_share)
void share() {
    Blaster.log(LoggingData.BTN_CLK_SHARE_DIARY_IMAGE);
    final View target = verticalStyle ? container : normalContainer;
    final ProgressDialog dialog = ProgressDialog.show(this, "", "加载中...");
    screenshotManager.shotScreen(target, "temp.jpg").observeOn(Schedulers.io()).filter(new Func1<String, Boolean>() {

        @Override
        public Boolean call(String s) {
            return !TextUtils.isEmpty(s);
        }
    }).flatMap(new Func1<String, Observable<Pair<String, ShareContent>>>() {

        @Override
        public Observable<Pair<String, ShareContent>> call(String path) {
            Timber.i("ViewActivity ScreenshotManager 1 %s", Thread.currentThread().getName());
            ShareContent shareContent = new ShareContent();
            try {
                JsonDataResponse<ShareContent> response = userService.getShareContent().toBlocking().first();
                if (response.getRc() == Constants.ServerResultCode.RESULT_OK && response.getData() != null) {
                    shareContent = response.getData();
                }
            } catch (Exception e) {
                Timber.e(e, "getShareContent() error");
                return Observable.just(Pair.create(path, shareContent));
            }
            return Observable.just(Pair.create(path, shareContent));
        }
    }).observeOn(AndroidSchedulers.mainThread()).doOnTerminate(new Action0() {

        @Override
        public void call() {
            dialog.dismiss();
        }
    }).subscribe(new Action1<Pair<String, ShareContent>>() {

        @Override
        public void call(Pair<String, ShareContent> stringShareContentPair) {
            Timber.i("ViewActivity ScreenshotManager 2 %s", Thread.currentThread().getName());
            if (!isUISafe()) {
                return;
            }
            IntentUtil.shareLinkWithImage(ViewActivity.this, stringShareContentPair.second, Uri.fromFile(new File(stringShareContentPair.first)));
        }
    }, new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
            makeToast(getString(R.string.share_failure));
            Timber.e(throwable, "screenshot share failure");
        }
    });
}
Also used : Action0(rx.functions.Action0) ProgressDialog(android.app.ProgressDialog) InjectView(butterknife.InjectView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextPointView(com.wingjay.jianshi.ui.widget.TextPointView) MultipleRowTextView(com.wingjay.jianshi.ui.widget.MultipleRowTextView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) ShareContent(com.wingjay.jianshi.bean.ShareContent) Func1(rx.functions.Func1) File(java.io.File) Pair(android.util.Pair) OnClick(butterknife.OnClick)

Aggregations

OnClick (butterknife.OnClick)202 Intent (android.content.Intent)88 AlertDialog (android.support.v7.app.AlertDialog)11 View (android.view.View)11 DialogInterface (android.content.DialogInterface)10 Action0 (rx.functions.Action0)10 Bundle (android.os.Bundle)8 GCM (com.kickstarter.models.pushdata.GCM)8 PushNotificationEnvelope (com.kickstarter.services.apiresponses.PushNotificationEnvelope)8 File (java.io.File)8 TextView (android.widget.TextView)7 ActivityOptions (android.app.ActivityOptions)6 LzyResponse (com.lzy.demo.model.LzyResponse)6 ServerModel (com.lzy.demo.model.ServerModel)6 Subscription (rx.Subscription)6 NonNull (android.support.annotation.NonNull)5 ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)5 CustomBubblePopup (com.flyco.dialogsamples.extra.CustomBubblePopup)5 Activity (com.kickstarter.models.pushdata.Activity)5 ArrayList (java.util.ArrayList)5