android.support.v17.leanback.widget.OnItemClickedListener Java Examples

The following examples show how to use android.support.v17.leanback.widget.OnItemClickedListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SearchFragment.java    From Amphitheatre with Apache License 2.0 6 votes vote down vote up
private OnItemClickedListener getDefaultItemClickedListener() {
    return new OnItemClickedListener() {
        @Override
        public void onItemClicked(Object item, Row row) {
            if (item instanceof Video) {
                Video video = (Video) item;

                if (!video.isMatched()) {
                    VideoUtils.playVideo(new WeakReference<Activity>(getActivity()), (Video) item);
                    return;
                }

                Intent intent = new Intent(getActivity(), DetailsActivity.class);
                intent.putExtra(Constants.VIDEO, video);
                startActivity(intent);
            }
        }
    };
}
 
Example #2
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item clicked listener.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mGridPresenter != null) {
        mGridPresenter.setOnItemClickedListener(mOnItemClickedListener);
    }
}
 
Example #3
Source File: TVSearchFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object o, Row row) {
			Utils.showToast(getActivity(), "Do something");
		}
	};
}
 
Example #4
Source File: TVVideoDetailsFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
    return new OnItemClickedListener() {
        @Override
        public void onItemClicked(Object item, Row row) {
            if (item instanceof Movie) {
                Movie movie = (Movie) item;
                Intent intent = new Intent(getActivity(), TVDetailsActivity.class);
                intent.putExtra(MOVIE, movie);
                startActivity(intent);
            }
        }
    };
}
 
Example #5
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object item, Row row) {
			Utils.showToast(getActivity(), "Item clicked");
		}
	};
}
 
Example #6
Source File: TVSearchFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object o, Row row) {
			Utils.showToast(getActivity(), "Do something");
		}
	};
}
 
Example #7
Source File: TVVideoDetailsFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
    return new OnItemClickedListener() {
        @Override
        public void onItemClicked(Object item, Row row) {
            if (item instanceof Movie) {
                Movie movie = (Movie) item;
                Intent intent = new Intent(getActivity(), TVDetailsActivity.class);
                intent.putExtra(MOVIE, movie);
                startActivity(intent);
            }
        }
    };
}
 
Example #8
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object item, Row row) {
			Utils.showToast(getActivity(), "Item clicked");
		}
	};
}
 
Example #9
Source File: TVSearchFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object o, Row row) {
			Utils.showToast(getActivity(), "Do something");
		}
	};
}
 
Example #10
Source File: TVVideoDetailsFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
    return new OnItemClickedListener() {
        @Override
        public void onItemClicked(Object item, Row row) {
            if (item instanceof Movie) {
                Movie movie = (Movie) item;
                Intent intent = new Intent(getActivity(), TVDetailsActivity.class);
                intent.putExtra(MOVIE, movie);
                startActivity(intent);
            }
        }
    };
}
 
Example #11
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
	return new OnItemClickedListener() {
		@Override
		public void onItemClicked(Object item, Row row) {
			Utils.showToast(getActivity(), "Item clicked");
		}
	};
}
 
Example #12
Source File: VideoDetailsFragment.java    From Amphitheatre with Apache License 2.0 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
    return new OnItemClickedListener() {
        @Override
        public void onItemClicked(Object item, Row row) {
            if (item instanceof Video) {
                Intent intent = new Intent(getActivity(), DetailsActivity.class);
                intent.putExtra(Constants.IS_VIDEO, true);
                intent.putExtra(Constants.VIDEO, (Video) item);
                startActivity(intent);
            }
        }
    };
}
 
Example #13
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item clicked listener.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mGridPresenter != null) {
        mGridPresenter.setOnItemClickedListener(mOnItemClickedListener);
    }
}
 
Example #14
Source File: SearchFragment.java    From TuentiTV with Apache License 2.0 5 votes vote down vote up
protected OnItemClickedListener getDefaultItemClickedListener() {
  return new OnItemClickedListener() {
    @Override public void onItemClicked(Object item, Row row) {
      searchPresenter.onContactClicked((Contact) item);
    }
  };
}
 
Example #15
Source File: RowsSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item clicked listener on the fragment.
 * OnItemClickedListener will override {@link View.OnClickListener} that
 * item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
 * So in general,  developer should choose one of the listeners but not both.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mViewsCreated) {
        throw new IllegalStateException(
                "Item clicked listener must be set before views are created");
    }
}
 
Example #16
Source File: RowsFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item clicked listener on the fragment.
 * OnItemClickedListener will override {@link View.OnClickListener} that
 * item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
 * So in general,  developer should choose one of the listeners but not both.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mViewsCreated) {
        throw new IllegalStateException(
                "Item clicked listener must be set before views are created");
    }
}
 
Example #17
Source File: DetailsFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item Clicked listener.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mRowsFragment != null) {
        mRowsFragment.setOnItemClickedListener(listener);
    }
}
 
Example #18
Source File: DetailsSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item Clicked listener.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mRowsSupportFragment != null) {
        mRowsSupportFragment.setOnItemClickedListener(listener);
    }
}
 
Example #19
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an item clicked listener on the fragment.
 *
 * <p>OnItemClickedListener will override {@link View.OnClickListener} that
 * an item presenter may set during
 * {@link Presenter#onCreateViewHolder(ViewGroup)}. So in general, you
 * should choose to use an {@link OnItemClickedListener} or a
 * {@link View.OnClickListener} on your item views, but not both.
 *
 * @param listener The listener to call when an item is clicked.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mRowsSupportFragment != null) {
        mRowsSupportFragment.setOnItemClickedListener(listener);
    }
}
 
Example #20
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an item clicked listener on the fragment.
 *
 * <p>OnItemClickedListener will override {@link View.OnClickListener} that
 * an item presenter may set during
 * {@link Presenter#onCreateViewHolder(ViewGroup)}. So in general, you
 * should choose to use an {@link OnItemClickedListener} or a
 * {@link View.OnClickListener} on your item views, but not both.
 *
 * @param listener The listener to call when an item is clicked.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
    if (mRowsFragment != null) {
        mRowsFragment.setOnItemClickedListener(listener);
    }
}
 
Example #21
Source File: DetailsFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item Clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #22
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #23
Source File: SearchSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item clicked listener for the results.
 *
 * @param listener The item clicked listener to be invoked when an item in
 *        the search results is clicked.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
}
 
Example #24
Source File: RowsSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #25
Source File: DetailsSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item Clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #26
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #27
Source File: RowsFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #28
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #29
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the item clicked listener.
 * @deprecated Use {@link #getOnItemViewClickedListener()}
 */
public OnItemClickedListener getOnItemClickedListener() {
    return mOnItemClickedListener;
}
 
Example #30
Source File: SearchFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item clicked listener for the results.
 *
 * @param listener The item clicked listener to be invoked when an item in
 *        the search results is clicked.
 * @deprecated Use {@link #setOnItemViewClickedListener(OnItemViewClickedListener)}
 */
public void setOnItemClickedListener(OnItemClickedListener listener) {
    mOnItemClickedListener = listener;
}