本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}