@Override protected boolean onLevelChange(int level) { return mDrawable != null && mDrawable.setLevel(level); }
@Override protected boolean onLevelChange(int level) { return mDrawable.setLevel(level); }
@Override protected boolean onLevelChange(int level) { return mDrawable.setLevel(level); }
@Override protected boolean onLevelChange(int level) { return mDrawable != null && mDrawable.setLevel(level); }
protected boolean onLevelChange(int level) { return this.mDrawable.setLevel(level); }
Resources res = getResources(); ScaleDrawable sd = (ScaleDrawable) res.getDrawable(R.drawable.logo2); Drawable d = sd.getDrawable(); d.setLevel(1); ImageView iv = new ImageView(this); iv.setImageDrawable(sd); iv.setAdjustViewBounds(true); iv.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); setContentView(iv);
@Override protected boolean onLevelChange(int level) { boolean changed = false; final ChildDrawable[] array = mLayerState.mChildren; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { final Drawable dr = array[i].mDrawable; if (dr != null && dr.setLevel(level)) { refreshChildPadding(i, array[i]); changed = true; } } if (changed) { updateLayerBounds(getBounds()); } return changed; }
void fixIconImage(Resources resources, RemoteViews remoteViews, boolean hasIconBitmap, Notification notification) { if (remoteViews == null || notification.icon == 0) return; if (!mNotificationCompat.isSystemLayout(remoteViews)) { return; } try { //noinspection deprecation int id = R_Hide.id.icon.get(); //only fake small icon if (!hasIconBitmap && notification.largeIcon == null) { Drawable drawable = resources.getDrawable(notification.icon); drawable.setLevel(notification.iconLevel); Bitmap bitmap = drawableToBitMap(drawable); remoteViews.setImageViewBitmap(id, bitmap); //emui if(OSUtils.getInstance().isEmui()) { if (notification.largeIcon == null) { notification.largeIcon = bitmap; } } } } catch (Exception e) { e.printStackTrace(); } }
clone.setLayoutDirection(dr.getLayoutDirection()); clone.setBounds(dr.getBounds()); clone.setLevel(dr.getLevel()); } else { clone = null;
//progress is between 0 and 100 so set level of drawable to progress * 100 Drawable batteryProgressD = batteryProgressBar.getProgressDrawable(); batteryProgressD.setLevel(progress*100); batteryProgressBar.setProgress(progress);
d.setVisible(getWindowVisibility() == VISIBLE && isShown(), true); d.setLevel(mLevel); mDrawableWidth = d.getIntrinsicWidth(); mDrawableHeight = d.getIntrinsicHeight();
d.setVisible(visible, true); d.setLevel(mLevel); mDrawableWidth = d.getIntrinsicWidth(); mDrawableHeight = d.getIntrinsicHeight();
d.setDither(mDrawableContainerState.mDither); d.setState(getState()); d.setLevel(getLevel()); d.setBounds(getBounds()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Drawable d = getDrawable(); if (d != null) { // Translate canvas so a indeterminate circular progress bar with // padding rotates properly in its animation canvas.save(); canvas.translate(getPaddingLeft(), getPaddingTop()); long time = getDrawingTime(); // I'm not sure about the +1. float prog = (float)(time % ANIM_PERIOD+1) / (float)ANIM_PERIOD; int level = (int)(MAX_LEVEL * prog); d.setLevel(level); d.draw(canvas); canvas.restore(); ViewCompat.postInvalidateOnAnimation(this); }
@Override public void set(Drawable object, Integer value) { object.setLevel(value); } };
public void applyState() { if (mCenterDrawable != null) { mCenterDrawable.setLevel(Math.max(mInfo.installProgress, 0)); } }
/** * If one the drawable layers of the wrapped drawable is {@link android.R.id#progress} this will * update its current level to the specified one. * * @param level The level to be set to the progress layer (if presented). * @return {@code True} if the given level has been set and it actually changed to the current * level of the progress layer, {@code false} otherwise. */ private boolean updateProgressDrawableLevel(int level) { final Drawable progressDrawable = ((LayerDrawable) mDrawable).findDrawableByLayerId(android.R.id.progress); return progressDrawable != null && progressDrawable.setLevel(level); }
@Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { view = mInflater.inflate(R.layout.app_file_browser_item, parent, false); } final TextView item = (TextView) view; item.setText(mResources.getStringArray(R.array.dfu_app_file_browser)[position]); item.getCompoundDrawablesRelative()[0].setLevel(position); return view; } }
private static void copyProperties(Drawable to, Drawable from) { if (from == null || to == null || to == from) { return; } to.setBounds(from.getBounds()); to.setChangingConfigurations(from.getChangingConfigurations()); to.setLevel(from.getLevel()); to.setVisible(from.isVisible(), false); to.setState(from.getState()); }