use of com.googlecode.flickrjandroid.photos.Photo in project GestureViews by alexvasilkov.
the class Ex6AdvancedDemoActivity method onOptionsItemSelectedFullMode.
private boolean onOptionsItemSelectedFullMode(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_crop:
Photo photo = pagerAdapter.getPhoto(views.pager.getCurrentItem());
if (photo == null) {
return false;
}
PhotoCropActivity.show(Ex6AdvancedDemoActivity.this, photo);
return true;
default:
return false;
}
}
use of com.googlecode.flickrjandroid.photos.Photo in project GestureViews by alexvasilkov.
the class Ex6AdvancedDemoActivity method onPhotoInPagerSelected.
private void onPhotoInPagerSelected(int position) {
Photo photo = pagerAdapter.getPhoto(position);
if (photo == null) {
views.pagerTitle.setText(null);
} else {
SpannableBuilder title = new SpannableBuilder(Ex6AdvancedDemoActivity.this);
title.append(photo.getTitle()).append("\n").createStyle().setColorResId(R.color.text_secondary_light).apply().append(R.string.photo_by).append(" ").append(photo.getOwner().getUsername());
views.pagerTitle.setText(title.build());
}
}
use of com.googlecode.flickrjandroid.photos.Photo in project GestureViews by alexvasilkov.
the class PhotoCropActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo_crop);
Toolbar toolbar = Views.find(this, R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
imageView = Views.find(this, R.id.cropping_image);
imageView.getController().getSettings().setFitMethod(Settings.Fit.OUTSIDE).setFillViewport(true).setRotationEnabled(true);
finderView = Views.find(this, R.id.cropping_finder);
finderView.setSettings(imageView.getController().getSettings());
Photo photo = (Photo) getIntent().getSerializableExtra(EXTRA_PHOTO);
GlideHelper.loadFlickrFull(photo, imageView, null);
applyFinderShape(false);
}
use of com.googlecode.flickrjandroid.photos.Photo in project GestureViews by alexvasilkov.
the class PhotoListAdapter method onBindHolder.
@Override
protected void onBindHolder(ViewHolder holder, int position) {
Photo photo = photos.get(position);
holder.image.setTag(R.id.tag_item, photo);
GlideHelper.loadFlickrThumb(photo, holder.image);
}
use of com.googlecode.flickrjandroid.photos.Photo in project GestureViews by alexvasilkov.
the class DemoActivity method onPhotoInPagerSelected.
/**
* Setting up photo title for current pager position.
*/
private void onPhotoInPagerSelected(int position) {
Photo photo = pagerAdapter.getPhoto(position);
if (photo == null) {
views.pagerTitle.setText(null);
} else {
SpannableBuilder title = new SpannableBuilder(DemoActivity.this);
title.append(photo.getTitle()).append("\n").createStyle().setColorResId(R.color.text_secondary_light).apply().append(R.string.demo_photo_by).append(" ").append(photo.getOwner().getUsername());
views.pagerTitle.setText(title.build());
}
}
Aggregations