use of android.support.annotation.Px in project Memento-Calendar by alexstyl.
the class UILImageLoader method load.
@Override
public Request load(final URI imagePath) {
final DisplayImageOptions.Builder builder = standardBuilder();
return new Request() {
@Override
public void into(ImageView imageView) {
uil.displayImage(imagePath.toString(), imageView, builder.build());
}
@Override
public Request asCircle() {
builder.displayer(defaultCircleDisplayer);
return this;
}
@Override
public FixedSizeRequest withSize(@Px final int width, @Px final int height) {
builder.displayer(DefaultConfigurationFactory.createBitmapDisplayer());
return new FixedSizeRequest() {
@Override
public Optional<Bitmap> synchronously() {
Bitmap bitmap = uil.loadImageSync(imagePath.toString(), new ImageSize(width, height), builder.build());
if (bitmap == null) {
return Optional.absent();
} else {
return new Optional<>(bitmap);
}
}
@Override
public void into(final ImageLoadedConsumer consumer) {
builder.displayer(DefaultConfigurationFactory.createBitmapDisplayer());
uil.loadImage(imagePath.toString(), builder.build(), new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
consumer.onImageLoaded(loadedImage);
}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
consumer.onLoadingFailed();
}
});
}
};
}
};
}
use of android.support.annotation.Px in project quran_android by quran.
the class QuranPageLayout method onLayout.
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
View view = resolveView();
if (view != null) {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
@Px int leftLineWidth = leftBorder == BorderMode.LINE ? 1 : leftPageBorder.getIntrinsicWidth();
@Px int rightLineWidth = rightBorder == BorderMode.HIDDEN ? 0 : rightPageBorder.getIntrinsicWidth();
int headerFooterHeight = 0;
view.layout(leftLineWidth, headerFooterHeight, width - rightLineWidth, height - headerFooterHeight);
super.onLayout(changed, l, t, r, b);
}
}
Aggregations