• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VerticalGridView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.v17.leanback.widget.VerticalGridView的典型用法代码示例。如果您正苦于以下问题:Java VerticalGridView类的具体用法?Java VerticalGridView怎么用?Java VerticalGridView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VerticalGridView类属于android.support.v17.leanback.widget包,在下文中一共展示了VerticalGridView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setupHeaderView

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private void setupHeaderView(VerticalGridView grid, View header) {
    mDetailView = new EpisodeDetailsView(getActivity(), header);
    if (mCurrentEpisode != null) {
        mDetailView.setEpisode(mCurrentEpisode);
    }
    int height = getResources().getDimensionPixelSize(R.dimen.episode_detail_padding_bottom);
    FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) header.getLayoutParams();
    lp.height = mHeaderHeight + height;
    header.setLayoutParams(lp);
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:11,代码来源:DetailsFragment.java


示例2: setVerticalGridViewLayout

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
void setVerticalGridViewLayout(VerticalGridView listview) {
    if (listview == null) {
        return;
    }
    // Padding affects alignment when last row is focused
    // (last is first when there's only one row).
    setBottomPadding(listview, mPaddingBottom);

    // Item alignment affects focused row that isn't the last.
    listview.setItemAlignmentOffset(mAlignPosition);
    listview.setItemAlignmentOffsetPercent(100);

    // Push rows to the bottom.
    listview.setWindowAlignmentOffset(0);
    listview.setWindowAlignmentOffsetPercent(100);
    listview.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_HIGH_EDGE);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:19,代码来源:PlaybackOverlaySupportFragment.java


示例3: onCreate

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public void onCreate(ItemBridgeAdapter.ViewHolder vh) {
    VerticalGridView listView = getVerticalGridView();
    if (listView != null && ((RowPresenter) vh.getPresenter()).canDrawOutOfBounds()) {
        listView.setClipChildren(false);
    }
    setupSharedViewPool(vh);
    mViewsCreated = true;
    vh.setExtraObject(new RowViewHolderExtra(vh));
    // selected state is initialized to false, then driven by grid view onChildSelected
    // events.  When there is rebind, grid view fires onChildSelected event properly.
    // So we don't need do anything special later in onBind or onAttachedToWindow.
    setRowViewSelected(vh, false, true);
    if (mExternalAdapterListener != null) {
        mExternalAdapterListener.onCreate(vh);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:18,代码来源:RowsSupportFragment.java


示例4: setVerticalGridViewLayout

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
void setVerticalGridViewLayout(VerticalGridView listview) {
    // align the top edge of item to a fixed position
    listview.setItemAlignmentOffset(0);
    listview.setItemAlignmentOffsetPercent(VerticalGridView.ITEM_ALIGN_OFFSET_PERCENT_DISABLED);
    listview.setWindowAlignmentOffset(mContainerListAlignTop);
    listview.setWindowAlignmentOffsetPercent(VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);
    listview.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_NO_EDGE);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:9,代码来源:DetailsFragment.java


示例5: setExpand

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
/**
 * Set the visibility of titles/hovercard of browse rows.
 */
public void setExpand(boolean expand) {
    mExpand = expand;
    VerticalGridView listView = getVerticalGridView();
    if (listView != null) {
        if (!mInTransition) ((ViewGroup) mScaleFrameLayout.getParent()).setClipChildren(!needsScale());
        updateRowScaling();
        final int count = listView.getChildCount();
        if (DEBUG) Log.v(TAG, "setExpand " + expand + " count " + count);
        for (int i = 0; i < count; i++) {
            View view = listView.getChildAt(i);
            ItemBridgeAdapter.ViewHolder vh = (ItemBridgeAdapter.ViewHolder) listView.getChildViewHolder(view);
            setRowViewExpanded(vh, mExpand);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:19,代码来源:RowsFragment.java


示例6: onRowSelected

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
protected void onRowSelected(ViewGroup parent, View view, int position, long id) {
    VerticalGridView listView = getVerticalGridView();
    if (listView == null) {
        return;
    }
    ItemBridgeAdapter.ViewHolder vh = (view == null) ? null :
        (ItemBridgeAdapter.ViewHolder) listView.getChildViewHolder(view);

    if (mSelectedViewHolder != vh) {
        if (DEBUG) Log.v(TAG, "new row selected position " + position + " view " + view);

        if (mSelectedViewHolder != null) {
            setRowViewSelected(mSelectedViewHolder, false, false);
        }
        mSelectedViewHolder = vh;
        if (mSelectedViewHolder != null) {
            setRowViewSelected(mSelectedViewHolder, true, false);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:22,代码来源:RowsFragment.java


示例7: onCreateView

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    VerticalGridView actionsList = getGuidedActionsStylist().getActionsGridView();
    actionsList.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_BOTH_EDGE);
    VerticalGridView buttonActionsList = getGuidedButtonActionsStylist().getActionsGridView();
    buttonActionsList.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_BOTH_EDGE);
    return view;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:11,代码来源:DvrGuidedStepFragment.java


示例8: onStart

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public void onStart() {
    super.onStart();
    // TODO: remove the workaround of b/30401180.
    VerticalGridView container = (VerticalGridView) getActivity()
            .findViewById(R.id.container_list);
    // Need to manually modify offset. Please refer DetailsFragment.setVerticalGridViewLayout.
    container.setItemAlignmentOffset(0);
    container.setWindowAlignmentOffset(
            getResources().getDimensionPixelSize(R.dimen.lb_details_rows_align_top));
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:12,代码来源:DvrDetailsFragment.java


示例9: onCreateView

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    if (mSelectedPosition != INVALID_POSITION) {
        setSelectedPosition(mSelectedPosition);
    }
    VerticalGridView listView = (VerticalGridView) view.findViewById(R.id.side_panel_list);
    listView.setOnKeyInterceptListener(new OnRepeatedKeyInterceptListener(listView) {
        @Override
        public boolean onInterceptKeyEvent(KeyEvent event) {
            // In order to send tune operation once for continuous channel up/down events,
            // we only call the moveToChannel method on ACTION_UP event of channel switch keys.
            if (event.getAction() == KeyEvent.ACTION_UP) {
                switch (event.getKeyCode()) {
                    case KeyEvent.KEYCODE_DPAD_UP:
                    case KeyEvent.KEYCODE_DPAD_DOWN:
                        if (mLastFocusedChannelId != Channel.INVALID_ID) {
                            getMainActivity().tuneToChannel(
                                    getChannelDataManager().getChannel(mLastFocusedChannelId));
                        }
                        break;
                }
            }
            return super.onInterceptKeyEvent(event);
        }
    });
    getActivity().getContentResolver().registerContentObserver(TvContract.Programs.CONTENT_URI,
            true, mProgramUpdateObserver);
    getMainActivity().startShrunkenTvView(true, true);
    return view;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:33,代码来源:ChannelsBlockedFragment.java


示例10: onCreateView

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    if (sRecycledViewPool == null) {
        // sRecycledViewPool should be initialized by calling preloadRecycledViews()
        // before the entering animation of this fragment starts,
        // because it takes long time and if it is called after the animation starts (e.g. here)
        // it can affect the animation.
        throw new IllegalStateException("The RecyclerView pool has not been initialized.");
    }
    View view = inflater.inflate(getFragmentLayoutResourceId(), container, false);

    TextView textView = (TextView) view.findViewById(R.id.side_panel_title);
    textView.setText(getTitle());

    mListView = (VerticalGridView) view.findViewById(R.id.side_panel_list);
    mListView.setRecycledViewPool(sRecycledViewPool);

    mAdapter = new ItemAdapter(inflater, getItemList());
    mListView.setAdapter(mAdapter);
    mListView.requestFocus();

    return view;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:25,代码来源:SideFragment.java


示例11: setupGridAlignment

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private void setupGridAlignment(VerticalGridView grid) {
    int cardHeight = getResources().getDimensionPixelSize(R.dimen.card_height);
    int titleHeight = getResources().getDimensionPixelSize(R.dimen.lb_browse_header_height);
    grid.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_LOW_EDGE);
    grid.setWindowAlignmentOffset(cardHeight + titleHeight);
    grid.setWindowAlignmentOffsetPercent(VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);

    FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) grid.getLayoutParams();
    lp.topMargin = mHeaderHeight;
    grid.setLayoutParams(lp);
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:12,代码来源:DetailsFragment.java


示例12: insertHeader

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private void insertHeader(LayoutInflater inflater, FrameLayout container) {
    VerticalGridView grid = findFirstGrid(container);
    if (grid != null) {
        View header = inflater.inflate(R.layout.episode_details_view, container, false);
        View bottom = inflater.inflate(R.layout.dark_gradient, container, false);
        container.addView(header, 0);
        container.addView(bottom, 1);
        setupGridAlignment(grid);
        setupHeaderView(grid, header);
        setupGradient(bottom);
    } else {
        Utils.showToast(getActivity(), "No Grid Found!");
    }
}
 
开发者ID:xwz,项目名称:iview-android-tv,代码行数:15,代码来源:DetailsFragment.java


示例13: findFirstGrid

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private VerticalGridView findFirstGrid(ViewGroup container) {
    for (int i = 0, k = container.getChildCount(); i < k; i++) {
        View view = container.getChildAt(i);
        if (view instanceof VerticalGridView) {
            return (VerticalGridView) view;
        }
    }
    return null;
}
 
开发者ID:xwz,项目名称:iview-android-tv,代码行数:10,代码来源:DetailsFragment.java


示例14: refreshUi

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private void refreshUi() {
    try {
        final JsonListing[] names = getUrls();
        items = new RecyclerViewItem[names.length + 1];
        items[0] = new RecyclerViewItem(getString(R.string.add_new_link)) {
            @Override
            public void onClick() {
                Intent i = new Intent(JsonListingPanelActivity.this, ListingPlugin.class);
                i.putExtra(CumulusTvPlugin.INTENT_EXTRA_ACTION, CumulusTvPlugin.INTENT_ADD);
                startActivity(i);
            }
        };
        if (names.length > 0) {
            for (int i = 1; i < items.length; i++) {
                final int finalI = i;
                Log.d(TAG, "Poll " + finalI);
                items[i] = new RecyclerViewItem(names[finalI - 1].getUrl()) {
                    @Override
                    public void onClick() {
                        showEditDialog(names[finalI - 1]);
                    }
                };
            }
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }

    mAppLinkMenuList = (VerticalGridView) findViewById(R.id.list);
    mAppLinkMenuList.setAdapter(new AppLinkMenuAdapter(this, items));
}
 
开发者ID:Fleker,项目名称:CumulusTV,代码行数:32,代码来源:JsonListingPanelActivity.java


示例15: setItemAlignment

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
void setItemAlignment() {
    if (mVerticalGridView != null) {
        // align the top edge of item
        mVerticalGridView.setItemAlignmentOffset(0);
        mVerticalGridView.setItemAlignmentOffsetPercent(
                VerticalGridView.ITEM_ALIGN_OFFSET_PERCENT_DISABLED);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:9,代码来源:BaseRowFragment.java


示例16: setWindowAlignmentFromTop

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
void setWindowAlignmentFromTop(int alignedTop) {
    if (mVerticalGridView != null) {
        // align to a fixed position from top
        mVerticalGridView.setWindowAlignmentOffset(alignedTop);
        mVerticalGridView.setWindowAlignmentOffsetPercent(
                VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);
        mVerticalGridView.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_NO_EDGE);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:10,代码来源:BaseRowFragment.java


示例17: onStart

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
public void onStart() {
    super.onStart();

    VerticalGridView list = mRowsSupportFragment.getVerticalGridView();
    int mContainerListAlignTop =
            getResources().getDimensionPixelSize(R.dimen.lb_search_browse_rows_align_top);
    list.setItemAlignmentOffset(0);
    list.setItemAlignmentOffsetPercent(VerticalGridView.ITEM_ALIGN_OFFSET_PERCENT_DISABLED);
    list.setWindowAlignmentOffset(mContainerListAlignTop);
    list.setWindowAlignmentOffsetPercent(VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);
    list.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_NO_EDGE);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:14,代码来源:SearchSupportFragment.java


示例18: setOnItemViewSelectedListener

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
/**
 * Sets an item selection listener.
 */
public void setOnItemViewSelectedListener(OnItemViewSelectedListener listener) {
    mOnItemViewSelectedListener = 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);
            setOnItemViewSelectedListener(vh, mOnItemViewSelectedListener);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:17,代码来源:RowsSupportFragment.java


示例19: setWindowAlignmentFromTop

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
@Override
void setWindowAlignmentFromTop(int alignedTop) {
    mAlignedTop = alignedTop;
    final VerticalGridView gridView = getVerticalGridView();
    if (gridView != null) {
        updateWindowAlignOffset();
        // align to a fixed position from top
        gridView.setWindowAlignmentOffsetPercent(
                VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);
        gridView.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_NO_EDGE);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:13,代码来源:RowsSupportFragment.java


示例20: freezeRows

import android.support.v17.leanback.widget.VerticalGridView; //导入依赖的package包/类
private void freezeRows(boolean freeze) {
    VerticalGridView verticalView = getVerticalGridView();
    if (verticalView != null) {
        final int count = verticalView.getChildCount();
        for (int i = 0; i < count; i++) {
            ItemBridgeAdapter.ViewHolder ibvh = (ItemBridgeAdapter.ViewHolder)
                verticalView.getChildViewHolder(verticalView.getChildAt(i));
            RowPresenter rowPresenter = (RowPresenter) ibvh.getPresenter();
            RowPresenter.ViewHolder vh = rowPresenter.getRowViewHolder(ibvh.getViewHolder());
            rowPresenter.freeze(vh, freeze);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:14,代码来源:RowsSupportFragment.java



注:本文中的android.support.v17.leanback.widget.VerticalGridView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NPC类代码示例发布时间:2022-05-22
下一篇:
Java RequestSchedulerId类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap