Search in sources :

Example 1 with Photo

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;
    }
}
Also used : Photo(com.googlecode.flickrjandroid.photos.Photo)

Example 2 with Photo

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());
    }
}
Also used : SpannableBuilder(com.alexvasilkov.android.commons.texts.SpannableBuilder) Photo(com.googlecode.flickrjandroid.photos.Photo)

Example 3 with Photo

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);
}
Also used : Photo(com.googlecode.flickrjandroid.photos.Photo) Toolbar(android.support.v7.widget.Toolbar)

Example 4 with Photo

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);
}
Also used : Photo(com.googlecode.flickrjandroid.photos.Photo)

Example 5 with Photo

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());
    }
}
Also used : SpannableBuilder(com.alexvasilkov.android.commons.texts.SpannableBuilder) Photo(com.googlecode.flickrjandroid.photos.Photo)

Aggregations

Photo (com.googlecode.flickrjandroid.photos.Photo)23 ArrayList (java.util.ArrayList)5 Intent (android.content.Intent)3 LoadPhotoInfoTask (com.bourke.glimmr.tasks.LoadPhotoInfoTask)3 Bitmap (android.graphics.Bitmap)2 FragmentTransaction (android.support.v4.app.FragmentTransaction)2 View (android.view.View)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 SpannableBuilder (com.alexvasilkov.android.commons.texts.SpannableBuilder)2 Background (com.alexvasilkov.events.Events.Background)2 Subscribe (com.alexvasilkov.events.Events.Subscribe)2 IPhotoInfoReadyListener (com.bourke.glimmr.event.Events.IPhotoInfoReadyListener)2 PhotoStreamGridFragment (com.bourke.glimmr.fragments.home.PhotoStreamGridFragment)2 Flickr (com.googlecode.flickrjandroid.Flickr)2 PhotoList (com.googlecode.flickrjandroid.photos.PhotoList)2 SearchParameters (com.googlecode.flickrjandroid.photos.SearchParameters)2 List (java.util.List)2 Bundle (android.os.Bundle)1 Toolbar (android.support.v7.widget.Toolbar)1