Search in sources :

Example 21 with ImageView

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();
}
Also used : PhotoView(com.github.chrisbanes.photoview.PhotoView) OnPhotoTapListener(com.github.chrisbanes.photoview.OnPhotoTapListener) ImageView(android.widget.ImageView)

Example 22 with ImageView

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);
}
Also used : ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 23 with ImageView

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);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 24 with ImageView

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;
}
Also used : Bitmap(android.graphics.Bitmap) Drawable(android.graphics.drawable.Drawable) ImageView(android.widget.ImageView) Point(android.graphics.Point) Point(android.graphics.Point)

Example 25 with ImageView

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);
}
Also used : SeekBar(android.widget.SeekBar) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

ImageView (android.widget.ImageView)2176 View (android.view.View)1100 TextView (android.widget.TextView)963 Drawable (android.graphics.drawable.Drawable)192 Intent (android.content.Intent)191 LinearLayout (android.widget.LinearLayout)187 Bitmap (android.graphics.Bitmap)175 ViewGroup (android.view.ViewGroup)161 LayoutInflater (android.view.LayoutInflater)155 OnClickListener (android.view.View.OnClickListener)142 AdapterView (android.widget.AdapterView)108 ListView (android.widget.ListView)101 RecyclerView (android.support.v7.widget.RecyclerView)97 FrameLayout (android.widget.FrameLayout)95 Button (android.widget.Button)80 BitmapDrawable (android.graphics.drawable.BitmapDrawable)75 Bundle (android.os.Bundle)73 Test (org.junit.Test)70 RelativeLayout (android.widget.RelativeLayout)69 Context (android.content.Context)65