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

The following examples show how to use android.support.v17.leanback.widget.OnItemSelectedListener. 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: TVDemoFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
    return new OnItemSelectedListener() {
        @Override
        public void onItemSelected(Object item, Row row) {
            if (item instanceof Movie) {
                mBackgroundURI = ((Movie) item).getBackgroundImageURI();
                startBackgroundTimer();
            }
        }
    };
}
 
Example #2
Source File: RowsSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
    VerticalGridView listView = getVerticalGridView();
    if (listView != null) {
        final int count = listView.getChildCount();
        for (int i = 0; i < count; i++) {
            View view = listView.getChildAt(i);
            ItemBridgeAdapter.ViewHolder vh = (ItemBridgeAdapter.ViewHolder)
                    listView.getChildViewHolder(view);
            setOnItemSelectedListener(vh, mOnItemSelectedListener);
        }
    }
}
 
Example #3
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
	return new OnItemSelectedListener() {
		@Override
		public void onItemSelected(Object item, Row row) {
			// item is selected
		}
	};
}
 
Example #4
Source File: CustomHeadersFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private OnItemSelectedListener getDefaultItemSelectedListener() {
	return new OnItemSelectedListener() {
		@Override
		public void onItemSelected(Object o, Row row) {
			Object obj = ((ListRow) row).getAdapter().get(0);
			getFragmentManager().beginTransaction().replace(R.id.rows_container, (Fragment) obj).commit();
			((TVDemoActivity) getActivity()).updateCurrentRowsFragment((CustomRowsFragment) obj);
		}
	};
}
 
Example #5
Source File: RowsFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
    VerticalGridView listView = getVerticalGridView();
    if (listView != null) {
        final int count = listView.getChildCount();
        for (int i = 0; i < count; i++) {
            View view = listView.getChildAt(i);
            ItemBridgeAdapter.ViewHolder vh = (ItemBridgeAdapter.ViewHolder)
                    listView.getChildViewHolder(view);
            setOnItemSelectedListener(vh, mOnItemSelectedListener);
        }
    }
}
 
Example #6
Source File: TVDemoFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
    return new OnItemSelectedListener() {
        @Override
        public void onItemSelected(Object item, Row row) {
            if (item instanceof Movie) {
                mBackgroundURI = ((Movie) item).getBackgroundImageURI();
                startBackgroundTimer();
            }
        }
    };
}
 
Example #7
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
	return new OnItemSelectedListener() {
		@Override
		public void onItemSelected(Object item, Row row) {
			// item is selected
		}
	};
}
 
Example #8
Source File: CustomHeadersFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private OnItemSelectedListener getDefaultItemSelectedListener() {
	return new OnItemSelectedListener() {
		@Override
		public void onItemSelected(Object o, Row row) {
			Object obj = ((ListRow) row).getAdapter().get(0);
			getFragmentManager().beginTransaction().replace(R.id.rows_container, (Fragment) obj).commit();
		}
	};
}
 
Example #9
Source File: TVDemoFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
    return new OnItemSelectedListener() {
        @Override
        public void onItemSelected(Object item, Row row) {
            if (item instanceof Movie) {
                mBackgroundURI = ((Movie) item).getBackgroundImageURI();
                startBackgroundTimer();
            }
        }
    };
}
 
Example #10
Source File: TVGridFragment.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
protected OnItemSelectedListener getDefaultItemSelectedListener() {
	return new OnItemSelectedListener() {
		@Override
		public void onItemSelected(Object item, Row row) {
			// item is selected
		}
	};
}
 
Example #11
Source File: RowsSupportFragment.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
private static void setOnItemSelectedListener(ItemBridgeAdapter.ViewHolder vh,
        OnItemSelectedListener listener) {
    ((RowPresenter) vh.getPresenter()).setOnItemSelectedListener(listener);
}
 
Example #12
Source File: RowsFragment.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
private static void setOnItemSelectedListener(ItemBridgeAdapter.ViewHolder vh,
        OnItemSelectedListener listener) {
    ((RowPresenter) vh.getPresenter()).setOnItemSelectedListener(listener);
}
 
Example #13
Source File: HeadersFragment.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}
 
Example #14
Source File: HeadersSupportFragment.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}
 
Example #15
Source File: SearchFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener for the results.
 *
 * @param listener The item selection listener to be invoked when an item in
 *        the search results is selected.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}
 
Example #16
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}
 
Example #17
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener. This listener will be called when an
 * item or row is selected by a user.
 *
 * @param listener The listener to call when an item or row is selected.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mExternalOnItemSelectedListener = listener;
}
 
Example #18
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}
 
Example #19
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener. This listener will be called when an
 * item or row is selected by a user.
 *
 * @param listener The listener to call when an item or row is selected.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mExternalOnItemSelectedListener = listener;
}
 
Example #20
Source File: DetailsFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mExternalOnItemSelectedListener = listener;
}
 
Example #21
Source File: DetailsSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mExternalOnItemSelectedListener = listener;
}
 
Example #22
Source File: SearchSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * Sets an item selection listener for the results.
 *
 * @param listener The item selection listener to be invoked when an item in
 *        the search results is selected.
 * @deprecated Use {@link #setOnItemViewSelectedListener(OnItemViewSelectedListener)}
 */
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mOnItemSelectedListener = listener;
}