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);
}
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;
}
}
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;
}
}
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);
}
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");
}
});
}
Aggregations