本文整理了Java中android.support.v7.widget.CardView.setMaxCardElevation()
方法的一些代码示例,展示了CardView.setMaxCardElevation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CardView.setMaxCardElevation()
方法的具体详情如下:
包路径:android.support.v7.widget.CardView
类名称:CardView
方法名:setMaxCardElevation
暂无
代码示例来源:origin: jrvansuita/MaterialAbout
private void setupCard(AboutBuilder bundle) {
if (!bundle.isShowAsCard()) {
cvHolder.setCardElevation(0);
cvHolder.setRadius(0);
cvHolder.setUseCompatPadding(false);
cvHolder.setMaxCardElevation(0);
cvHolder.setPreventCornerOverlap(false);
( (LayoutParams)cvHolder.getLayoutParams()).setMargins(0, 0, 0, 0);
}
}
代码示例来源:origin: flipkart-incubator/proteus
@Override
public void setDimension(T view, float dimension) {
view.setMaxCardElevation(dimension);
}
});
代码示例来源:origin: open-android/ViewPagerCards
@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;
}
代码示例来源:origin: open-android/ViewPagerCards
@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;
}
代码示例来源:origin: qdxxxx/BezierViewPager
@Override
public Object instantiateItem(ViewGroup container, final int position) {
View view = LayoutInflater.from(container.getContext()).inflate(R.layout.adapter, container, false);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (cardItemClickListener != null) {
cardItemClickListener.onClick(position);
}
}
});
container.addView(view);
bind(mData.get(position), view);
CardView cardView = (CardView) view.findViewById(R.id.cardView);
cardView.setMaxCardElevation(MaxElevationFactor);
mViews.set(position, cardView);
return view;
}
代码示例来源:origin: woxblom/DragListView
@Override
public void onBindDragView(View clickedView, View dragView) {
CharSequence text = ((TextView) clickedView.findViewById(R.id.text)).getText();
((TextView) dragView.findViewById(R.id.text)).setText(text);
CardView dragCard = dragView.findViewById(R.id.card);
CardView clickedCard = clickedView.findViewById(R.id.card);
dragCard.setMaxCardElevation(40);
dragCard.setCardElevation(clickedCard.getCardElevation());
// I know the dragView is a FrameLayout and that is why I can use setForeground below api level 23
dragCard.setForeground(clickedView.getResources().getDrawable(R.drawable.card_view_drag_foreground));
}
代码示例来源:origin: DevExchanges/ViewPagerCards
@SuppressLint("DefaultLocale")
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.item_viewpager, container, false);
cardView = (CardView) view.findViewById(R.id.cardView);
cardView.setMaxCardElevation(cardView.getCardElevation() * CardAdapter.MAX_ELEVATION_FACTOR);
TextView title = (TextView) view.findViewById(R.id.title);
Button button = (Button)view.findViewById(R.id.button);
title.setText(String.format("Card %d", getArguments().getInt("position")));
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getActivity(), "Button in Card " + getArguments().getInt("position")
+ "Clicked!", Toast.LENGTH_SHORT).show();
}
});
return view;
}
代码示例来源:origin: JinBoy23520/CoderToDeveloperByTCLer
cardView.setMaxCardElevation(mBaseElevation * MAX_ELEVATION_FACTOR);
代码示例来源:origin: aliumujib/Nibo
private void setValuesToViews() {
this.mSearchCardView.setCardElevation(mSearchCardElevation);
this.mSearchCardView.setMaxCardElevation(mSearchCardElevation);
this.mHomeButton.setArrowDrawableColor(mArrorButtonColor);
this.mHomeButton.setState(mHomeButtonCloseIconState);
this.mHomeButton.setAnimationDuration(DURATION_HOME_BUTTON);
this.mSearchEditText.setTextColor(mSearchEditTextColor);
this.mSearchEditText.setHint(mSearchEditTextHint);
this.mSearchEditText.setHintTextColor(mSearchEditTextHintColor);
if (mLogoDrawable != null) {
this.mLogoView.setLogo(mLogoDrawable);
} else if (mStringLogoDrawable != null) {
this.mLogoView.setLogo(mStringLogoDrawable);
}
this.mLogoView.setTextColor(mSearchTextColor);
}
内容来源于网络,如有侵权,请联系作者删除!