Search in sources :

Example 6 with ImageView

use of android.widget.ImageView in project cw-omnibus by commonsguy.

the class PopupAdapter method getInfoContents.

@SuppressLint("InflateParams")
@Override
public View getInfoContents(Marker marker) {
    if (popup == null) {
        popup = inflater.inflate(R.layout.popup, null);
    }
    if (lastMarker == null || !lastMarker.getId().equals(marker.getId())) {
        lastMarker = marker;
        TextView tv = (TextView) popup.findViewById(R.id.title);
        tv.setText(marker.getTitle());
        tv = (TextView) popup.findViewById(R.id.snippet);
        tv.setText(marker.getSnippet());
        Uri image = images.get(marker.getId());
        ImageView icon = (ImageView) popup.findViewById(R.id.icon);
        if (image == null) {
            icon.setVisibility(View.GONE);
        } else {
            Picasso.with(ctxt).load(image).resize(iconWidth, iconHeight).centerCrop().noFade().placeholder(R.drawable.placeholder).into(icon, new MarkerCallback(marker));
        }
    }
    return (popup);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) Uri(android.net.Uri) SuppressLint(android.annotation.SuppressLint)

Example 7 with ImageView

use of android.widget.ImageView in project UltimateAndroid by cymcsg.

the class ParallaxSwipeBackNextActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    this.overridePendingTransition(R.anim.slide_right_in, R.anim.slide_right_out);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.parallax_swipe_back_activity_next);
    index = getIntent().getIntExtra("index", 0);
    ImageView imageView = (ImageView) findViewById(R.id.image);
    imageView.setImageResource(images[index]);
    TextView textView = (TextView) findViewById(R.id.next);
    textView.setText(textView.getText().toString() + index);
    final Intent intent = new Intent(this, ParallaxSwipeBackNextActivity.class);
    intent.putExtra("index", ++index);
    if (index == images.length) {
        textView.setText("FINISH ACTIVITY");
    }
    textView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (index == images.length) {
                finish();
                ParallaxSwipeBackNextActivity.this.overridePendingTransition(R.anim.slide_right_in, R.anim.slide_right_out);
            } else
                startParallaxSwipeBackActivty(ParallaxSwipeBackNextActivity.this, intent);
        }
    });
}
Also used : TextView(android.widget.TextView) Intent(android.content.Intent) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 8 with ImageView

use of android.widget.ImageView in project cw-omnibus by commonsguy.

the class AsyncDemoFragment method changeMenuIconAnimation.

// based on https://goo.gl/3IUM8K
private void changeMenuIconAnimation(final FloatingActionMenu menu) {
    AnimatorSet set = new AnimatorSet();
    final ImageView v = menu.getMenuIconView();
    ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
    ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
    ObjectAnimator scaleInX = ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
    ObjectAnimator scaleInY = ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
    scaleOutX.setDuration(50);
    scaleOutY.setDuration(50);
    scaleInX.setDuration(150);
    scaleInY.setDuration(150);
    scaleInX.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            v.setImageResource(menu.isOpened() ? R.drawable.ic_action_settings : R.drawable.ic_close);
        }
    });
    set.play(scaleOutX).with(scaleOutY);
    set.play(scaleInX).with(scaleInY).after(scaleOutX);
    set.setInterpolator(new OvershootInterpolator(2));
    menu.setIconToggleAnimatorSet(set);
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) AnimatorSet(android.animation.AnimatorSet) ImageView(android.widget.ImageView)

Example 9 with ImageView

use of android.widget.ImageView in project glide by bumptech.

the class FullscreenActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fullscreen_activity);
    ImageView fullscreenView = (ImageView) findViewById(R.id.fullscreen_view);
    Photo photo = getIntent().getParcelableExtra(ARG_PHOTO);
    Glide.with(this).load(photo).apply(fitCenterTransform(this)).into(fullscreenView);
}
Also used : Photo(com.bumptech.glide.samples.flickr.api.Photo) ImageView(android.widget.ImageView)

Example 10 with ImageView

use of android.widget.ImageView in project Launcher3 by chislon.

the class LauncherTransitionable method copyFolderIconToImage.

/**
     * This method draws the FolderIcon to an ImageView and then adds and positions that ImageView
     * in the DragLayer in the exact absolute location of the original FolderIcon.
     */
private void copyFolderIconToImage(FolderIcon fi) {
    final int width = fi.getMeasuredWidth();
    final int height = fi.getMeasuredHeight();
    // Lazy load ImageView, Bitmap and Canvas
    if (mFolderIconImageView == null) {
        mFolderIconImageView = new ImageView(this);
    }
    if (mFolderIconBitmap == null || mFolderIconBitmap.getWidth() != width || mFolderIconBitmap.getHeight() != height) {
        mFolderIconBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        mFolderIconCanvas = new Canvas(mFolderIconBitmap);
    }
    DragLayer.LayoutParams lp;
    if (mFolderIconImageView.getLayoutParams() instanceof DragLayer.LayoutParams) {
        lp = (DragLayer.LayoutParams) mFolderIconImageView.getLayoutParams();
    } else {
        lp = new DragLayer.LayoutParams(width, height);
    }
    // The layout from which the folder is being opened may be scaled, adjust the starting
    // view size by this scale factor.
    float scale = mDragLayer.getDescendantRectRelativeToSelf(fi, mRectForFolderAnimation);
    lp.customPosition = true;
    lp.x = mRectForFolderAnimation.left;
    lp.y = mRectForFolderAnimation.top;
    lp.width = (int) (scale * width);
    lp.height = (int) (scale * height);
    mFolderIconCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
    fi.draw(mFolderIconCanvas);
    mFolderIconImageView.setImageBitmap(mFolderIconBitmap);
    if (fi.getFolder() != null) {
        mFolderIconImageView.setPivotX(fi.getFolder().getPivotXForIconAnimation());
        mFolderIconImageView.setPivotY(fi.getFolder().getPivotYForIconAnimation());
    }
    // we remove it and re-add it.
    if (mDragLayer.indexOfChild(mFolderIconImageView) != -1) {
        mDragLayer.removeView(mFolderIconImageView);
    }
    mDragLayer.addView(mFolderIconImageView, lp);
    if (fi.getFolder() != null) {
        fi.getFolder().bringToFront();
    }
}
Also used : Canvas(android.graphics.Canvas) ImageView(android.widget.ImageView) Point(android.graphics.Point)

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