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);
}
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);
}
});
}
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);
}
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);
}
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();
}
}
Aggregations