use of android.widget.ImageView in project PhotoView by chrisbanes.
the class ImmersiveActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_immersive);
PhotoView photoView = (PhotoView) findViewById(R.id.photo_view);
Picasso.with(this).load("http://pbs.twimg.com/media/Bist9mvIYAAeAyQ.jpg").into(photoView);
photoView.setOnPhotoTapListener(new OnPhotoTapListener() {
@Override
public void onPhotoTap(ImageView view, float x, float y) {
//fullScreen();
}
});
fullScreen();
}
use of android.widget.ImageView in project cw-omnibus by commonsguy.
the class BatteryFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
View result = inflater.inflate(R.layout.batt, parent, false);
bar = (ProgressBar) result.findViewById(R.id.bar);
status = (ImageView) result.findViewById(R.id.status);
level = (TextView) result.findViewById(R.id.level);
return (result);
}
use of android.widget.ImageView in project SimplifyReader by chentao0707.
the class VaryViewHelperController method showNetworkError.
public void showNetworkError(View.OnClickListener onClickListener) {
View layout = helper.inflate(R.layout.message);
TextView textView = (TextView) layout.findViewById(R.id.message_info);
textView.setText(helper.getContext().getResources().getString(R.string.common_no_network_msg));
ImageView imageView = (ImageView) layout.findViewById(R.id.message_icon);
imageView.setImageResource(R.drawable.ic_exception);
if (null != onClickListener) {
layout.setOnClickListener(onClickListener);
}
helper.showLayout(layout);
}
use of android.widget.ImageView in project Launcher3 by chislon.
the class AppsCustomizePagedView method beginDraggingWidget.
private boolean beginDraggingWidget(View v) {
mDraggingWidget = true;
// Get the widget preview as the drag representation
ImageView image = (ImageView) v.findViewById(R.id.widget_preview);
PendingAddItemInfo createItemInfo = (PendingAddItemInfo) v.getTag();
// we abort the drag.
if (image.getDrawable() == null) {
mDraggingWidget = false;
return false;
}
// Compose the drag image
Bitmap preview;
Bitmap outline;
float scale = 1f;
Point previewPadding = null;
if (createItemInfo instanceof PendingAddWidgetInfo) {
// the widget if this is null, so we break out.
if (mCreateWidgetInfo == null) {
return false;
}
PendingAddWidgetInfo createWidgetInfo = mCreateWidgetInfo;
createItemInfo = createWidgetInfo;
int spanX = createItemInfo.spanX;
int spanY = createItemInfo.spanY;
int[] size = mLauncher.getWorkspace().estimateItemSize(spanX, spanY, createWidgetInfo, true);
FastBitmapDrawable previewDrawable = (FastBitmapDrawable) image.getDrawable();
float minScale = 1.25f;
int maxWidth, maxHeight;
maxWidth = Math.min((int) (previewDrawable.getIntrinsicWidth() * minScale), size[0]);
maxHeight = Math.min((int) (previewDrawable.getIntrinsicHeight() * minScale), size[1]);
int[] previewSizeBeforeScale = new int[1];
preview = mWidgetPreviewLoader.generateWidgetPreview(createWidgetInfo.componentName, createWidgetInfo.previewImage, createWidgetInfo.icon, spanX, spanY, maxWidth, maxHeight, null, previewSizeBeforeScale);
// Compare the size of the drag preview to the preview in the AppsCustomize tray
int previewWidthInAppsCustomize = Math.min(previewSizeBeforeScale[0], mWidgetPreviewLoader.maxWidthForWidgetPreview(spanX));
scale = previewWidthInAppsCustomize / (float) preview.getWidth();
// might be extra pixels around the preview itself - this accounts for that
if (previewWidthInAppsCustomize < previewDrawable.getIntrinsicWidth()) {
int padding = (previewDrawable.getIntrinsicWidth() - previewWidthInAppsCustomize) / 2;
previewPadding = new Point(padding, 0);
}
} else {
PendingAddShortcutInfo createShortcutInfo = (PendingAddShortcutInfo) v.getTag();
Drawable icon = mIconCache.getFullResIcon(createShortcutInfo.shortcutActivityInfo);
preview = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
mCanvas.setBitmap(preview);
mCanvas.save();
WidgetPreviewLoader.renderDrawableToBitmap(icon, preview, 0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
mCanvas.restore();
mCanvas.setBitmap(null);
createItemInfo.spanX = createItemInfo.spanY = 1;
}
// Don't clip alpha values for the drag outline if we're using the default widget preview
boolean clipAlpha = !(createItemInfo instanceof PendingAddWidgetInfo && (((PendingAddWidgetInfo) createItemInfo).previewImage == 0));
// Save the preview for the outline generation, then dim the preview
outline = Bitmap.createScaledBitmap(preview, preview.getWidth(), preview.getHeight(), false);
// Start the drag
mLauncher.lockScreenOrientation();
mLauncher.getWorkspace().onDragStartedWithItem(createItemInfo, outline, clipAlpha);
mDragController.startDrag(image, preview, this, createItemInfo, DragController.DRAG_ACTION_COPY, previewPadding, scale);
outline.recycle();
preview.recycle();
return true;
}
use of android.widget.ImageView in project cw-omnibus by commonsguy.
the class FragmentBase method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setRetainInstance(true);
View result = inflater.inflate(R.layout.scaleclip, container, false);
SeekBar bar = ((SeekBar) result.findViewById(R.id.level));
bar.setOnSeekBarChangeListener(this);
image = (ImageView) result.findViewById(R.id.image);
setImageBackground(image);
image.setImageLevel(bar.getProgress());
return (result);
}
Aggregations