本文整理了Java中butterknife.OnClick
类的一些代码示例,展示了OnClick
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OnClick
类的具体详情如下:
包路径:butterknife.OnClick
类名称:OnClick
暂无
代码示例来源:origin: android10/Android-CleanArchitecture
@OnClick(R.id.bt_retry)
void onButtonRetryClick() {
UserDetailsFragment.this.loadUserDetails();
}
}
代码示例来源:origin: JakeWharton/butterknife
private static @Nullable Unbinder parseOnClick(final Object target, final Method method,
View source) {
OnClick onClick = method.getAnnotation(OnClick.class);
if (onClick == null) {
return null;
}
validateMember(method);
validateReturnType(method, void.class);
final ArgumentTransformer argumentTransformer =
createArgumentTransformer(method, ON_CLICK_TYPES);
List<View> views =
findViews(source, onClick.value(), isRequired(method), method.getName(), View.class);
ViewCollections.set(views, ON_CLICK,
v -> tryInvoke(method, target, argumentTransformer.transform(v)));
return new ListenerUnbinder<>(views, ON_CLICK);
}
代码示例来源:origin: android10/Android-CleanArchitecture
/**
* Goes to the user list screen.
*/
@OnClick(R.id.btn_LoadData)
void navigateToUserList() {
this.navigator.navigateToUserList(this);
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
@OnClick(R.id.jump_other)
public void onViewClicked() {
startActivity(new Intent(this, EmptyActivity.class));
}
}
代码示例来源:origin: android10/Android-CleanArchitecture
@OnClick(R.id.bt_retry) void onButtonRetryClick() {
UserListFragment.this.loadUserList();
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.example_fa_text_multi_change) void onMultiChangeClicked() {
wikipedia = !wikipedia;
String text = wikipedia ? "{fa_image} is in the {fa_cloud}" : "{fa_bank} are on {fa_globe}";
exampleMultiChange.setMarkdownText(text);
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.example_progress_bar_group_round)
void onRoundClick(){
rounded = !rounded;
groupRound.setRounded(rounded);
}
代码示例来源:origin: kaushikgopal/RxJava-Android-Samples
@OnClick(R.id.btn_clr)
public void OnClearLog() {
_logs = new ArrayList<>();
_adapter.clear();
}
代码示例来源:origin: kaushikgopal/RxJava-Android-Samples
@OnClick(R.id.clr_debounce)
public void onClearLog() {
_logs = new ArrayList<>();
_adapter.clear();
}
代码示例来源:origin: chrisjenx/Calligraphy
@OnClick(R.id.button_bold)
public void onClickBoldButton() {
Toast.makeText(getActivity(), "Custom Typeface toast text", Toast.LENGTH_SHORT).show();
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.example_bootstrap_dropdown) void onBootstrapDropdownExampleClicked() {
startActivity(new Intent(this, BootstrapDropDownExample.class));
}
@OnClick(R.id.example_bootstrap_alert) void onBootstrapAlertExampleClicked() {
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.example_fa_text_change) void onChangeClicked() {
android = !android;
exampleChange.setFontAwesomeIcon(android ? FA_ANDROID : FA_APPLE);
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.lonely_badge)
void onLonelyButtonClicked() {
lonelyBadge.setBadgeText(String.valueOf(new Random().nextInt()));
}
代码示例来源:origin: Bearded-Hen/Android-Bootstrap
@OnClick(R.id.java_badge_button)
void onJavaButtonClicked() {
javaBadgeButton.setBadgeText(String.valueOf(new Random().nextInt()));
}
代码示例来源:origin: chrisjenx/Calligraphy
@OnClick(R.id.button_default)
public void onClickDefaultButton() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage("Custom Typeface Dialog");
builder.setTitle("Sample Dialog");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
}
代码示例来源:origin: kaushikgopal/RxJava-Android-Samples
@OnClick(R.id.btn_start_operation)
void startRequest() {
startVolleyRequest();
}
代码示例来源:origin: frogermcs/InstaMaterial
@OnClick(R.id.btnReport)
public void onReportClick() {
if (onItemClickListener != null) {
onItemClickListener.onReportClick(feedItem);
}
}
代码示例来源:origin: frogermcs/InstaMaterial
@OnClick(R.id.btnSharePhoto)
public void onSharePhotoClick() {
if (onItemClickListener != null) {
onItemClickListener.onSharePhotoClick(feedItem);
}
}
代码示例来源:origin: frogermcs/InstaMaterial
@OnClick(R.id.btnCopyShareUrl)
public void onCopyShareUrlClick() {
if (onItemClickListener != null) {
onItemClickListener.onCopyShareUrlClick(feedItem);
}
}
代码示例来源:origin: prolificinteractive/material-calendarview
@OnClick(R.id.get_selected_dates) public void getSelectedDateClick(final View v) {
final List<CalendarDay> selectedDates = widget.getSelectedDates();
if (!selectedDates.isEmpty()) {
Toast.makeText(this, selectedDates.toString(), Toast.LENGTH_SHORT).show();
Log.e("GettersActivity", selectedDates.toString());
} else {
Toast.makeText(this, "No Selection", Toast.LENGTH_SHORT).show();
}
}
内容来源于网络,如有侵权,请联系作者删除!