当前位置: 首页>>代码示例>>Java>>正文


Java RelativeLayout.getChildCount方法代码示例

本文整理汇总了Java中android.widget.RelativeLayout.getChildCount方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.getChildCount方法的具体用法?Java RelativeLayout.getChildCount怎么用?Java RelativeLayout.getChildCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.RelativeLayout的用法示例。


在下文中一共展示了RelativeLayout.getChildCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCurrentItem

import android.widget.RelativeLayout; //导入方法依赖的package包/类
public void setCurrentItem(int item) {
    if (this.mViewPager != null) {
        if (item != -1 || this.mSelectedTabIndex != item) {
            this.mSelectedTabIndex = item;
            int tabCount = this.mTabLayout.getChildCount();
            for (int i = 0; i < tabCount; i++) {
                RelativeLayout childLayout = (RelativeLayout) this.mTabLayout.getChildAt(i);
                for (int j = 0; j < childLayout.getChildCount(); j++) {
                    boolean isSelected;
                    if (i == item) {
                        isSelected = true;
                    } else {
                        isSelected = false;
                    }
                    View view = childLayout.getChildAt(j);
                    if (view instanceof TabView) {
                        view.setSelected(isSelected);
                        if (isSelected) {
                            animateToTab(item);
                        }
                    } else {
                        view.setSelected(isSelected);
                    }
                }
            }
            this.mViewPager.setCurrentItem(item, false);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:30,代码来源:ChannelTabPageIndicator.java

示例2: MaxesViewHolder

import android.widget.RelativeLayout; //导入方法依赖的package包/类
public MaxesViewHolder(View view){
    super(view);
    lift = (TextView) view.findViewById(R.id.liftTitle);
    weight = (TextView) view.findViewById(R.id.weight);
    cardLayout = (RelativeLayout) view.findViewById(R.id.relative);
    floatingActionButton = (FloatingActionButton) view.findViewById(R
            .id.additionFAB);
    for(short i =0; i<cardLayout.getChildCount(); i++){
        if(cardLayout.getChildAt(i) instanceof AppCompatButton){
            cardButtons.add((AppCompatButton) cardLayout.getChildAt(i));
        }
    }
    vertMenu = (ImageView) view.findViewById(R.id.cardMenu);
    viewCard = view;
}
 
开发者ID:Durian-Inc,项目名称:SwolyV2,代码行数:16,代码来源:MaxesAdapter.java

示例3: setupIndicator

import android.widget.RelativeLayout; //导入方法依赖的package包/类
public void setupIndicator(RelativeLayout indicator) {
    this.indicator = indicator;
    if (indicator == null) {
        return;
    }
    if (indicator.getChildCount() > 0) {
        indicator.removeAllViews();
    }
    ringList = new ArrayList<ImageView>();
    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    lp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    LinearLayout ll = new LinearLayout(context);
    ll.setLayoutParams(lp);
    indicator.addView(ll);
    LinearLayout.LayoutParams lpp = new LinearLayout.LayoutParams(DisplayUtil.dp2px(7), DisplayUtil.dp2px(7));
    for (int i = 0; i < pageCount; i++) {
        ImageView iv = new ImageView(context);
        iv.setLayoutParams(lpp);
        if (pageCount == 1) {
            iv.setBackgroundResource(R.drawable.ring_imageview_select);
        }
        if (i > 0) {
            lpp.leftMargin = DisplayUtil.dp2px(3);
        }
        ringList.add(iv);
        ll.addView(iv);
    }
}
 
开发者ID:wzc25151,项目名称:lrs_android,代码行数:29,代码来源:AutoScrollViewPager.java


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