Android Open Source - AndroidImageCache Dimensions






From Project

Back to project page AndroidImageCache.

License

The source code is released under:

Przemys?aw Jakubczyk Polidea Sp. z o.o. Copyright (c) 2012 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo...

If you think the Android project AndroidImageCache listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package pl.polidea.utils;
/*  w  w  w. j a va  2s .  c om*/
import android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;

/**
 * @author Mateusz Grzechoci?ski <mateusz.grzechocinski@gmail.com>
 */
public class Dimensions {

    /**
     * Height in pixels, by may be also {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
     * or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
     */
    public final int heightPX;

    /**
     * Width in pixels, by may be also {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
     * or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
     */
    public final int widthPX;

    private Dimensions(int heightPX, int widthPX) {
        this.heightPX = heightPX;
        this.widthPX = widthPX;
    }

    public static Dimensions fromAttributesSet(Context context, AttributeSet attributeSet) {
        if (attributeSet == null) {
            return null;
        }
        TypedArray typedArray = context.obtainStyledAttributes(attributeSet, new int[]{R.attr.layout_width, R.attr.layout_height});
        int width = typedArray.getLayoutDimension(0, 0);
        int height = typedArray.getLayoutDimension(1, 0);

        typedArray.recycle();

        return new Dimensions(height, width);
    }
}




Java Source Code List

pl.polidea.imagecache.BitmapLRUCache.java
pl.polidea.imagecache.CacheConfig.java
pl.polidea.imagecache.ImageCacheFactory.java
pl.polidea.imagecache.ImageCache.java
pl.polidea.imagecache.MemoryCache.java
pl.polidea.imagecache.OnCacheResultListener.java
pl.polidea.imagecache.StaticCachedImageCacheFactory.java
pl.polidea.thridparty.DiskCache.java
pl.polidea.thridparty.LinkedBlockingDeque.java
pl.polidea.thridparty.LruCache.java
pl.polidea.utils.Dimensions.java
pl.polidea.utils.StackBlockingDeque.java
pl.polidea.utils.StackPoolExecutor.java
pl.polidea.utils.TempFile.java
pl.polidea.utils.Utils.java
pl.polidea.webimagesampleapp.AndroidImageCacheExample.java
pl.polidea.webimageview.BitmapDecodeException.java
pl.polidea.webimageview.Bitmaps.java
pl.polidea.webimageview.DefaultBitmapProcessor.java
pl.polidea.webimageview.ImageViewUpdater.java
pl.polidea.webimageview.WebImageListener.java
pl.polidea.webimageview.WebImageView.java
pl.polidea.webimageview.net.StaticCachedWebClientFactory.java
pl.polidea.webimageview.net.WebCallback.java
pl.polidea.webimageview.net.WebClientFactory.java
pl.polidea.webimageview.net.WebClient.java
pl.polidea.webimageview.net.WebInterfaceImpl.java
pl.polidea.webimageview.net.WebInterface.java
pl.polidea.webimageview.processor.AbstractBitmapProcessorCreationChain.java
pl.polidea.webimageview.processor.BitmapProcessor.java
pl.polidea.webimageview.processor.BothWidthAndHeightFixed.java
pl.polidea.webimageview.processor.BothWidthAndHeightNotFixed.java
pl.polidea.webimageview.processor.OnlyHeightFixed.java
pl.polidea.webimageview.processor.OnlyWidthFixed.java
pl.polidea.webimageview.processor.ProcessorFactory.java
pl.polidea.webimageview.processor.Processor.java
pl.polidea.webimageview.processor.ProgramaticallyCreated.java
pl.polidea.webimageview.processor.Unknown.java