Search in sources :

Example 1 with OnItemClick

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

the class NearbyListFragment method onItemClicked.

@OnItemClick(R.id.listView)
void onItemClicked(int position) {
    Place place = (Place) listview.getItemAtPosition(position);
    LatLng placeLatLng = place.location;
    double latitude = placeLatLng.getLatitude();
    double longitude = placeLatLng.getLongitude();
    Timber.d("Item at position %d has coords: Lat: %f Long: %f", position, latitude, longitude);
    NearbyInfoDialog.showYourself(getActivity(), place);
}
Also used : LatLng(fr.free.nrw.commons.location.LatLng) OnItemClick(butterknife.OnItemClick)

Example 2 with OnItemClick

use of butterknife.OnItemClick in project SQLPractice by Gear61.

the class SettingsActivity method onItemClick.

@OnItemClick(R.id.settings_options)
public void onItemClick(int position) {
    Intent intent = null;
    switch(position) {
        case 0:
            String uriText = "mailto:" + SUPPORT_EMAIL + "?subject=" + Uri.encode(feedbackSubject);
            Uri mailUri = Uri.parse(uriText);
            Intent sendIntent = new Intent(Intent.ACTION_SENDTO, mailUri);
            sendIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            startActivity(Intent.createChooser(sendIntent, sendEmail));
            return;
        case 1:
            intent = new Intent(Intent.ACTION_VIEW, Uri.parse(OTHER_APPS_URL));
            break;
        case 2:
            Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName());
            intent = new Intent(Intent.ACTION_VIEW, uri);
            if (!(getPackageManager().queryIntentActivities(intent, 0).size() > 0)) {
                Utils.showSnackbar(parent, getString(R.string.play_store_error));
                return;
            }
            break;
        case 3:
            intent = new Intent(Intent.ACTION_VIEW, Uri.parse(REPO_URL));
            break;
        case 4:
            intent = new Intent(this, DatabaseTablesActivity.class);
    }
    intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    startActivity(intent);
}
Also used : Intent(android.content.Intent) BindString(butterknife.BindString) Uri(android.net.Uri) OnItemClick(butterknife.OnItemClick)

Example 3 with OnItemClick

use of butterknife.OnItemClick in project SQLPractice by Gear61.

the class MainActivity method onItemClick.

@OnItemClick(R.id.question_list)
public void onItemClick(int position) {
    Intent intent = new Intent(this, QuestionActivity.class);
    intent.putExtra(Constants.QUESTION_NUMBER_KEY, position);
    startActivity(intent);
}
Also used : Intent(android.content.Intent) OnItemClick(butterknife.OnItemClick)

Example 4 with OnItemClick

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

the class SearchResultsFragment method onItemClick.

@OnItemClick(R.id.search_results_list)
void onItemClick(ListView view, int position) {
    Callback callback = callback();
    if (callback != null) {
        PageTitle item = ((SearchResult) getAdapter().getItem(position)).getPageTitle();
        callback.navigateToTitle(item, false, position);
    }
}
Also used : PageTitle(org.wikipedia.page.PageTitle) OnItemClick(butterknife.OnItemClick)

Aggregations

OnItemClick (butterknife.OnItemClick)4 Intent (android.content.Intent)2 Uri (android.net.Uri)1 BindString (butterknife.BindString)1 LatLng (fr.free.nrw.commons.location.LatLng)1 PageTitle (org.wikipedia.page.PageTitle)1