Search in sources :

Example 31 with OnClick

use of butterknife.OnClick in project apps-android-wikipedia by wikimedia.

the class CompilationDetailFragment method onMainPageClick.

@OnClick(R.id.button_compilation_detail_main_page)
void onMainPageClick() {
    try {
        PageTitle title = new PageTitle(OfflineManager.instance().getMainPageTitle(compilation), WikipediaApp.getInstance().getWikiSite());
        HistoryEntry entry = new HistoryEntry(title, HistoryEntry.SOURCE_MAIN_PAGE);
        startActivity(PageActivity.newIntentForNewTab(getContext(), entry, entry.getTitle()));
    } catch (IOException e) {
        L.e(e);
        FeedbackUtil.showError(getActivity(), e);
    }
}
Also used : PageTitle(org.wikipedia.page.PageTitle) HistoryEntry(org.wikipedia.history.HistoryEntry) IOException(java.io.IOException) OnClick(butterknife.OnClick)

Example 32 with OnClick

use of butterknife.OnClick in project collect by opendatakit.

the class ShowQRCodeFragment method chooseButtonClicked.

@OnClick(R.id.btnSelect)
void chooseButtonClicked() {
    Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
    photoPickerIntent.setType("image/*");
    if (photoPickerIntent.resolveActivity(getActivity().getPackageManager()) != null) {
        startActivityForResult(photoPickerIntent, SELECT_PHOTO);
    } else {
        ToastUtils.showShortToast(getString(R.string.activity_not_found, getString(R.string.choose_image)));
        Timber.w(getString(R.string.activity_not_found, getString(R.string.choose_image)));
    }
}
Also used : Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 33 with OnClick

use of butterknife.OnClick in project apps-android-commons by commons-app.

the class NearbyInfoDialog method onDirectionsClick.

@OnClick(R.id.link_preview_directions_button)
void onDirectionsClick() {
    //Open map app at given position
    Uri gmmIntentUri = Uri.parse("geo:0,0?q=" + location.getLatitude() + "," + location.getLongitude());
    Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
    if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
        startActivity(mapIntent);
    }
}
Also used : Intent(android.content.Intent) Uri(android.net.Uri) OnClick(butterknife.OnClick)

Example 34 with OnClick

use of butterknife.OnClick in project apps-android-commons by commons-app.

the class NavigationBaseFragment method onFeedbackItemClicked.

@OnClick(R.id.feedback_item)
protected void onFeedbackItemClicked() {
    closeDrawer();
    Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
    feedbackIntent.setType("message/rfc822");
    feedbackIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { CommonsApplication.FEEDBACK_EMAIL });
    feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, BuildConfig.VERSION_NAME));
    try {
        startActivity(feedbackIntent);
    } catch (ActivityNotFoundException e) {
        Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
    }
}
Also used : ActivityNotFoundException(android.content.ActivityNotFoundException) Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 35 with OnClick

use of butterknife.OnClick in project coins-android by bubelov.

the class SignInActivity method onGoogleSignInClick.

@OnClick(R.id.sign_in_with_google)
public void onGoogleSignInClick() {
    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);
    startActivityForResult(signInIntent, REQUEST_GOOGLE_SIGN_IN);
}
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