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


Java CardView.getCardElevation方法代码示例

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


在下文中一共展示了CardView.getCardElevation方法的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: onLongClick

import android.support.v7.widget.CardView; //导入方法依赖的package包/类
void onLongClick() {
  Task currentTask = taskList.get(position);
  CardView cardView = (CardView)itemView;
  float initialElevation = cardView.getCardElevation();
  cardView.setCardElevation(cardView.getCardElevation() * 15);
  PopupMenu menu = new PopupMenu(context, itemView);
  menu.inflate(R.menu.pop_up_menu);
  menu.setOnMenuItemClickListener(item -> {
    switch (item.getItemId()){
      case R.id.edit_task:
        actions.editTask(currentTask, position);
        return true;
      case R.id.delete_task:
        actions.deleteTask(currentTask, position);
    }
    return false;
  });

  menu.setOnDismissListener(popupMenu ->
          cardView.setCardElevation(initialElevation));
  menu.show();
}
 
开发者ID:aumarbello,项目名称:Tasks,代码行数:23,代码来源:TaskViewHolder.java

示例4: 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

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