Java 类android.support.v7.widget.CardView 实例源码

项目:Password-Storage    文件:LoginRegistrationActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_login_registration);
    login = (Button) findViewById(R.id.btn_login);
    register = (Button) findViewById(R.id.btn_register);
    cardView=(CardView)findViewById(R.id.layout2);
    splashActivity=new SplashActivity();

    login.setOnClickListener(this);
    register.setOnClickListener(this);
    b=splashActivity.containsPass("password");

    if(b==true)
    {
        register.setVisibility(View.INVISIBLE);
        cardView.setVisibility(View.INVISIBLE);
    }
}
项目:showroom-android    文件:CardsUpdater.java   
@Override
protected void onUpdateViewAlpha(@NonNull View view, float alpha) {
    final CardView card = ((CardView)view);
    final View alphaView = card.getChildAt(1);
    final View imageView = card.getChildAt(0);

    final boolean isLeftCard = alpha < 1;
    if (isLeftCard) {
        ViewCompat.setAlpha(alphaView, 0.9f - alpha);
        ViewCompat.setAlpha(imageView, 0.3f + alpha);
    } else {
        if (ViewCompat.getAlpha(alphaView) != 0) {
            ViewCompat.setAlpha(alphaView, 0f);
        }

        if (ViewCompat.getAlpha(imageView) != 1) {
            ViewCompat.setAlpha(imageView, 1f);
        }
    }
}
项目:ActivityDiary    文件:HistoryViewHolders.java   
public HistoryViewHolders(int loaderId, HistoryRecyclerViewAdapter.SelectListener listener, View itemView) {
    super(itemView);
    mLoaderId = loaderId;

    itemView.setOnClickListener(this);
    itemView.setOnLongClickListener(this);
    mSeparator = (TextView) itemView.findViewById(R.id.separator);
    mStartLabel = (TextView) itemView.findViewById(R.id.start_label);
    mNoteLabel = (TextView) itemView.findViewById(R.id.note);
    mDurationLabel = (TextView) itemView.findViewById(R.id.duration_label);
    mSymbol = (ImageView) itemView.findViewById(R.id.picture);
    mActivityCardView = (CardView) itemView.findViewById(R.id.activity_card);
    mName = (TextView) itemView.findViewById(R.id.activity_name);
    mBackground = itemView.findViewById(R.id.activity_background);
    mImageRecycler = (RecyclerView)itemView.findViewById(R.id.image_grid);
    mListener = listener;
}
项目:GitHub    文件:TechAdapter.java   
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
    if(tech.equals(GankMainFragment.tabTitle[0])) {
        ((ViewHolder)holder).ivIcon.setImageResource(R.mipmap.ic_android);
    } else if(tech.equals(GankMainFragment.tabTitle[1])) {
        ((ViewHolder)holder).ivIcon.setImageResource(R.mipmap.ic_ios);
    } else if(tech.equals(GankMainFragment.tabTitle[2])) {
        ((ViewHolder)holder).ivIcon.setImageResource(R.mipmap.ic_web);
    }
    ((ViewHolder)holder).tvContent.setText(mList.get(position).getDesc());
    ((ViewHolder)holder).tvAuthor.setText(mList.get(position).getWho());
    ((ViewHolder)holder).tvTime.setText(DateUtil.formatDateTime(DateUtil.subStandardTime(mList.get(position).getPublishedAt()), true));
    holder.itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(onItemClickListener != null) {
                CardView cv = (CardView) view.findViewById(R.id.cv_tech_content);
                onItemClickListener.onItemClick(holder.getAdapterPosition(),cv);
            }
        }
    });
}
项目:Matrix-Calculator-for-Android    文件:faqs.java   
private void SetThisColorToCard(int id) {
    //grab all 7 cards
    CardView cardView1 = (CardView) findViewById(R.id.QA1);
    CardView cardView2 = (CardView) findViewById(R.id.QA2);
    CardView cardView3 = (CardView) findViewById(R.id.QA3);
    CardView cardView5 = (CardView) findViewById(R.id.QA5);
    CardView cardView8 = (CardView) findViewById(R.id.QA8);
    CardView cardView9 = (CardView) findViewById(R.id.QA9);
    CardView cardView10 = (CardView) findViewById(R.id.QA10);
    //set the background color
    cardView1.setCardBackgroundColor(id);
    cardView2.setCardBackgroundColor(id);
    cardView3.setCardBackgroundColor(id);
    cardView5.setCardBackgroundColor(id);
    cardView8.setCardBackgroundColor(id);
    cardView9.setCardBackgroundColor(id);
    cardView10.setCardBackgroundColor(id);
}
项目:SharePanel    文件:SlideHideBehaviour.java   
private void animateOut(final CardView view) {
    if (animInProgress)
        return;
    animInProgress = true;
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view).translationX(hiddenPosX)
            .setInterpolator(interpolator).withLayer()
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view1) {
                    super.onAnimationEnd(view1);
                    animInProgress = false;
                    if (currentPos > 400)
                        animateIn(view);
                    else animateOut(view);
                }
            })
            .start();
}
项目:okdownload    文件:QueueActivity.java   
private void initController(final View actionView, final TextView actionTv,
                            final AppCompatRadioButton serialRb,
                            final AppCompatRadioButton parallelRb,
                            final CardView deleteActionView, final View deleteActionTv) {
    final QueueController controller = new QueueController();
    this.controller = controller;
    controller.initTasks(this, new DownloadQueueListener() {
        @Override public void queueEnd() {
            actionView.setTag(null);
            actionTv.setText(R.string.start);
            // to cancel
            controller.stop();

            serialRb.setEnabled(true);
            parallelRb.setEnabled(true);

            deleteActionView.setEnabled(true);
            deleteActionView.setCardElevation((Float) deleteActionView.getTag());
            deleteActionTv.setEnabled(true);

            adapter.notifyDataSetChanged();
        }
    });

}
项目:MaterialDesignFABtoSheet    文件:FABtoSheet.java   
public FABtoSheet(FloatingActionButton fab, CardView card) {
    this.floatingActionButton = fab;
    this.cardView = card;


    startWidth = floatingActionButton.getWidth();
    startHeight = floatingActionButton.getHeight();
    startLeft = floatingActionButton.getLeft();
    startTop = floatingActionButton.getTop();
    int startRight = floatingActionButton.getRight();
    int startBottom = floatingActionButton.getBottom();
    startRect = new Rect(startLeft, startTop, startRight, startBottom);

    endWidth = cardView.getWidth();
    endHeight = cardView.getHeight();
    endLeft = cardView.getLeft();
    endTop = cardView.getTop();
    int endRight = cardView.getRight();
    int endBottom = cardView.getBottom();
    endRect = new Rect(endLeft, endTop, endRight, endBottom);
    radius = Math.min(endWidth, endHeight)/2;
}
项目:Brevent    文件:AppsItemAdapter.java   
private boolean onSelected(CardView v) {
    AppsItemViewHolder holder = (AppsItemViewHolder) v.getTag();
    String packageName = holder.packageName;
    if (packageName == null || !mPackages.contains(packageName)) {
        return false;
    }
    if (mSelected.contains(packageName)) {
        mSelected.remove(packageName);
    } else {
        mSelected.add(packageName);
    }
    BreventActivity activity = getActivity();
    if (activity != null) {
        updateIcon(holder);
        activity.setSelectCount(mSelected.size());
    }
    return true;
}
项目:RantApp    文件:ProfileActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile);
    userId = getIntent().getIntExtra(EXTRA_USER_ID,0);
    mToolbar = (Toolbar) findViewById(R.id.activity_profile_toolbar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    mToolbar.setNavigationIcon(R.drawable.ic_action_back);

    mAvatarImageView = (ImageView) findViewById(R.id.activity_profile_avatar);
    mNameTextView = (TextView) findViewById(R.id.activity_profile_name);
    mBioTextView = (TextView) findViewById(R.id.activity_profile_bio);
    mValueTextView = (TextView) findViewById(R.id.activity_profile_value);
    mLocationTextView = (TextView) findViewById(R.id.activity_profile_location);
    mEditCardView = (CardView) findViewById(R.id.activity_profile_cv_edit);
    mEditButton = (Button) findViewById(R.id.activity_profile_button_edit);
    mRecyclerView = (RecyclerView) findViewById(R.id.activity_profile_recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setAdapter(new NewAdapter(new ArrayList<RantItem>()));


    getData();

}
项目:Review-    文件:ReviewListAdapter.java   
private void createCardView(ViewHolder holder, List<Point> points) {
    for (int i = 0; i < points.size(); i++) {
        final Point point = points.get(i);
        View pointView = LayoutInflater.from(mContext).inflate(R.layout.carview_review, holder.ly_carview, false);
        TextView pointName = (TextView) pointView.findViewById(R.id.tv_carview);
        CardView cardView = (CardView) pointView.findViewById(R.id.cv_carview);
        //5.0CarView 才支持设置阴影
        if(Build.VERSION.SDK_INT >=21) {
            cardView.setElevation(TDevice.dpToPixel(8));
        }
        cardViewSetBackgroundColor(point, cardView);
        //如果不是无效知识点,则加入点击事件
        if (point.getObjectId() != null) {
            cardView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    startContentList(point);
                }
            });
        }
        pointName.setText(point.getName());
        holder.ly_carview.addView(pointView);
    }
}
项目:MaterialOCR    文件:FabSpeedDial.java   
@Override
public void onClick(View v) {
    fab.setSelected(false);
    removeFabMenuItems();

    if (menuListener != null) {
        if (v == this || v == touchGuard) {
            menuListener.onMenuClosed();
        } else if (v instanceof FloatingActionButton) {
            menuListener.onMenuItemSelected(fabMenuItemMap.get(v));
        } else if (v instanceof CardView) {
            menuListener.onMenuItemSelected(cardViewMenuItemMap.get(v));
        }
    } else {
        Log.d(TAG, "You haven't provided a MenuListener.");
    }
}
项目:anitrend-app    文件:SeriesReviewAdapter.java   
CardViewHolder(View view) {
    super(view);
    mUpFlipper = (ViewFlipper) view.findViewById(R.id.mUpFlipper);
    mDownFlipper = (ViewFlipper) view.findViewById(R.id.mDownFlipper);
    user_name = (TextView) view.findViewById(R.id.review_user_name);
    review_date = (TextView) view.findViewById(R.id.review_date);
    review_summary = (TextView) view.findViewById(R.id.review_summary);
    review_up_score = (TextView) view.findViewById(R.id.review_up_score);
    review_down_score = (TextView) view.findViewById(R.id.review_down_score);
    review_rating = (RatingBar) view.findViewById(R.id.review_rating);
    user_image = (CircleImageView) view.findViewById(R.id.review_user_image);
    review_card = (CardView) view.findViewById(R.id.card_review);
    review_read_more = (TextView) view.findViewById(R.id.review_read_more);
    /*onClickListeners*/
    user_image.setOnClickListener(this);
    review_read_more.setOnClickListener(this);
    review_card.setOnClickListener(this);
    mUpFlipper.setOnClickListener(this);
    mDownFlipper.setOnClickListener(this);
}
项目:FLSGuide    文件:HomeFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View inputFragmentView = inflater.inflate(R.layout.fragment_home, container, false);

    CardView greeting = (CardView) inputFragmentView.findViewById(R.id.greeting);
    greeting.setOnClickListener(
            new CardView.OnClickListener(){
                @Override
                public void onClick(View view) {
                    Intent i = new Intent(getContext(), GreetingActivity.class);
                    startActivity(i);
                }
            }
    );

    return inputFragmentView;

}
项目:TextEmoji    文件:EmojiFragment.java   
private void initViews(View root) {
    mOptions = (CardView) root.findViewById(R.id.options);
    mEmojiTager = (EmojiTager) root.findViewById(R.id.emoji_tager);
    mEmojiRadioAdapter = new EmojiRadioAdapter(getActivity());
    mEmojiPagerAdapter = new EmojiPagerAdapter(getActivity());
    mEmojiTager.setRadioGroupAdapter(mEmojiRadioAdapter);
    mEmojiTager.setViewPagerAdapter(mEmojiPagerAdapter);

    int height = SharePreferencesUtils.getInt(getActivity(),
            Constants.SOFT_KEYBOARD_HEIGHT, mSoftKeyboardDefaultHeight);
    mEmojiTager.getLayoutParams().height = height;
    mOptions.getLayoutParams().height = height;

    mEmojiButton = (ImageView) root.findViewById(R.id.emoji_button);

    mGifs[0] = (ImageView) root.findViewById(R.id.gif3);
    mGifs[1] = (ImageView) root.findViewById(R.id.gif1);
    mGifs[2] = (ImageView) root.findViewById(R.id.gif2);

    mShareDialog = new ShareDialog(getContext());
    mShareDialog.setEmojiAddButtonVisible(false);

    mGifSourceSpinner = (Spinner) root.findViewById(R.id.gif_source_spinner);
}
项目:nativead    文件:AdLargeFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_ad_large, container, false);
    mCardView = (CardView) view.findViewById(R.id.ad_large_cardview);
    mIconView = (ImageView) view.findViewById(R.id.ad_large_iv_icon);
    mTitleView = (TextView) view.findViewById(R.id.ad_large_tv_title);
    mSubTitleView = (TextView) view.findViewById(R.id.ad_large_tv_sub_title);
    mPicView = (ImageView) view.findViewById(R.id.ad_large_iv_large_pic);
    return view;
}
项目:CouponsTracker    文件:CouponListAdapter.java   
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    CardView cardView = (CardView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.recycler_view_item_coupon, parent, false);
    final ViewHolder viewHolder = new ViewHolder(cardView);
    viewHolder.cardView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (onCouponClickListener != null) {
                onCouponClickListener.onCouponClick(coupons.get(viewHolder.getAdapterPosition()));
            }
        }
    });
    return viewHolder;
}
项目:ConnectU    文件:ReminderAdapter.java   
public ViewHolder(View v) {
    super(v);
    layout = v;
    llayout = (LinearLayout) v.findViewById(R.id.reminder_linear_layout);
    stroke = v.findViewById(R.id.strokeD);
    icon = (ImageView) v.findViewById(R.id.iconD);
    cType = (CardView) v.findViewById(R.id.cardD);
    tType = (TextView) v.findViewById(R.id.typeD);
    title = (TextView) v.findViewById(R.id.titleD);
    subtitle = (TextView) v.findViewById(R.id.subtitleD);
    text = (TextView) v.findViewById(R.id.textD);
}
项目:Pocket-Plays-for-Twitch    文件:GamesAdapter.java   
public GameViewHolder(View v) {
    super(v);
    vGamePreview    = (ImageView) v.findViewById(R.id.image_game_preview);
    vGameTitle      = (TextView) v.findViewById(R.id.game_card_title);
    vGameViewers    = (TextView) v.findViewById(R.id.game_viewers);
    vCard           = (CardView) v.findViewById(R.id.cardView_game);
    sharedPadding   = v.findViewById(R.id.shared_padding);
}
项目:Aurora    文件:MaterialSearchView.java   
private void initViews() {
        LayoutInflater inflater = LayoutInflater.from(context);
        final View view = inflater.inflate(R.layout.search_view, this);
        search = (CardView) view.findViewById(R.id.card_search);
        listView = (ListView) view.findViewById(R.id.listView);
        editText = (EditText) view.findViewById(R.id.edit_text_search);
//        line_divider = findViewById(R.id.line_divider);
        searchBack = (ImageView) findViewById(R.id.image_search_back);
        searchBack.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                showView();
            }
        });
    }
项目:Nibo    文件:NiboPlacesAutoCompleteSearchView.java   
static float calculateVerticalPadding(CardView cardView) {
    float maxShadowSize = cardView.getMaxCardElevation();
    float cornerRadius = cardView.getRadius();
    boolean addPaddingForCorners = cardView.getPreventCornerOverlap();

    if (addPaddingForCorners) {
        return (float) (maxShadowSize * 1.5f + (1 - COS_45) * cornerRadius);
    } else {
        return maxShadowSize * 1.5f;
    }
}
项目:Nearby    文件:NurseRecordActivity.java   
private void checkChangeBtn(){

        // vital sign
        boolean isVital = !vitalSign.isEmpty();
        changeBtnColor((CardView)findViewById(R.id.cv_record_vital_sign), isVital);
        // 복용약 여부
        boolean isTakeMedicine = (takeMedicines != null && takeMedicines.size() > 0);// || (etcMedicines != null && etcMedicines.size() > 0);
        changeBtnColor((CardView)findViewById(R.id.cv_record_patient_medicine), isTakeMedicine);
        // 식사 여부
        boolean isHaveMeal = haveMeal.getType() != null && !haveMeal.getType().isEmpty();
        changeBtnColor((CardView)findViewById(R.id.cv_record_patient_meal), isHaveMeal);
        // 특이사항
        boolean isRemark = remarks != null && remarks.size() > 0;
        changeBtnColor((CardView)findViewById(R.id.cv_record_remark), isRemark);
        // 사진
        boolean isPhoto = CameraActivity.photo.length > 0;
        changeBtnColor((CardView)findViewById(R.id.cv_record_photo), isPhoto);

        boolean status = isVital || isTakeMedicine || isHaveMeal || isRemark || isPhoto;

        saveBtn.setEnabled(status);
        if(status){
            saveBtn.setBackgroundColor(getColorId(R.color.colorPrimary));
        }else{
            saveBtn.setBackgroundColor(getColorId(R.color.dark_gray));
        }


    }
项目:odoo-work    文件:CardPagerAdapter.java   
@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = getView(container, position, getItem(position));
    container.addView(view);
    bind(mData.get(position), view);
    CardView cardView = (CardView) view.findViewById(R.id.cardView);
    mViews.set(position, cardView);
    return view;
}
项目:grblcontroller    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);

    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    if(getSupportActionBar() != null) getSupportActionBar().setSubtitle("Not connected");

    consoleLogger = ConsoleLoggerListner.getInstance();
    machineStatus = MachineStatusListner.getInstance();
    machineStatus.setJogging(sharedPref.getDouble(getString(R.string.jogging_step_size), 1.0), sharedPref.getDouble(getString(R.string.jogging_feed_rate), 2400.0), sharedPref.getBoolean(getString(R.string.jogging_in_inches), false));
    machineStatus.setVerboseOutput(sharedPref.getBoolean(getString(R.string.console_verbose_mode), false));

    binding.setMachineStatus(machineStatus);

    CardView viewLastToast = findViewById(R.id.view_last_toast);
    viewLastToast.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            if(lastToastMessage != null) grblToast(lastToastMessage);
            return true;
        }
    });

    Iconify.with(new FontAwesomeModule());
    this.setupTabLayout();

}
项目:OpenAPK    文件:AppAdapter.java   
public AppViewHolder(View view) {
    super(view);
    vCard = (CardView) view.findViewById(R.id.app_card);
    vName = (TextView) view.findViewById(R.id.txtName);
    vPackage = (TextView) view.findViewById(R.id.txtApk);
    vIcon = (ImageView) view.findViewById(R.id.imgIcon);

    vOpen = (Button) view.findViewById(R.id.btnOpen);
    vShare = (Button) view.findViewById(R.id.btnShare);
}
项目:Nearby    文件:RecordPatientMedicineListCustomAdapter.java   
public ViewHolder(View v) {
    super(v);
    cv = (CardView)v.findViewById(R.id.cv);
    setCardButtonOnTouchAnimation(cv);
    tv_title = (TextView)v.findViewById(R.id.tv_title);
    tv_period = (TextView)v.findViewById(R.id.tv_period);
    btn_medicine = (Button)v.findViewById(R.id.btn_medicine);
    btn_show_detail = (Button)v.findViewById(R.id.btn_show_detail);
}
项目:DiscogsBrowser    文件:CardListItemModel.java   
@Override
public void bind(CardView view)
{
    unbinder = ButterKnife.bind(this, view);
    lytListItemContainer.setOnClickListener(onClick);
    tvTitle.setText(title);
    tvSubtitle.setText(subtitle);
    Glide.with(context)
            .load(imageUrl)
            .placeholder(R.drawable.ic_vinyl)
            .crossFade()
            .into(ivImage);
}
项目:aos-Video    文件:VideoBadgePresenter.java   
public void setSource(Uri source){
    if(source.equals(mSelectedUri)){
        ((CardView)mRootView).setCardBackgroundColor(mBackgroundColor);
    }
    else ((CardView)mRootView).setCardBackgroundColor(ContextCompat.getColor(mContext, R.color.transparent_grey));

    if(Utils.isLocal(source)){
        mSourceTextView.setText("Local");
    }
    else {
        mSourceTextView.setText(source.getScheme());
    }

}
项目:Nibo    文件:NiboPlacesAutoCompleteSearchView.java   
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    final int count = getChildCount();
    int searchViewWidth = r - l;
    int searchViewHeight = b - t;
    int searchCardLeft;
    int searchCardTop;
    int searchCardRight;
    int searchCardBottom;
    int searchCardWidth;
    int searchCardHeight;
    for (int i = 0; i < count; i++) {
        View child = getChildAt(i);
        if (i == 0 && child instanceof CardView) {
            CardView searchCard = (CardView) child;
            int horizontalPadding = (int) Math.ceil(calculateHorizontalPadding(searchCard));
            int verticalPadding = (int) Math.ceil(calculateVerticalPadding(searchCard));
            searchCardLeft = mCardHorizontalPadding - horizontalPadding;
            searchCardTop = mCardVerticalPadding - verticalPadding;
            searchCardWidth = searchViewWidth - searchCardLeft * 2;
            searchCardHeight = child.getMeasuredHeight();
            searchCardRight = searchCardLeft + searchCardWidth;
            searchCardBottom = searchCardTop + searchCardHeight;
            child.layout(searchCardLeft, searchCardTop, searchCardRight, searchCardBottom);
        }
    }
}
项目:AURdroid    文件:AurPackageDetailsFragment.java   
private void setUpCommunity() {
    CardView cardView = rootView.findViewById(R.id.aur_package_details_community_card_view);
    cardView.setVisibility(View.VISIBLE);
    TextView votesTextView = rootView.findViewById(R.id.aur_package_details_votes_text_view);
    TextView popularityTextView = rootView.findViewById(R.id.aur_package_details_popularity_text_view);
    // votes
    if (responseAurInfoResult.numVotes != null) {
        votesTextView.setText(String.format(Locale.getDefault(), "%d", responseAurInfoResult.numVotes));
    }
    // popularity
    if (responseAurInfoResult.popularity != null) {
        popularityTextView.setText(String.format(Locale.getDefault(), "%f", responseAurInfoResult.popularity));
    }
}
项目:Croprotector    文件:DiseaseInfoAdapter.java   
public ViewHolder(View view){
    super(view);
    cardView=(CardView)view;
    time=(TextView)view.findViewById(R.id.disease_time);
    location=(TextView)view.findViewById(R.id.disease_gps);
    name=(TextView)view.findViewById(R.id.disease_name);
    disease_pic=(ImageView)view.findViewById(R.id.disease_image);

}
项目:Android-skin-support    文件:SkinCompatCardView.java   
public SkinCompatCardView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CardView, defStyleAttr,
            R.style.CardView);
    if (a.hasValue(R.styleable.CardView_cardBackgroundColor)) {
        mBackgroundColorResId = a.getResourceId(R.styleable.CardView_cardBackgroundColor, INVALID_ID);
    } else {
        final TypedArray aa = getContext().obtainStyledAttributes(COLOR_BACKGROUND_ATTR);
        mThemeColorBackgroundResId = aa.getResourceId(0, INVALID_ID);
        aa.recycle();
    }
    applyBackgroundColorResource();
}
项目:MovieApp    文件:KnownForAdapter.java   
public ViewHolder(CardView movieCard, ImageView moviePoster, TextView movieTitle,
                  TextView movieRating) {
    this.movieCard = movieCard;
    this.moviePoster = moviePoster;
    this.movieTitle = movieTitle;
    this.movieRating = movieRating;
}
项目:thesis-project    文件:ProjectAdapter.java   
ProjectViewHolder(View itemView) {
    super(itemView);
    textViewTitle = (EditText) itemView.findViewById(R.id.add_cardview_title);
    textViewDate = (TextView) itemView.findViewById(R.id.add_cardview_date);
    textViewTotal = (TextView) itemView.findViewById(R.id.add_cardview_total);
    cardView = (CardView) itemView.findViewById(R.id.add_cardview_cardview);

    btnSave = (Button) itemView.findViewById(R.id.add_cardview_save);
    btnCancel = (Button) itemView.findViewById(R.id.add_cardview_cancel);
    btnDelete = (Button) itemView.findViewById(R.id.add_cardview_delete);
    linearLayoutOption = (LinearLayout) itemView.findViewById(R.id.add_linearoption);
    btnOption = (ImageView) itemView.findViewById(R.id.add_option);
}
项目:furry-sniffle    文件:SearchableActivity.java   
public ViewHolder(CardView v) {
    super(v);
    cardview = v;
    mFirebaseDatabase = FirebaseDatabase.getInstance();
    mFirebaseAuth = FirebaseAuth.getInstance();
    mLikesDatabaseReference = mFirebaseDatabase.getReference().child("Likes");
    mLikesDatabaseReference.keepSynced(true);
}
项目:multi-library-bintray    文件:MainActivity.java   
private void populateViews() {
  CardView doraemonImage = findViewById(R.id.image_doraemon);
  CardView nobitaImage = findViewById(R.id.image_nobita);

  // Set images
  doraemonImage.setBackgroundResource(doraemon.getImage());
  nobitaImage.setBackgroundResource(nobita.getImage());
}
项目:furry-sniffle    文件:nearbyAreasActivity.java   
@Override
public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                               int viewType) {
    // create a new view
    CardView v = (CardView) LayoutInflater.from(parent.getContext())
            .inflate(R.layout.item_event, parent, false);
    // set the view's size, margins, paddings and layout parameters

    ViewHolder vh = new ViewHolder(v);
    return vh;
}
项目:cardslider-android    文件:CardsUpdater.java   
@Override
public void updateView(@NonNull View view, float position) {
    super.updateView(view, position);

    final CardView card = ((CardView)view);
    final View alphaView = card.getChildAt(1);
    final View imageView = card.getChildAt(0);

    if (position < 0) {
        final float alpha = ViewCompat.getAlpha(view);
        ViewCompat.setAlpha(view, 1f);
        ViewCompat.setAlpha(alphaView, 0.9f - alpha);
        ViewCompat.setAlpha(imageView, 0.3f + alpha);
    } else {
        ViewCompat.setAlpha(alphaView, 0f);
        ViewCompat.setAlpha(imageView, 1f);
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        final CardSliderLayoutManager lm =  getLayoutManager();
        final float ratio = (float) lm.getDecoratedLeft(view) / lm.getActiveCardLeft();

        final float z;

        if (position < 0) {
            z = Z_CENTER_1 * ratio;
        } else if (position < 0.5f) {
            z = Z_CENTER_1;
        } else if (position < 1f) {
            z = Z_CENTER_2;
        } else {
            z = Z_RIGHT;
        }

        card.setCardElevation(Math.max(0, z));
    }
}
项目:music_player    文件:FavouriteListAdapter.java   
public ViewHolder(View view) {
    super(view);
    cardView = (CardView) view;
    cover = (ImageView) view.findViewById(R.id.Favourite_list_cover);
    button = (ImageView) view.findViewById(R.id.Favourite_list_button);
    album = (TextView) view.findViewById(R.id.Favourite_list_album);
    singer = (TextView) view.findViewById(R.id.Favourite_list_singer);
}
项目:searchablespinner    文件:SearchableSpinner.java   
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mRevealContainerCardView = (CardView) findViewById(R.id.CrdVw_RevealContainer);
    mRevealContainerCardView.setOnClickListener(mOnRevelViewClickListener);
    mRevealItem = (LinearLayout) findViewById(R.id.FrmLt_SelectedItem);
    mStartSearchImageView = (IconTextView) findViewById(R.id.ImgVw_StartSearch);

    mContainerCardView = (CardView) findViewById(R.id.CrdVw_Container);
    mSearchEditText = (AppCompatEditText) findViewById(R.id.EdtTxt_SearchEditText);
    mDoneSearchImageView = (IconTextView) findViewById(R.id.ImgVw_DoneSearch);
    init();
}