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


Java CardView.setMaxCardElevation方法代码示例

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


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

示例1: instantiateItem

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = LayoutInflater.from(container.getContext())
            .inflate(R.layout.adapter, container, false);
    container.addView(view);
    bind(mData.get(position), view);
    CardView cardView = (CardView) view.findViewById(R.id.cardView);

    if (mBaseElevation == 0) {
        mBaseElevation = cardView.getCardElevation();
    }

    cardView.setMaxCardElevation(mBaseElevation * MAX_ELEVATION_FACTOR);
    mViews.set(position, cardView);
    return view;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:CardPagerAdapter.java

示例2: instantiateItem

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = LayoutInflater.from(container.getContext())
            .inflate(R.layout.card_adapter, container, false);
    container.addView(view);
    bind(mData.get(position), view);
    CardView cardView = (CardView) view.findViewById(R.id.cardView);

    if (mBaseElevation == 0) {
        mBaseElevation = cardView.getCardElevation();
    }

    cardView.setMaxCardElevation(mBaseElevation * MAX_ELEVATION_FACTOR);
    mViews.set(position, cardView);
    return view;
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:17,代码来源:CardPagerAdapter.java

示例3: instantiateItem

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, final int position) {
    View view = LayoutInflater.from(container.getContext())
            .inflate(R.layout.item_card, container, false);
    container.addView(view);
    bind(mData.get(position), view);
    CardView cardView = (CardView) view.findViewById(R.id.card_view);

    if (mBaseElevation == 0) {
        mBaseElevation = cardView.getCardElevation();
    }

    cardView.setMaxCardElevation(mBaseElevation * MAX_ELEVATION_FACTOR);
    mViews.set(position, cardView);

    cardView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (null != mOnItemClickListener) {
                mOnItemClickListener.onClick(position);
            }
        }
    });

    return view;
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:27,代码来源:CardPagerAdapter.java

示例4: onCreateView

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_adapter, container, false);
    mCardView = (CardView) view.findViewById(R.id.cardView);
    mCardView.setMaxCardElevation(mCardView.getCardElevation()
            * CardAdapter.MAX_ELEVATION_FACTOR);
    return view;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:CardFragment.java

示例5: instantiateItem

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
    container.addView(mViewList.get(position));//添加页卡
    CardView cardView = (CardView)mViewList.get(position).findViewById(R.id.cardView);
    if (mBaseElevation == 0) {
        mBaseElevation = cardView.getCardElevation();
    }
    cardView.setMaxCardElevation(mBaseElevation * MAX_ELEVATION_FACTOR);
    mViewList.set(position, cardView);
    return mViewList.get(position);
}
 
开发者ID:Luodian,项目名称:Shared-Route,代码行数:12,代码来源:CardPagerAdapter.java


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