Android Open Source - com.elsewhat.android.slideshow Slideshow Photo Drawable






From Project

Back to project page com.elsewhat.android.slideshow.

License

The source code is released under:

Copyright (C) 2012 Dagfinn Parnas <dagfinn.parnas@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Sof...

If you think the Android project com.elsewhat.android.slideshow listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.elsewhat.android.slideshow.api;
//from  ww  w  .  j  a  v  a  2  s .c  o m
import java.io.File;
import java.io.IOException;

import android.content.Context;
import android.graphics.drawable.Drawable;


/**
 * Representing photos that are supplied as part of the app
 * 
 * @author dagfinn.parnas
 *
 */
public class SlideshowPhotoDrawable extends SlideshowPhoto {
  protected int largePhotoDrawableId;
  protected Context context;
  
  public SlideshowPhotoDrawable(Context context, String title, String description, int largePhotoDrawableId, String largePhotoShareUrl){
    super(title,description,null,null,"dummy url");
    this.largePhotoDrawableId=largePhotoDrawableId;
    this.context=context;
    this.largePhoto=largePhotoShareUrl;
  }
  /* (non-Javadoc)
   * @see com.elsewhat.smugmug.api.SlideshowPhoto#getLargePhotoDrawable(java.io.File)
   */
  @Override
  public Drawable getLargePhotoDrawable(File folder, int maxWidth, int maxHeight)throws IOException {
    //changed this due to ICS bug causing a too large drawable
    //return context.getResources().getDrawable(largePhotoDrawableId);
    return FileUtils.readBitmapFromResources(context.getResources(), largePhotoDrawableId, maxWidth,maxHeight);
    
  }
  /* (non-Javadoc)
   * @see com.elsewhat.smugmug.api.SlideshowPhoto#isCacheExisting(java.io.File)
   */
  @Override
  public boolean isCacheExisting(File folder) {
    //return false in order for share photo to use largePhotoShareUrl
    return false;
  }
  
  /**
   * Returns the drawable id
   * Can be used for creating an Uri to the file
   * 
   * @return
   */
  public int getDrawableId(){
    return largePhotoDrawableId;
  }
  
  
  
}




Java Source Code List

com.elsewhat.android.slideshow.activities.ChromecastAddin.java
com.elsewhat.android.slideshow.activities.ISlideshowInstance.java
com.elsewhat.android.slideshow.activities.SlideshowActivity.java
com.elsewhat.android.slideshow.activities.SlideshowDreamService.java
com.elsewhat.android.slideshow.activities.SlideshowPreferences.java
com.elsewhat.android.slideshow.api.Analytics.java
com.elsewhat.android.slideshow.api.AndroidUtils.java
com.elsewhat.android.slideshow.api.AsyncQueueableObject.java
com.elsewhat.android.slideshow.api.AsyncReadQueue.java
com.elsewhat.android.slideshow.api.CustomGallery.java
com.elsewhat.android.slideshow.api.DeletablePreference.java
com.elsewhat.android.slideshow.api.DownloadableObject.java
com.elsewhat.android.slideshow.api.FileDownloader.java
com.elsewhat.android.slideshow.api.FileUtils.java
com.elsewhat.android.slideshow.api.FlingKeyEvent.java
com.elsewhat.android.slideshow.api.ImageAdapter.java
com.elsewhat.android.slideshow.api.QueueablePhotoObject.java
com.elsewhat.android.slideshow.api.ReadOnlyPreference.java
com.elsewhat.android.slideshow.api.SlideshowBackend.java
com.elsewhat.android.slideshow.api.SlideshowPhotoCached.java
com.elsewhat.android.slideshow.api.SlideshowPhotoDrawable.java
com.elsewhat.android.slideshow.api.SlideshowPhoto.java
com.elsewhat.android.slideshow.backend.FlickrPublicSetBackend.java
com.elsewhat.android.slideshow.backend.OPMLBackend.java
com.elsewhat.android.slideshow.backend.SmugMugRecentBackend.java