java类android.widget.ImageView.ScaleType的实例源码

PhotoViewAttacher.java 文件源码 项目:GCSApp 阅读 19 收藏 0 点赞 0 评论 0
private void checkImageViewScaleType() {
    ImageView imageView = getImageView();

    /**
     * PhotoView's getScaleType() will just divert to this.getScaleType() so
     * only call if we're not attached to a PhotoView.
     */
    if (null != imageView && !(imageView instanceof PhotoView)) {
        if (imageView.getScaleType() != ScaleType.MATRIX) {
            throw new IllegalStateException(
                    "The ImageView's ScaleType has been changed since attaching a PhotoViewAttacher");
        }
    }
}
WXImage.java 文件源码 项目:weex-3d-map 阅读 23 收藏 0 点赞 0 评论 0
private ScaleType getResizeMode(String resizeMode) {
    ScaleType scaleType = ScaleType.FIT_XY;
    if (TextUtils.isEmpty(resizeMode)) {
        return scaleType;
    }

    if (resizeMode.equals("cover")) {
        scaleType = ScaleType.CENTER_CROP;
    } else if (resizeMode.equals("contain")) {
        scaleType = ScaleType.FIT_CENTER;
    } else if (resizeMode.equals("stretch")) {
        scaleType = ScaleType.FIT_XY;
    } else if (resizeMode.equals("center")) {
        scaleType = ScaleType.CENTER;
    } else if (resizeMode.equals("start")) {
        scaleType = ScaleType.MATRIX;
    } else if (resizeMode.equals("end")) {
        scaleType = ScaleType.FIT_END;
    }
    return scaleType;
}
Shake2Share.java 文件源码 项目:Huochexing12306 阅读 22 收藏 0 点赞 0 评论 0
public void onCreate() {
    startSensor();

    int resId = getBitmapRes(activity, "ssdk_oks_yaoyiyao");
    if (resId > 0) {
        ImageView iv = new ImageView(activity);
        iv.setScaleType(ScaleType.CENTER_INSIDE);
        iv.setImageResource(resId);
        activity.setContentView(iv);
    }

    resId = getStringRes(activity, "shake2share");
    if (resId > 0) {
        Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
    }
}
RotateLoadingLayout.java 文件源码 项目:sctalk 阅读 31 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
PhotoViewAttacher.java 文件源码 项目:GitHub 阅读 32 收藏 0 点赞 0 评论 0
/**
 * Set's the ImageView's ScaleType to Matrix.
 */
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
    if (null != imageView) {
        if (imageView instanceof PhotoView) {
            /**
             * PhotoView sets it's own ScaleType to Matrix, then diverts all
             * calls setScaleType to this.setScaleType. Basically we don't
             * need to do anything here
             */
            imageView.setScaleType(ScaleType.CENTER);
        } else {
            imageView.setScaleType(ScaleType.MATRIX);
        }
    }
}
GoodsPostsFragment.java 文件源码 项目:boohee_v5.6 阅读 21 收藏 0 点赞 0 评论 0
protected void addListener() {
    this.mHeaderView = new ImageView(getActivity());
    this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
    this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
    ((ListView) this.mPullRefreshListView.getRefreshableView()).addHeaderView(this.mHeaderView);
    this.mAdapter = new HomeTimelineAdapter(getActivity(), this.mPosts);
    this.mPullRefreshListView.setAdapter(this.mAdapter);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            GoodsPostsFragment.this.getCurrentTopic();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!GoodsPostsFragment.this.isLastVisible) {
                GoodsPostsFragment.this.getNextTopic();
            }
        }
    });
}
PhotoViewAttacher.java 文件源码 项目:encdroidMC 阅读 19 收藏 0 点赞 0 评论 0
private void checkImageViewScaleType() {
    ImageView imageView = getImageView();

    /**
     * PhotoView's getScaleType() will just divert to this.getScaleType() so
     * only call if we're not attached to a PhotoView.
     */
    if (null != imageView && !(imageView instanceof PhotoView)) {
        if (imageView.getScaleType() != ScaleType.MATRIX) {
            throw new IllegalStateException(
                    "The ImageView's ScaleType has been changed since attaching a PhotoViewAttacher");
        }
    }
}
a.java 文件源码 项目:boohee_v5.6 阅读 22 收藏 0 点赞 0 评论 0
protected final void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    Context context = getContext();
    View linearLayout = new LinearLayout(context);
    LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
    layoutParams.gravity = 17;
    linearLayout.setOrientation(0);
    linearLayout.setLayoutParams(layoutParams);
    Drawable gradientDrawable = new GradientDrawable();
    gradientDrawable.setColor(-450944201);
    gradientDrawable.setCornerRadius((float) a(context, 5.0f));
    linearLayout.setBackgroundDrawable(gradientDrawable);
    View imageView = new ImageView(context);
    layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
    layoutParams.gravity = 16;
    layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ScaleType.FIT_CENTER);
    imageView.setImageDrawable(a(context, a.d));
    Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
    rotateAnimation.setRepeatCount(-1);
    rotateAnimation.setDuration(900);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    imageView.startAnimation(rotateAnimation);
    View textView = new TextView(context);
    textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
    textView.setTextSize(16.0f);
    textView.setTextColor(-1);
    layoutParams = new LinearLayout.LayoutParams(-2, -2);
    layoutParams.gravity = 16;
    layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
    textView.setLayoutParams(layoutParams);
    linearLayout.addView(imageView);
    linearLayout.addView(textView);
    setContentView(linearLayout);
    setCancelable(false);
}
ImageLoader.java 文件源码 项目:boohee_v5.6 阅读 21 收藏 0 点赞 0 评论 0
public ImageContainer get(String requestUrl, ImageListener imageListener, int maxWidth, int maxHeight, ScaleType scaleType) {
    throwIfNotOnMainThread();
    String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
    Bitmap cachedBitmap = this.mCache.getBitmap(cacheKey);
    if (cachedBitmap != null) {
        ImageContainer container = new ImageContainer(cachedBitmap, requestUrl, null, null);
        imageListener.onResponse(container, true);
        return container;
    }
    ImageContainer imageContainer = new ImageContainer(null, requestUrl, cacheKey, imageListener);
    imageListener.onResponse(imageContainer, true);
    BatchedImageRequest request = (BatchedImageRequest) this.mInFlightRequests.get(cacheKey);
    if (request != null) {
        request.addContainer(imageContainer);
        return imageContainer;
    }
    Request<Bitmap> newRequest = makeImageRequest(requestUrl, maxWidth, maxHeight, scaleType, cacheKey);
    this.mRequestQueue.add(newRequest);
    this.mInFlightRequests.put(cacheKey, new BatchedImageRequest(newRequest, imageContainer));
    return imageContainer;
}
a.java 文件源码 项目:boohee_v5.6 阅读 23 收藏 0 点赞 0 评论 0
private View a(Context context) {
    View linearLayout = new LinearLayout(context);
    LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, a(context, (float) IntFloatWheelView.DEFAULT_VALUE));
    layoutParams.gravity = 17;
    linearLayout.setOrientation(0);
    linearLayout.setLayoutParams(layoutParams);
    Drawable gradientDrawable = new GradientDrawable();
    gradientDrawable.setColor(-450944201);
    gradientDrawable.setCornerRadius((float) a(context, 5.0f));
    linearLayout.setBackgroundDrawable(gradientDrawable);
    View imageView = new ImageView(context);
    layoutParams = new LinearLayout.LayoutParams(a(context, 20.0f), a(context, 20.0f));
    layoutParams.gravity = 16;
    layoutParams.setMargins(a(this.a.f, 17.0f), a(this.a.f, 10.0f), a(this.a.f, 8.0f), a(this.a.f, 10.0f));
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ScaleType.FIT_CENTER);
    imageView.setImageDrawable(a(context, a.d));
    Animation rotateAnimation = new RotateAnimation(0.0f, 359.0f, 1, 0.5f, 1, 0.5f);
    rotateAnimation.setRepeatCount(-1);
    rotateAnimation.setDuration(900);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    imageView.startAnimation(rotateAnimation);
    View textView = new TextView(context);
    textView.setText(TextUtils.isEmpty(this.a.g) ? a.a : this.a.g);
    textView.setTextSize(16.0f);
    textView.setTextColor(-1);
    layoutParams = new LinearLayout.LayoutParams(-2, -2);
    layoutParams.gravity = 16;
    layoutParams.setMargins(0, 0, a(context, 17.0f), 0);
    textView.setLayoutParams(layoutParams);
    linearLayout.addView(imageView);
    linearLayout.addView(textView);
    return linearLayout;
}
RotateLoadingLayout.java 文件源码 项目:ultrasonic 阅读 38 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
SelectableRoundedImageView.java 文件源码 项目:boohee_v5.6 阅读 43 收藏 0 点赞 0 评论 0
private void adjustCanvasForBorder(Canvas canvas) {
    float[] values = new float[9];
    canvas.getMatrix().getValues(values);
    float scaleFactorX = values[0];
    float scaleFactorY = values[4];
    float translateX = values[2];
    float translateY = values[5];
    float newScaleX = this.mBounds.width() / ((this.mBounds.width() + this.mBorderWidth)
            + this.mBorderWidth);
    float newScaleY = this.mBounds.height() / ((this.mBounds.height() + this
            .mBorderWidth) + this.mBorderWidth);
    canvas.scale(newScaleX, newScaleY);
    if (ScaleType.FIT_START == this.mScaleType || ScaleType.FIT_END == this.mScaleType ||
            ScaleType.FIT_XY == this.mScaleType || ScaleType.FIT_CENTER == this
            .mScaleType || ScaleType.CENTER_INSIDE == this.mScaleType || ScaleType.MATRIX
            == this.mScaleType) {
        canvas.translate(this.mBorderWidth, this.mBorderWidth);
    } else if (ScaleType.CENTER == this.mScaleType || ScaleType.CENTER_CROP == this
            .mScaleType) {
        canvas.translate((-translateX) / (newScaleX * scaleFactorX), (-translateY) /
                (newScaleY * scaleFactorY));
        canvas.translate(-(this.mBounds.left - this.mBorderWidth), -(this.mBounds.top -
                this.mBorderWidth));
    }
}
PicViewer.java 文件源码 项目:Huochexing12306 阅读 26 收藏 0 点赞 0 评论 0
public void onCreate() {
    ivViewer = new ImageView(activity);
    ivViewer.setScaleType(ScaleType.CENTER_INSIDE);
    ivViewer.setBackgroundColor(0xc0000000);
    ivViewer.setOnClickListener(this);
    activity.setContentView(ivViewer);
    if (pic != null && !pic.isRecycled()) {
        ivViewer.setImageBitmap(pic);
    }
}
RotateLoadingLayout.java 文件源码 项目:ywApplication 阅读 20 收藏 0 点赞 0 评论 0
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
    super(context, mode, scrollDirection, attrs);

    mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);

    mHeaderImage.setScaleType(ScaleType.MATRIX);
    mHeaderImageMatrix = new Matrix();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);

    mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
RoundedImageView.java 文件源码 项目:letv 阅读 31 收藏 0 点赞 0 评论 0
public void setScaleType(ScaleType scaleType) {
    if (!$assertionsDisabled && scaleType == null) {
        throw new AssertionError();
    } else if (this.mScaleType != scaleType) {
        this.mScaleType = scaleType;
        switch (1.$SwitchMap$android$widget$ImageView$ScaleType[scaleType.ordinal()]) {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
                super.setScaleType(ScaleType.FIT_XY);
                break;
            default:
                super.setScaleType(scaleType);
                break;
        }
        updateDrawableAttrs();
        updateBackgroundDrawableAttrs(false);
        invalidate();
    }
}
ChannelPostsActivity.java 文件源码 项目:boohee_v5.6 阅读 22 收藏 0 点赞 0 评论 0
private void findViews() {
    this.fab_button = (FloatingActionButton) findViewById(R.id.fab_button);
    this.fab_button.setVisibility(8);
    this.mHeaderView = new ImageView(this);
    this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
    this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mListView.addHeaderView(this.mHeaderView);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            ChannelPostsActivity.this.getCurrentTopic();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!ChannelPostsActivity.this.isLastVisible) {
                ChannelPostsActivity.this.getNextTopic();
            }
        }
    });
}
DiaryImageManager.java 文件源码 项目:oma-riista-android 阅读 19 收藏 0 点赞 0 评论 0
/**
 * Adds new image to container view
 *
 * @param logImage LogImage object, if null, adds new image indicator instead
 * @param index    Image index
 */
private void addImage(LogImage logImage, int index) {
    WebImageView imageView = new WebImageView(mWorkContext.getContext());
    DiaryImage diaryImage = new DiaryImage(imageView);
    diaryImage.index = index;
    if (logImage != null) {
        changeImage(diaryImage, logImage);
    } else {
        mAddButton = imageView;
        imageView.setImageDrawable(mWorkContext.getContext().getResources().getDrawable(R.drawable.ic_camera));
        imageView.setBackgroundResource(R.drawable.bg_image_button);
    }
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams((int) mWorkContext.getContext().getResources().getDimension(R.dimen.logimage_size),
            (int) mWorkContext.getContext().getResources().getDimension(R.dimen.logimage_size));
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ScaleType.CENTER_CROP);
    mContainerView.addView(imageView);
    mDiaryImages.add(diaryImage);
    setupImageEdit(diaryImage, imageView, index);
}
FlipLoadingLayout.java 文件源码 项目:Hotspot-master-devp 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void onLoadingDrawableSet(Drawable imageDrawable) {
    if (null != imageDrawable) {
        final int dHeight = imageDrawable.getIntrinsicHeight();
        final int dWidth = imageDrawable.getIntrinsicWidth();

        /**
         * We need to set the width/height of the ImageView so that it is
         * square with each side the size of the largest drawable dimension.
         * This is so that it doesn't clip when rotated.
         */
        ViewGroup.LayoutParams lp = mHeaderImage.getLayoutParams();
        lp.width = lp.height = Math.max(dHeight, dWidth);
        mHeaderImage.requestLayout();

        /**
         * We now rotate the Drawable so that is at the correct rotation,
         * and is centered.
         */
        mHeaderImage.setScaleType(ScaleType.MATRIX);
        Matrix matrix = new Matrix();
        matrix.postTranslate((lp.width - dWidth) / 2f, (lp.height - dHeight) / 2f);
        matrix.postRotate(getDrawableRotationAngle(), lp.width / 2f, lp.height / 2f);
        mHeaderImage.setImageMatrix(matrix);
    }
}
SharedElementCallback.java 文件源码 项目:boohee_v5.6 阅读 42 收藏 0 点赞 0 评论 0
public Parcelable onCaptureSharedElementSnapshot(View sharedElement, Matrix viewToGlobalMatrix, RectF screenBounds) {
    Bitmap bitmap;
    if (sharedElement instanceof ImageView) {
        ImageView imageView = (ImageView) sharedElement;
        Drawable d = imageView.getDrawable();
        Drawable bg = imageView.getBackground();
        if (d != null && bg == null) {
            bitmap = createDrawableBitmap(d);
            if (bitmap != null) {
                Bundle bundle = new Bundle();
                bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap);
                bundle.putString(BUNDLE_SNAPSHOT_IMAGE_SCALETYPE, imageView.getScaleType().toString());
                if (imageView.getScaleType() != ScaleType.MATRIX) {
                    return bundle;
                }
                float[] values = new float[9];
                imageView.getImageMatrix().getValues(values);
                bundle.putFloatArray(BUNDLE_SNAPSHOT_IMAGE_MATRIX, values);
                return bundle;
            }
        }
    }
    int bitmapWidth = Math.round(screenBounds.width());
    int bitmapHeight = Math.round(screenBounds.height());
    bitmap = null;
    if (bitmapWidth > 0 && bitmapHeight > 0) {
        float scale = Math.min(1.0f, ((float) MAX_IMAGE_SIZE) / ((float) (bitmapWidth * bitmapHeight)));
        bitmapWidth = (int) (((float) bitmapWidth) * scale);
        bitmapHeight = (int) (((float) bitmapHeight) * scale);
        if (this.mTempMatrix == null) {
            this.mTempMatrix = new Matrix();
        }
        this.mTempMatrix.set(viewToGlobalMatrix);
        this.mTempMatrix.postTranslate(-screenBounds.left, -screenBounds.top);
        this.mTempMatrix.postScale(scale, scale);
        bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        canvas.concat(this.mTempMatrix);
        sharedElement.draw(canvas);
    }
    return bitmap;
}
PhotoViewAttacher.java 文件源码 项目:PicShow-zhaipin 阅读 20 收藏 0 点赞 0 评论 0
/**
 * Set's the ImageView's ScaleType to Matrix.
 */
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
    /**
     * PhotoView sets it's own ScaleType to Matrix, then diverts all calls
     * setScaleType to this.setScaleType automatically.
     */
    if (null != imageView && !(imageView instanceof IPhotoView)) {
        if (!ScaleType.MATRIX.equals(imageView.getScaleType())) {
            imageView.setScaleType(ScaleType.MATRIX);
        }
    }
}
PhotoViewAttacher.java 文件源码 项目:DailyStudy 阅读 29 收藏 0 点赞 0 评论 0
/**
 * Set's the ImageView's ScaleType to Matrix.
 */
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
    /**
     * PhotoView sets it's own ScaleType to Matrix, then diverts all calls
     * setScaleType to this.setScaleType automatically.
     */
    if (null != imageView && !(imageView instanceof IPhotoView)) {
        if (!ScaleType.MATRIX.equals(imageView.getScaleType())) {
            imageView.setScaleType(ScaleType.MATRIX);
        }
    }
}
Banner.java 文件源码 项目:GitHub 阅读 33 收藏 0 点赞 0 评论 0
private void setScaleType(View imageView) {
    if (imageView instanceof ImageView) {
        ImageView view = ((ImageView) imageView);
        switch (scaleType) {
            case 0:
                view.setScaleType(ScaleType.CENTER);
                break;
            case 1:
                view.setScaleType(ScaleType.CENTER_CROP);
                break;
            case 2:
                view.setScaleType(ScaleType.CENTER_INSIDE);
                break;
            case 3:
                view.setScaleType(ScaleType.FIT_CENTER);
                break;
            case 4:
                view.setScaleType(ScaleType.FIT_END);
                break;
            case 5:
                view.setScaleType(ScaleType.FIT_START);
                break;
            case 6:
                view.setScaleType(ScaleType.FIT_XY);
                break;
            case 7:
                view.setScaleType(ScaleType.MATRIX);
                break;
        }

    }
}
PhotoViewAttacher.java 文件源码 项目:PicShow-zhaipin 阅读 29 收藏 0 点赞 0 评论 0
private void checkImageViewScaleType() {
    ImageView imageView = getImageView();

    /**
     * PhotoView's getScaleType() will just divert to this.getScaleType() so
     * only call if we're not attached to a PhotoView.
     */
    if (null != imageView && !(imageView instanceof IPhotoView)) {
        if (!ScaleType.MATRIX.equals(imageView.getScaleType())) {
            throw new IllegalStateException(
                    "The ImageView's ScaleType has been changed since attaching a PhotoViewAttacher");
        }
    }
}
ImageLoader.java 文件源码 项目:GitHub 阅读 26 收藏 0 点赞 0 评论 0
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
PhotoViewAttacher.java 文件源码 项目:tvConnect_android 阅读 21 收藏 0 点赞 0 评论 0
/**
 * @return true if the ScaleType is supported.
 */
private static boolean isSupportedScaleType(final ScaleType scaleType) {
    if (null == scaleType) {
        return false;
    }

    switch (scaleType) {
        case MATRIX:
            throw new IllegalArgumentException(scaleType.name()
                    + " is not supported in PhotoView");

        default:
            return true;
    }
}
RoundedDrawable.java 文件源码 项目:AvatarView 阅读 33 收藏 0 点赞 0 评论 0
public RoundedDrawable setScaleType(ScaleType scaleType) {
    if (scaleType == null) {
        scaleType = ScaleType.FIT_CENTER;
    }
    if (mScaleType != scaleType) {
        mScaleType = scaleType;
        updateShaderMatrix();
    }
    return this;
}
PhotoViewAttacher.java 文件源码 项目:GitHub 阅读 28 收藏 0 点赞 0 评论 0
/**
 * @return true if the ScaleType is supported.
 */
private static boolean isSupportedScaleType(final ScaleType scaleType) {
    if (null == scaleType) {
        return false;
    }

    switch (scaleType) {
    case MATRIX:
        throw new IllegalArgumentException(scaleType.name()
                + " is not supported in PhotoView");

    default:
        return true;
    }
}
BooheeAdvertisementBanner.java 文件源码 项目:boohee_v5.6 阅读 27 收藏 0 点赞 0 评论 0
private void initView() {
    LayoutParams imageLP = new LayoutParams(-1, -1, 17);
    this.imageView = new ImageView(getContext());
    this.imageView.setVisibility(4);
    this.imageView.setScaleType(ScaleType.FIT_CENTER);
    addView(this.imageView, imageLP);
    LayoutParams closeLP = new LayoutParams(DensityUtil.dip2px(getContext(), 44.0f),
            DensityUtil.dip2px(getContext(), 44.0f));
    closeLP.gravity = 21;
    this.closeBtn = new Button(getContext());
    this.closeBtn.setBackgroundResource(R.drawable.l7);
    this.closeBtn.setVisibility(4);
    addView(this.closeBtn, closeLP);
}
PhotoViewAttacher.java 文件源码 项目:GitHub 阅读 33 收藏 0 点赞 0 评论 0
@Override
public final void setScaleType(ScaleType scaleType) {
    if (isSupportedScaleType(scaleType) && scaleType != mScaleType) {
        mScaleType = scaleType;

        // Finally update
        update();
    }
}
WXImage.java 文件源码 项目:ucar-weex-core 阅读 19 收藏 0 点赞 0 评论 0
@Override
protected ImageView initComponentHostView(@NonNull Context context) {
  WXImageView view = new WXImageView(context);
  view.setScaleType(ScaleType.FIT_XY);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    view.setCropToPadding(true);
  }
  view.holdComponent(this);
  return view;
}


问题


面经


文章

微信
公众号

扫码关注公众号