use of butterknife.OnClick in project lottie-android by airbnb.
the class AnimationFragment method onLoadUrlClicked.
@OnClick(R.id.load_url)
void onLoadUrlClicked() {
animationView.cancelAnimation();
final EditText urlView = new EditText(getContext());
new AlertDialog.Builder(getContext()).setTitle("Enter a URL").setView(urlView).setPositiveButton("Load", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
loadUrl(urlView.getText().toString());
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).show();
}
use of butterknife.OnClick in project lottie-android by airbnb.
the class AnimationFragment method onLoadFileClicked.
@OnClick(R.id.load_file)
void onLoadFileClicked() {
animationView.cancelAnimation();
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
try {
startActivityForResult(Intent.createChooser(intent, "Select a JSON file"), RC_FILE);
} catch (android.content.ActivityNotFoundException ex) {
// Potentially direct the user to the Market with a Dialog
Toast.makeText(getContext(), "Please install a File Manager.", Toast.LENGTH_SHORT).show();
}
}
use of butterknife.OnClick in project plaid by nickbutcher.
the class HomeActivity method fabClick.
@OnClick(R.id.fab)
protected void fabClick() {
if (designerNewsPrefs.isLoggedIn()) {
Intent intent = new Intent(this, PostNewDesignerNewsStory.class);
FabTransform.addExtras(intent, ContextCompat.getColor(this, R.color.accent), R.drawable.ic_add_dark);
intent.putExtra(PostStoryService.EXTRA_BROADCAST_RESULT, true);
registerPostStoryResultListener();
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, fab, getString(R.string.transition_new_designer_news_post));
startActivityForResult(intent, RC_NEW_DESIGNER_NEWS_STORY, options.toBundle());
} else {
Intent intent = new Intent(this, DesignerNewsLogin.class);
FabTransform.addExtras(intent, ContextCompat.getColor(this, R.color.accent), R.drawable.ic_add_dark);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, fab, getString(R.string.transition_designer_news_login));
startActivityForResult(intent, RC_NEW_DESIGNER_NEWS_LOGIN, options.toBundle());
}
}
use of butterknife.OnClick in project plaid by nickbutcher.
the class PostNewDesignerNewsStory method postNewStory.
@OnClick(R.id.new_story_post)
protected void postNewStory() {
if (DesignerNewsPrefs.get(this).isLoggedIn()) {
ImeUtils.hideIme(title);
Intent postIntent = new Intent(PostStoryService.ACTION_POST_NEW_STORY, null, this, PostStoryService.class);
postIntent.putExtra(PostStoryService.EXTRA_STORY_TITLE, title.getText().toString());
postIntent.putExtra(PostStoryService.EXTRA_STORY_URL, url.getText().toString());
postIntent.putExtra(PostStoryService.EXTRA_STORY_COMMENT, comment.getText().toString());
postIntent.putExtra(PostStoryService.EXTRA_BROADCAST_RESULT, getIntent().getBooleanExtra(PostStoryService.EXTRA_BROADCAST_RESULT, false));
startService(postIntent);
setResult(RESULT_POSTING);
finishAfterTransition();
} else {
Intent login = new Intent(this, DesignerNewsLogin.class);
MorphTransform.addExtras(login, ContextCompat.getColor(this, R.color.designer_news), 0);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, post, getString(R.string.transition_designer_news_login));
startActivity(login, options.toBundle());
}
}
use of butterknife.OnClick in project plaid by nickbutcher.
the class SearchActivity method doSave.
@OnClick(R.id.save_confirmed)
protected void doSave() {
Intent saveData = new Intent();
saveData.putExtra(EXTRA_QUERY, dataManager.getQuery());
saveData.putExtra(EXTRA_SAVE_DRIBBBLE, saveDribbble.isChecked());
saveData.putExtra(EXTRA_SAVE_DESIGNER_NEWS, saveDesignerNews.isChecked());
setResult(RESULT_CODE_SAVE, saveData);
dismiss();
}
Aggregations