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

项目:sbs-android-tv    文件:MainFragment.java   
@SuppressWarnings("deprecation")
protected void setupUIElements() {
    setHeadersState(HEADERS_DISABLED | HEADERS_HIDDEN);
    setupHeader();
    View root = getView();
    if (root != null) {
        progress = new ProgressBar(getActivity());
        progress.setLayoutParams(new FrameLayout.LayoutParams(150, 150, Gravity.CENTER));
        progressText = new TextView(getActivity());
        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
        lp.topMargin = 150;
        progressText.setLayoutParams(lp);
        progressText.setGravity(Gravity.CENTER);
        progressText.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.fontHuge));
        BrowseFrameLayout frame = getBrowseFrame(root);
        frame.addView(progress);
        frame.addView(progressText);
    }
}
项目:iview-android-tv    文件:MainFragment.java   
@SuppressWarnings("deprecation")
protected void setupUIElements() {
    setHeadersState(HEADERS_DISABLED | HEADERS_HIDDEN);
    setupHeader();
    View root = getView();
    if (root != null) {
        progress = new ProgressBar(getActivity());
        progress.setLayoutParams(new FrameLayout.LayoutParams(150, 150, Gravity.CENTER));
        progressText = new TextView(getActivity());
        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
        lp.topMargin = 150;
        progressText.setLayoutParams(lp);
        progressText.setGravity(Gravity.CENTER);
        progressText.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.fontHuge));
        BrowseFrameLayout frame = getBrowseFrame(root);
        frame.addView(progress);
        frame.addView(progressText);
    }
}
项目:ring-client-android    文件:TVContactRequestFragment.java   
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    BrowseFrameLayout layout = (BrowseFrameLayout) view;

    // Override down navigation as we do not use it in this screen
    // Only the detailPresenter will be displayed
    layout.setOnDispatchKeyListener((v, keyCode, event) -> event.getKeyCode() == KeyEvent.KEYCODE_DPAD_DOWN);
}
项目:adt-leanback-support    文件:VerticalGridSupportFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.lb_vertical_grid_fragment,
            container, false);

    mBrowseFrame = (BrowseFrameLayout) root.findViewById(R.id.browse_frame);
    mBrowseFrame.setOnFocusSearchListener(mOnFocusSearchListener);

    mTitleView = (TitleView) root.findViewById(R.id.browse_title_group);
    mTitleView.setBadgeDrawable(mBadgeDrawable);
    mTitleView.setTitle(mTitle);
    if (mSearchAffordanceColorSet) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
    if (mExternalOnSearchClickedListener != null) {
        mTitleView.setOnSearchClickedListener(mExternalOnSearchClickedListener);
    }

    mSceneWithTitle = sTransitionHelper.createScene(root, new Runnable() {
        @Override
        public void run() {
            mTitleView.setVisibility(View.VISIBLE);
        }
    });
    mSceneWithoutTitle = sTransitionHelper.createScene(root, new Runnable() {
        @Override
        public void run() {
            mTitleView.setVisibility(View.INVISIBLE);
        }
    });
    mTitleUpTransition = TitleTransitionHelper.createTransitionTitleUp(sTransitionHelper);
    mTitleDownTransition = TitleTransitionHelper.createTransitionTitleDown(sTransitionHelper);
    sTransitionHelper.excludeChildren(mTitleUpTransition, R.id.browse_grid_dock, true);
    sTransitionHelper.excludeChildren(mTitleDownTransition, R.id.browse_grid_dock, true);

    return root;
}
项目:adt-leanback-support    文件:VerticalGridFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.lb_vertical_grid_fragment,
            container, false);

    mBrowseFrame = (BrowseFrameLayout) root.findViewById(R.id.browse_frame);
    mBrowseFrame.setOnFocusSearchListener(mOnFocusSearchListener);

    mTitleView = (TitleView) root.findViewById(R.id.browse_title_group);
    mTitleView.setBadgeDrawable(mBadgeDrawable);
    mTitleView.setTitle(mTitle);
    if (mSearchAffordanceColorSet) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
    if (mExternalOnSearchClickedListener != null) {
        mTitleView.setOnSearchClickedListener(mExternalOnSearchClickedListener);
    }

    mSceneWithTitle = sTransitionHelper.createScene(root, new Runnable() {
        @Override
        public void run() {
            mTitleView.setVisibility(View.VISIBLE);
        }
    });
    mSceneWithoutTitle = sTransitionHelper.createScene(root, new Runnable() {
        @Override
        public void run() {
            mTitleView.setVisibility(View.INVISIBLE);
        }
    });
    mTitleUpTransition = TitleTransitionHelper.createTransitionTitleUp(sTransitionHelper);
    mTitleDownTransition = TitleTransitionHelper.createTransitionTitleDown(sTransitionHelper);
    sTransitionHelper.excludeChildren(mTitleUpTransition, R.id.browse_grid_dock, true);
    sTransitionHelper.excludeChildren(mTitleDownTransition, R.id.browse_grid_dock, true);

    return root;
}
项目:aos-Video    文件:MyVerticalGridFragment.java   
private void setupFocusSearchListener() {
    BrowseFrameLayout browseFrameLayout = (BrowseFrameLayout) getView().findViewById(
            R.id.grid_frame);
    browseFrameLayout.setOnFocusSearchListener(getTitleHelper().getOnFocusSearchListener());
}
项目:sbs-android-tv    文件:MainFragment.java   
protected BrowseFrameLayout getBrowseFrame(View root) {
    return (BrowseFrameLayout) root.findViewById(android.support.v17.leanback.R.id.browse_frame);
}
项目:iview-android-tv    文件:MainFragment.java   
@Override
protected BrowseFrameLayout getBrowseFrame(View root) {
    return (BrowseFrameLayout) root.findViewById(android.support.v17.leanback.R.id.browse_frame);
}
项目:iview-android-tv    文件:MainFragment.java   
@Override
protected BrowseFrameLayout getBrowseFrame(View root) {
    return (BrowseFrameLayout) root.findViewById(android.support.v17.leanback.R.id.browse_frame);
}
项目:aos-Video    文件:TitleHelper.java   
/**
 * Returns a
 * {@link android.support.v17.leanback.widget.BrowseFrameLayout.OnFocusSearchListener} which
 * may be used to manage focus switching between the title view and scene root.
 */
public BrowseFrameLayout.OnFocusSearchListener getOnFocusSearchListener() {
    return mOnFocusSearchListener;
}
项目:iview-android-tv    文件:MainFragment.java   
protected abstract BrowseFrameLayout getBrowseFrame(View root);