Search in sources :

Example 16 with OnClick

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();
}
Also used : EditText(android.widget.EditText) AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) OnClick(butterknife.OnClick)

Example 17 with OnClick

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();
    }
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 18 with OnClick

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());
    }
}
Also used : Intent(android.content.Intent) ActivityOptions(android.app.ActivityOptions) OnClick(butterknife.OnClick)

Example 19 with OnClick

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());
    }
}
Also used : Intent(android.content.Intent) ActivityOptions(android.app.ActivityOptions) OnClick(butterknife.OnClick)

Example 20 with OnClick

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();
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Aggregations

OnClick (butterknife.OnClick)465 Intent (android.content.Intent)206 View (android.view.View)24 AlertDialog (android.support.v7.app.AlertDialog)21 TextView (android.widget.TextView)18 File (java.io.File)18 Bundle (android.os.Bundle)16 BindView (butterknife.BindView)16 DialogInterface (android.content.DialogInterface)15 ArrayList (java.util.ArrayList)15 DialogFragment (com.rey.material.app.DialogFragment)13 SimpleDialog (com.rey.material.app.SimpleDialog)13 Uri (android.net.Uri)11 SimpleDateFormat (java.text.SimpleDateFormat)11 SuppressLint (android.annotation.SuppressLint)10 ImageView (android.widget.ImageView)10 LzyResponse (com.lzy.demo.model.LzyResponse)10 HorizontalChangeHandler (com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler)9 List (java.util.List)9 Animator (android.animation.Animator)8