List of usage examples for android.support.v4.content.res ResourcesCompat getDrawable
public static Drawable getDrawable(Resources resources, int i, Theme theme) throws NotFoundException
From source file:com.nttec.everychan.chans.chan10.Chan10Module.java
@Override public Drawable getChanFavicon() { return ResourcesCompat.getDrawable(resources, R.drawable.favicon_10ch, null); }
From source file:nya.miku.wishmaster.chans.brchan.BrchanModule.java
@Override public Drawable getChanFavicon() { return ResourcesCompat.getDrawable(resources, R.drawable.favicon_brchan, null); }
From source file:com.nttec.everychan.chans.nullchan.Null_chanModule.java
@Override public Drawable getChanFavicon() { return ResourcesCompat.getDrawable(resources, R.drawable.favicon_0chan_1, null); }
From source file:nya.miku.wishmaster.chans.lampach.LampachModule.java
@Override public Drawable getChanFavicon() { return ResourcesCompat.getDrawable(resources, R.drawable.favicon_lampach, null); }
From source file:com.nttec.everychan.chans.dfwk.DFWKModule.java
@Override public Drawable getChanFavicon() { return ResourcesCompat.getDrawable(resources, R.drawable.favicon_dfwk, null); }
From source file:com.kyleszombathy.sms_scheduler.RecyclerAdapter.java
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.nameHeader.setText(messages.getNameDataset().get(position)); holder.messageContentHeader.setText(messages.getContentDataset().get(position)); ReadableDateCountdownTimer countdownTimer = new ReadableDateCountdownTimer( messages.getDateDataset().get(position), holder); countdownTimer.start();//from www .j ava 2s . c o m // Set image if (messages.get(position).getNameList().size() > 1) { Drawable groupDrawable = ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_group_white_24dp, null); setMBadgeWithDrawable(holder.mBadge, groupDrawable); } else if (messages.getPhotoDataset().get(position) != null) { holder.mBadge.setImageBitmap(messages.getPhotoDataset().get(position)); } else { Drawable singleDrawable = ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_person_white_24dp, null); setMBadgeWithDrawable(holder.mBadge, singleDrawable); } holder.getSwipableView().bringToFront(); holder.getSwipableView().setX(0); holder.getSwipableView().setY(0); }
From source file:com.nagopy.android.mypkgs.model.loader.ApplicationIconLoader.java
private synchronized static Drawable getDefaultIcon(Context context) { if (defaultIcon == null) { defaultIcon = ResourcesCompat.getDrawable(context.getResources(), android.R.drawable.sym_def_app_icon, null);// ww w .ja v a 2 s .c o m } return defaultIcon; }
From source file:com.nadmm.airports.utils.UiUtils.java
static public void setTextViewDrawable(TextView tv, int resid) { String key = String.format(Locale.US, "%d", resid); Drawable d = getDrawableFromCache(key); if (d == null) { Resources res = tv.getResources(); d = ResourcesCompat.getDrawable(res, resid, null); putDrawableIntoCache(key, d);/*from ww w . ja v a2s .c om*/ } setTextViewDrawable(tv, d.mutate()); }
From source file:com.peprally.jeremy.peprally.services.PepRallyFirebaseMessagingService.java
/** * Create and show a simple notification containing the received FCM message. * * @param jsonData FCM json data received. *///w w w .j av a 2s .c om private void sendNotification(Map<String, String> jsonData) { Intent intent = new Intent(this, LoginActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); String contentText; switch (Integer.parseInt(jsonData.get("notification_type"))) { case 0: // direct fistbump contentText = getResources().getString(R.string.notification_0_placeholder); break; case 1: // commented on post contentText = getResources().getString(R.string.notification_1_placeholder); String comment = jsonData.get("comment_text"); if (comment.length() > 50) comment = comment.substring(0, 50) + "...\""; else comment = comment + "\""; contentText = contentText + comment; break; case 2: // fistbumped post contentText = getResources().getString(R.string.notification_2_placeholder); break; case 3: // fistbumped comment contentText = getResources().getString(R.string.notification_3_placeholder); break; default: //TODO: better error handling on invalid notification type contentText = ""; break; } Drawable notificationDrawable = ResourcesCompat.getDrawable(getResources(), R.drawable.logo_push_ut, null); if (notificationDrawable != null) { Notification.Builder notificationBuilder = new Notification.Builder(this) .setLargeIcon(((BitmapDrawable) notificationDrawable).getBitmap()) .setSmallIcon(R.drawable.logo_push).setContentTitle("PepRally") .setContentText(jsonData.get("sender_nickname") + " " + contentText).setAutoCancel(true) .setSound(defaultSoundUri).setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService( Context.NOTIFICATION_SERVICE); notificationManager.notify(Helpers.generateRandomInteger(), notificationBuilder.build()); Log.d(TAG, "NOTIFICATION RECEIVED"); } }
From source file:org.getlantern.firetweet.util.ImageLoadingHandler.java
@Override public void onLoadingFailed(final String imageUri, final View view, final FailReason reason) { if (view == null) return;// w ww. j a v a2 s . c o m if (view instanceof ForegroundImageView) { ((ImageView) view).setImageDrawable(null); final Drawable foreground = ResourcesCompat.getDrawable(view.getResources(), R.drawable.image_preview_refresh, null); ((ForegroundImageView) view).setForeground(foreground); } mLoadingUris.remove(view); final ProgressBar progress = findProgressBar(view.getParent()); if (progress != null) { progress.setVisibility(View.GONE); } }