com.squareup.picasso.Picasso Java Examples
The following examples show how to use
com.squareup.picasso.Picasso.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MyContactAdapter.java From Retrofit_Example_Part_1 with Apache License 2.0 | 6 votes |
@Override public View getView(int position, View convertView, ViewGroup parent) { final ViewHolder vh; if (convertView == null) { View view = mInflater.inflate(R.layout.layout_row_view, parent, false); vh = ViewHolder.create((RelativeLayout) view); view.setTag(vh); } else { vh = (ViewHolder) convertView.getTag(); } Contact item = getItem(position); vh.textViewName.setText(item.getName()); vh.textViewEmail.setText(item.getEmail()); Picasso.with(context).load(item.getProfilePic()).placeholder(R.mipmap.ic_launcher).error(R.mipmap.ic_launcher).into(vh.imageView); return vh.rootView; }
Example #2
Source File: UserProfileActivity.java From InstaMaterial with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_profile); this.avatarSize = getResources().getDimensionPixelSize(R.dimen.user_profile_avatar_size); this.profilePhoto = getString(R.string.user_profile_photo); Picasso.with(this) .load(profilePhoto) .placeholder(R.drawable.img_circle_placeholder) .resize(avatarSize, avatarSize) .centerCrop() .transform(new CircleTransformation()) .into(ivUserProfilePhoto); setupTabs(); setupUserProfileGrid(); setupRevealBackground(savedInstanceState); }
Example #3
Source File: InvitedDialogFragment.java From AndroidPlayground with MIT License | 6 votes |
private void setupView(View view) { mAvatar = findById(view, R.id.mFromAvatar); Picasso.with(getContext()).load(mFromUserAvatar).into(mAvatar); CountdownView countdownView = findById(view, R.id.mCountDownTimber); countdownView.start(INVITE_EXPIRE_MILLIS); countdownView.setOnCountdownEndListener(new CountdownView.OnCountdownEndListener() { @Override public void onEnd(CountdownView cv) { dismiss(); } }); ImageView deny = findById(view, R.id.mIvDeny); deny.setOnClickListener(this); ImageView accept = findById(view, R.id.mIvAccept); accept.setOnClickListener(this); }
Example #4
Source File: RecyclerAdapterScaleTeamsAutomatic.java From intra42 with Apache License 2.0 | 6 votes |
@Override public void onBindViewHolder(@NonNull final ViewHolderScaleTeam holder, int position) { TeamsUploads item = getItem(position); Picasso picasso = Picasso.get(); RequestCreator requestCreator; String url = UserImage.BASE_URL + "moulinette.jpg"; requestCreator = picasso.load(url).resize(200, 240); requestCreator.into(holder.imageViewUser); holder.textViewCorrector.setText(R.string.project_moulinette); holder.textViewScale.setText(String.valueOf(item.finalMark)); holder.textViewComment.setText(item.comment); holder.groupFeedback.setVisibility(View.GONE); holder.textViewUserFeedback.setVisibility(View.GONE); }
Example #5
Source File: ManageIgnoreListQuickActionsAdapter.java From PADListener with GNU General Public License v2.0 | 6 votes |
private void bindOneImage(int position, ImageView monsterImageView, Integer monsterId, boolean alreadyIgnored) { MyLog.entry("position = " + position); monsterImageView.clearColorFilter(); if (monsterId != null && mTaskFragment.getMonsterInfoHelper() != null) { monsterImageView.setVisibility(View.VISIBLE); try { final MonsterInfoModel monsterInfo = mTaskFragment.getMonsterInfoHelper().getMonsterInfo(monsterId); mImageHelper.fillImage(monsterImageView, monsterInfo); if (!alreadyIgnored) { monsterImageView.setColorFilter(Color.parseColor("#99000000"), PorterDuff.Mode.DARKEN); } } catch (UnknownMonsterException e) { Picasso.with(getContext()) .load(R.drawable.no_monster_image) .into(monsterImageView); } } else { MyLog.debug("no monster at " + position + ", ignored"); monsterImageView.setVisibility(View.INVISIBLE); } MyLog.exit(); }
Example #6
Source File: FantasyFragment.java From catnut with MIT License | 6 votes |
@Override public void onViewCreated(View view, Bundle savedInstanceState) { boolean fitXY = getArguments().getBoolean(FIT_XY); if (getActivity() instanceof HelloActivity) { if (!((HelloActivity) getActivity()).isNetworkAvailable()) { if (fitXY) { Toast.makeText(getActivity(), R.string.network_unavailable, Toast.LENGTH_SHORT).show(); mFantasy.setImageResource(R.drawable.default_fantasy); return; // 没有网络,直接结束第一张fantasy } } } RequestCreator creator = Picasso.with(getActivity()).load(mUrl); if (fitXY) { creator.placeholder(R.drawable.default_fantasy); } creator.error(R.drawable.error) .into(target); }
Example #7
Source File: ContactEditText.java From material with Apache License 2.0 | 6 votes |
@Override public View getView(int position, View convertView, ViewGroup parent) { ContactView v = (ContactView)convertView; if (v == null) v = new ContactView(getContext(), null, 0, R.style.ContactView); Recipient recipient = (Recipient) getItem(position); v.setNameText(recipient.name); v.setAddressText(recipient.number); if(TextUtils.isEmpty(recipient.lookupKey)) v.setAvatarResource(mDefaultAvatarId); else Picasso.with(getContext()) .load(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, recipient.lookupKey)) .placeholder(mDefaultAvatarId) .into(v); return v; }
Example #8
Source File: OtherAdapter.java From MaterialWpp with Apache License 2.0 | 6 votes |
@Override public void onBindViewHolder(final MyHolder holder, final int position) { Picasso.with(holder.itemView.getContext()).load(datums.get(position).getSmallImgUrl()) .noPlaceholder() .into(holder.imageView); holder.title.setText(datums.get(position).getLikesCount()); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(holder.itemView.getContext(), DetailActivity.class); intent.putExtra("id",pid); intent.putExtra("index",position); intent.putExtra("sourcetype",3); intent.putExtra("order","1"); intent.putExtra("update",0); holder.itemView.getContext().startActivity(intent); } }); }
Example #9
Source File: PostAdapter.java From Ruisi with Apache License 2.0 | 6 votes |
@Override void setData(int position) { final SingleArticleData single = datalist.get(position); title.setText(single.title); userName.setText(single.username); String imgUrl = UrlUtils.getAvaterurlm(single.getImg()); if (single.uid > 0) { Picasso.get() .load(imgUrl) .resize(size, size) .placeholder(R.drawable.image_placeholder) .error(R.drawable.image_placeholder) .into(userAvatar); } else { Picasso.get() .load(R.drawable.image_placeholder) .resize(size, size) .into(userAvatar); } String postTime = "发表于:" + single.postTime; this.postTime.setText(postTime); HtmlView.parseHtml(single.content).into(content); }
Example #10
Source File: AppContext.java From monolog-android with MIT License | 6 votes |
public void loadImg(ImageView v, String url, int width) { String absoluteUrl = url; try { Picasso.with(this) .load(absoluteUrl) .placeholder(R.drawable.img_bg) .error(R.drawable.ic_action_picture) .transform(new CropSquareTransformation()) .resize(width, width) .into(v); } catch (Exception ex) { Picasso.with(this) .load(R.drawable.img_bg) .transform(new CropSquareTransformation()) .into(v); } }
Example #11
Source File: ArtistView.java From Cheerleader with Apache License 2.0 | 6 votes |
/** * Set the {@link SoundCloudUser} used as model. * * @param artist user used as artist. */ public void setModel(SoundCloudUser artist) { mModel = artist; if (mModel != null) { Picasso.with(getContext()) .load( SoundCloudArtworkHelper.getCoverUrl( mModel, SoundCloudArtworkHelper.XLARGE ) ) .fit() .centerInside() .into(mAvatar); mArtistName.setText(mModel.getFullName()); mTracks.setText( String.format( getResources().getString(R.string.artist_view_track_count), mModel.getTrackCount() ) ); mDescription.setText(Html.fromHtml(mModel.getDescription())); this.setVisibility(VISIBLE); } }
Example #12
Source File: VideoDetailsFragment.java From android-tv-leanback with Apache License 2.0 | 6 votes |
@Override protected DetailsOverviewRow doInBackground(Video... videos) { DetailsOverviewRow row = new DetailsOverviewRow(videos[0]); try { Bitmap poster = Picasso.with(getActivity()) .load(videos[0].getThumbUrl()) .resize(dpToPx(DETAIL_THUMB_WIDTH, getActivity().getApplicationContext()), dpToPx(DETAIL_THUMB_HEIGHT, getActivity().getApplicationContext())) .centerCrop() .get(); row.setImageBitmap(getActivity(), poster); } catch (IOException e) { Log.e("VideoDetailsFragment", "Cannot load thumbnail for " + videos[0].getId(), e); } SparseArrayObjectAdapter adapter = new SparseArrayObjectAdapter(); adapter.set(ACTION_PLAY, new Action(ACTION_PLAY, getResources().getString( R.string.action_play))); adapter.set(ACTION_WATCH_LATER, new Action(ACTION_WATCH_LATER, getResources().getString(R.string.action_watch_later))); row.setActionsAdapter(adapter); return row; }
Example #13
Source File: PicassoDataRequestHandler.java From android with MIT License | 6 votes |
@Override public Result load(Request request, int networkPolicy) { String uri = request.uri.toString(); String imageDataBytes = uri.substring(uri.indexOf(",") + 1); byte[] bytes = Base64.decode(imageDataBytes.getBytes(), Base64.DEFAULT); Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); if (bitmap == null) { String show = uri.length() > 50 ? uri.substring(0, 49) + "..." : uri; RuntimeException malformed = new RuntimeException("Malformed data uri: " + show); Log.e("Could not load image", malformed); throw malformed; } return new Result(bitmap, Picasso.LoadedFrom.NETWORK); }
Example #14
Source File: InvitingDialogViewHolder.java From AndroidPlayground with MIT License | 5 votes |
public void setupView() { mRootView.setVisibility(View.VISIBLE); mAvatar = findById(mRootView, R.id.mToAvatar); Picasso.with(mContext).load(mToUserAvatar).into(mAvatar); CountdownView countdownView = findById(mRootView, R.id.mCountDownTimber); countdownView.start(INVITE_EXPIRE_MILLIS); countdownView.setOnCountdownEndListener(new CountdownView.OnCountdownEndListener() { @Override public void onEnd(CountdownView cv) { if (mController != null) { mController.denied(); } } }); TextView tvToUsername = findById(mRootView, R.id.mTvToUsername); tvToUsername.setText(mToUsername); // TODO simulate accepted tvToUsername.postDelayed(new Runnable() { @Override public void run() { if (mController != null) { mController.accepted(mFromUserAvatar, mFromUsername, mToUserAvatar, mToUsername, mToUid); } } }, 5000); }
Example #15
Source File: CustomRecyclerViewAdapter.java From FeaturedRecyclerView with Apache License 2.0 | 5 votes |
@Override public void onBindFeaturedViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof FeaturedViewHolder) { FeaturedViewHolder featuredViewHolder = (FeaturedViewHolder) holder; Picasso.with(holder.itemView.getContext()).load(images[position % 4]).into(featuredViewHolder.ivBackground); featuredViewHolder.tvHeading.setText(data.get(position)); } else if (holder instanceof DummyViewHolder) { //Do nothing } }
Example #16
Source File: MainActivity.java From ExoPlayer-Wrapper with Apache License 2.0 | 5 votes |
/** * ExoPlayerListener */ @Override public void onThumbImageViewReady(ImageView imageView) { Picasso.get() .load(THUMB_IMG_URL) //.fit() .placeholder(R.drawable.place_holder) .error(R.drawable.error_image) .into(imageView); }
Example #17
Source File: VideoListAdapter.java From android-player-samples with Apache License 2.0 | 5 votes |
@Override public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") final int position) { final Video video = videoList.get(position); holder.videoTitleText.setText(video.getName()); Object descriptionObj = video.getProperties().get(PROPS_SHORT_DESCRIPTION); if (descriptionObj instanceof String) { holder.videoDescriptionText.setText((String) descriptionObj); } int duration = video.getDuration(); if (duration > 0) { holder.videoDurationText.setText(millisecondsToString(duration)); holder.videoDurationText.setVisibility(View.VISIBLE); } else { holder.videoDurationText.setText(null); holder.videoDurationText.setVisibility(View.GONE); } URI imageUri = video.getStillImageUri(); if (imageUri == null) { holder.videoThumbnailImage.setImageResource(R.drawable.movie); } else { Picasso.get().load(imageUri.toASCIIString()).into(holder.videoThumbnailImage); } holder.videoThumbnailImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { clickListener.itemClicked(view, video, position); } }); }
Example #18
Source File: MovieDetailsFragment.java From UpcomingMoviesMVP with Apache License 2.0 | 5 votes |
@Override public void renderMovie(MovieDetails movieDetails) { Picasso.with(getActivity().getApplicationContext()) .load(getImageUrl(movieDetails.getMovie().getBackdropImage())) .into(ivBackDrop); tvTitle.setText(movieDetails.getMovie().getTitle()); tvGenres.setText(new GenresFormatter().format(movieDetails.getGenres())); tvDescription.setText(movieDetails.getMovie().getOverview()); }
Example #19
Source File: ClipRecyclerViewAdapter.java From arcusandroid with Apache License 2.0 | 5 votes |
public void bind(ClipModel clipModel) { long currentMilliseconds = System.currentTimeMillis(); long expirationMilliseconds = clipModel.getDeleteTime().getTime(); long millisToExpiry = Math.max(0, expirationMilliseconds - currentMilliseconds); Picasso.with(itemView.getContext()).load(clipModel.getCachedClipFile()).fit().into(imageView); trashImage.setVisibility(View.VISIBLE); downloadImage.setVisibility(View.VISIBLE); String unknownValue = ArcusApplication.getContext().getString(R.string.camera_duration_size_unknown); if (unknownValue.equals(clipModel.getDurationString()) && unknownValue.equals(clipModel.getSizeString())) { durationAndSize.setText(ArcusApplication.getContext().getString(R.string.camera_recording_in_progress)); trashImage.setVisibility(View.INVISIBLE); downloadImage.setVisibility(View.INVISIBLE); } else { durationAndSize.setText(String.format("%s", clipModel.getDurationString())); } if(clipModel.getCameraName().isEmpty()){ cameraName.setVisibility(View.GONE); } else { cameraName.setVisibility(View.VISIBLE); cameraName.setText(clipModel.getCameraName()); } timeRecorded.setText(clipModel.getTimeString()); if (clipModel.isDownloadDeleteAvailable()) { trashImage.setEnabled(true); trashImage.setAlpha(1f); downloadImage.setEnabled(true); downloadImage.setAlpha(1f); } else { trashImage.setEnabled(false); trashImage.setAlpha(.4f); downloadImage.setEnabled(false); downloadImage.setAlpha(.4f); } setPins(clipModel, millisToExpiry); }
Example #20
Source File: MainModelAdapter.java From RxAndroidBootstrap with Apache License 2.0 | 5 votes |
@Override public void onBindViewHolder(MainModelViewHolder holder, int position) { MainListViewModel model = models.get(position); holder.titleTextView.setText(model.getTitle()); Picasso.with(holder.view.getContext()).load(model.getImageUrl()).into(holder.imageView); }
Example #21
Source File: TweetMediaView.java From twitter-kit-android with Apache License 2.0 | 5 votes |
void setMediaImage(ImageView imageView, String imagePath) { final Picasso imageLoader = dependencyProvider.getImageLoader(); if (imageLoader == null) return; imageLoader.load(imagePath) .fit() .centerCrop() .error(photoErrorResId) .into(imageView, new PicassoCallback(imageView)); }
Example #22
Source File: PostAdapter.java From Ruisi with Apache License 2.0 | 5 votes |
@Override void setData(int position) { final SingleArticleData single = datalist.get(position); username.setText(single.username); //判断是不是楼主 boolean isLz = datalist.get(position).username.equals(datalist.get(0).username); labelLz.setVisibility(isLz ? View.VISIBLE : View.GONE); boolean isReply = single.replyUrlTitle.contains("action=reply"); btnReplyCz.setVisibility(isReply ? View.VISIBLE : View.GONE); String imgUrl = UrlUtils.getAvaterurlm(single.getImg()); if (single.uid > 0) { Picasso.get() .load(imgUrl) .resize(size, size) .placeholder(R.drawable.image_placeholder) .error(R.drawable.image_placeholder) .into(avatar); } else { Picasso.get() .load(R.drawable.image_placeholder) .resize(size, size) .into(avatar); } replyTime.setText(single.postTime); index.setText(single.index); HtmlView.parseHtml(single.content).into(comment); }
Example #23
Source File: DriverHome.java From UberClone with MIT License | 5 votes |
public void initDrawer(){ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.addDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); View navigationHeaderView=navigationView.getHeaderView(0); TextView tvName=(TextView)navigationHeaderView.findViewById(R.id.tvDriverName); TextView tvStars=(TextView)navigationHeaderView.findViewById(R.id.tvStars); CircleImageView imageAvatar=(CircleImageView) navigationHeaderView.findViewById(R.id.imageAvatar); tvName.setText(Common.currentUser.getName()); if(Common.currentUser.getRates()!=null && !TextUtils.isEmpty(Common.currentUser.getRates())) tvStars.setText(Common.currentUser.getRates()); if(isLoggedInFacebook) Picasso.get().load("https://graph.facebook.com/" + Common.userID + "/picture?width=500&height=500").into(imageAvatar); else if(account!=null) Picasso.get().load(account.getPhotoUrl()).into(imageAvatar); if(Common.currentUser.getAvatarUrl()!=null && !TextUtils.isEmpty(Common.currentUser.getAvatarUrl())) Picasso.get().load(Common.currentUser.getAvatarUrl()).into(imageAvatar); }
Example #24
Source File: PhotoActivity.java From STUer-client with MIT License | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_photo); ButterKnife.inject(this); final String picName = getIntent().getStringExtra("picName"); RequestCreator requestCreator = Picasso.with(this) .load(IMAGE_HOST + picName + ".jpg"); requestCreator.into(mImageView); requestCreator.fetch(new Callback() { @Override public void onSuccess() { // 一开始为wrap_content使其居中,成功加载后match_parent使其放缩效果更佳 mImageView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT)); } @Override public void onError() { Toast.makeText(PhotoActivity.this, "加载图片失败", Toast.LENGTH_SHORT).show(); } }); mAttacher = new PhotoViewAttacher(mImageView); mAttacher.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(PhotoActivity.this); builder.setItems(new String[]{"保存"}, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { savePhoto(picName); } }); builder.create().show(); return false; } }); }
Example #25
Source File: ImageGridAdapter.java From UltimateAndroid with Apache License 2.0 | 5 votes |
void bindData(final Image data){ if(data == null) return; // 处理单选和多选状态 if(showSelectIndicator){ indicator.setVisibility(View.VISIBLE); if(mSelectedImages.contains(data)){ // 设置选中状态 indicator.setImageResource(R.drawable.multi_image_select_btn_selected); }else{ // 未选择 indicator.setImageResource(R.drawable.multi_image_select_btn_unselected); } }else{ indicator.setVisibility(View.GONE); } File imageFile = new File(data.path); if(mItemSize > 0) { // 显示图片 Picasso.with(mContext) .load(imageFile) .placeholder(R.drawable.multi_image_select_default_error) //.error(R.drawable.default_error) .resize(mItemSize, mItemSize) .centerCrop() .into(image); } }
Example #26
Source File: PoiListAdapter.java From wikijourney_app with Apache License 2.0 | 5 votes |
private void displayArticleImage(ViewHolder holder, String mPoiImageUrl) { Picasso.with(context).load(mPoiImageUrl) .placeholder(R.drawable.logo_cut) .fit() .centerCrop() .into(holder.mPoiPicture); }
Example #27
Source File: ApplicationModule.java From FriendlyDemo with Apache License 2.0 | 5 votes |
@Provides @NonNull @Singleton public Picasso providePicasso(@NonNull Application boxBeeApplication, @NonNull OkHttpClient okHttpClient) { return new Picasso.Builder(boxBeeApplication) .downloader(new OkHttp3Downloader(okHttpClient)) .build(); }
Example #28
Source File: UserShareAdapter.java From school_shop with MIT License | 5 votes |
@Override public void onBindViewHolder(ViewHolder holder, int position) { ShareEntity shareEntity = list.get(position); holder.price.setText("¥"+shareEntity.getGoodsPrice()); holder.title.setText(shareEntity.getTitle()); holder.desp.setText(shareEntity.getShareReason()); if(shareEntity.getImgUrl()!=null){ String imgUrls[] = shareEntity.getImgUrl().split(";"); Picasso picasso = Picasso.with(holder.imageView.getContext()); picasso.load(imgUrls[0]).placeholder(R.drawable.ic_img_loading).into(holder.imageView); } holder.itemView.setTag(shareEntity); }
Example #29
Source File: TVGridFragment.java From BuildingForAndroidTV with MIT License | 5 votes |
protected void updateBackground(URI uri) { Picasso.with(getActivity()) .load(uri.toString()) .resize(mMetrics.widthPixels, mMetrics.heightPixels) .centerInside() .error(mDefaultBackground) .into(mBackgroundTarget); }
Example #30
Source File: CardPresenter.java From Amphitheatre with Apache License 2.0 | 5 votes |
@Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { Drawable bitmapDrawable = new BitmapDrawable(mCardView.getContext().getResources(), bitmap); mCardView.setMainImage(bitmapDrawable); Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() { @Override public void onGenerated(Palette palette) { if (Enums.PalettePresenterType.valueOf(mSharedPrefs.getString(Constants.PALETTE_BACKGROUND_VISIBLE, "")) == Enums.PalettePresenterType.ALLCARDS) { Utils.animateColorChange( mCardView.findViewById(R.id.info_field), mCardView.getContext().getResources().getColor(R.color.lb_basic_card_info_bg_color), Utils.getPaletteColor( palette, mSharedPrefs.getString(Constants.PALETTE_BACKGROUND_UNSELECTED, ""), mCardView.getContext().getResources().getColor(R.color.lb_basic_card_info_bg_color)) ); } if (Enums.PalettePresenterType.valueOf(mSharedPrefs.getString(Constants.PALETTE_TITLE_VISIBLE, "")) == Enums.PalettePresenterType.ALLCARDS) { ((TextView)mCardView.findViewById(R.id.title_text)).setTextColor( Utils.getPaletteColor( palette, mSharedPrefs.getString(Constants.PALETTE_TITLE_UNSELECTED, ""), mCardView.getContext().getResources().getColor(R.color.lb_basic_card_title_text_color)) ); } if (Enums.PalettePresenterType.valueOf(mSharedPrefs.getString(Constants.PALETTE_CONTENT_VISIBLE, "")) == Enums.PalettePresenterType.ALLCARDS) { ((TextView)mCardView.findViewById(R.id.content_text)).setTextColor( Utils.getPaletteColor( palette, mSharedPrefs.getString(Constants.PALETTE_CONTENT_UNSELECTED, ""), mCardView.getContext().getResources().getColor(R.color.lb_basic_card_content_text_color)) ); } } }); }