Java 类android.support.v17.leanback.widget.FocusHighlight 实例源码

项目:TvSample    文件:VerticalGridFragment1.java   
private void setupFragment() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_SMALL);
    gridPresenter.setNumberOfColumns(numColumns);
    //gridPresenter.setShadowEnabled(false);
    setGridPresenter(gridPresenter);

    mAdapter = new ArrayObjectAdapter(new CardPresenter());

    List<Contact> contacts = ContactProvider.getContactList();
    mAdapter.addAll(0, contacts);

    setAdapter(mAdapter);

    setOnItemViewClickedListener(new ItemViewClickedListener());
    setOnItemViewSelectedListener(new ItemViewSelectedListener());
}
项目:TvSample    文件:VerticalGridFragment.java   
private void setupFragment() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_NONE);
    gridPresenter.setNumberOfColumns(numColumns);
    //gridPresenter.setShadowEnabled(false);
    setGridPresenter(gridPresenter);

    mAdapter = new ArrayObjectAdapter(new ContactPresenter());

    List<Contact> contacts = ContactProvider.getContactList();
    mAdapter.addAll(0, contacts);

    setAdapter(mAdapter);

    setOnItemViewClickedListener(new ItemViewClickedListener());
    setOnItemViewSelectedListener(new ItemViewSelectedListener());
}
项目:itplayer    文件:BrowserFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_MEDIUM);
    gridPresenter.setNumberOfColumns(4);
    setGridPresenter(gridPresenter);

    setOnItemViewClickedListener(this);
    setOnItemViewSelectedListener(this);

    backgroundManager = ((MainActivity) getActivity()).getBackgroundManager();
    metrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);

    mainHandler = new Handler(getContext().getMainLooper());
}
项目:aos-Video    文件:ListingFragment.java   
private VerticalGridPresenter buildGridPresenter() {
    final int zoom;
    final boolean focusDimmer;
    final int numberOfColumns;
    final boolean shadowEnabled;

    switch (mDisplayMode) {
        case GRID:
            zoom = FocusHighlight.ZOOM_FACTOR_LARGE;
            focusDimmer = false;
            numberOfColumns = 6;
            shadowEnabled = true;
            break;
        case LIST:
            zoom = FocusHighlight.ZOOM_FACTOR_SMALL;
            focusDimmer = false;
            numberOfColumns = 1;
            shadowEnabled = true;
            break;
        default:
            throw new IllegalArgumentException("Invalid Display Mode! "+mDisplayMode);
    }

    VerticalGridPresenter vgp = new VerticalGridPresenter(zoom, focusDimmer);
    vgp.setNumberOfColumns(numberOfColumns);
    vgp.setShadowEnabled(shadowEnabled);
    return vgp;
}