Skip to content

Commit

Permalink
Rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rickard Lindberg and Kajsa Goffrich authored and rickardlindberg committed Oct 14, 2012
1 parent dc8d1d2 commit 3d03820
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions photobox/src/com/photobox/app/PhotoView.java
Expand Up @@ -27,7 +27,7 @@ public class PhotoView extends View {
private WorldMapping mapping;
private Renderer renderer;
private InputState inputState;
private AsynchPhotoLoader asynchPhotoLoader;
private AsyncPhotoLoader asyncPhotoLoader;
private InputActor inputActor;
private ResolutionLadder ladder;

Expand All @@ -47,10 +47,10 @@ public PhotoView(Context context, AttributeSet attrs, int defStyle) {
renderer = new Renderer(debugger, mapping, collection);
inputState = new InputState(context, mapping);
int maxSize = getScreenSize().max();
asynchPhotoLoader = new AsynchPhotoLoader(this, maxSize);
ladder = new ResolutionLadder(1, 1, asynchPhotoLoader,
new ResolutionLadder(3, 0.5f, asynchPhotoLoader,
new ResolutionLadder(10, 0.15f, asynchPhotoLoader, null)));
asyncPhotoLoader = new AsyncPhotoLoader(this, maxSize);
ladder = new ResolutionLadder(1, 1, asyncPhotoLoader,
new ResolutionLadder(3, 0.5f, asyncPhotoLoader,
new ResolutionLadder(10, 0.15f, asyncPhotoLoader, null)));
inputActor = new InputActor(mapping, collection, ladder);
}

Expand Down
Expand Up @@ -9,13 +9,13 @@
import android.graphics.Bitmap;
import android.view.View;

public class AsynchPhotoLoader {
public class AsyncPhotoLoader {

private HashMap<Photo, PhotoLoaderAsynchTask> loadingTasks = new HashMap<Photo, PhotoLoaderAsynchTask>();
private HashMap<Photo, PhotoLoaderAsyncTask> loadingTasks = new HashMap<Photo, PhotoLoaderAsyncTask>();
private View view;
private int maxSize;

public AsynchPhotoLoader(View view, int maxSize) {
public AsyncPhotoLoader(View view, int maxSize) {
this.view = view;
this.maxSize = maxSize;
}
Expand All @@ -24,18 +24,18 @@ public void addLoadingTask(Photo photo, float resolution) {
if (loadingTasks.containsKey(photo)) {
loadingTasks.get(photo).cancel(true);
}
PhotoLoaderAsynchTask task = new PhotoLoaderAsynchTask(photo, resolution, view);
PhotoLoaderAsyncTask task = new PhotoLoaderAsyncTask(photo, resolution, view);
loadingTasks.put(photo, task);
task.execute();
}

class PhotoLoaderAsynchTask extends AsyncTask<Void, Void, Bitmap> {
class PhotoLoaderAsyncTask extends AsyncTask<Void, Void, Bitmap> {

private Photo photo;
private float resolution;
private View view;

public PhotoLoaderAsynchTask(Photo photo, float resolution, View view) {
public PhotoLoaderAsyncTask(Photo photo, float resolution, View view) {
this.photo = photo;
this.resolution = resolution;
this.view = view;
Expand Down
8 changes: 4 additions & 4 deletions photobox/src/com/photobox/files/ResolutionLadder.java
Expand Up @@ -11,13 +11,13 @@
public class ResolutionLadder {

private float resolution;
private AsynchPhotoLoader asynchPhotoLoader;
private AsyncPhotoLoader asyncPhotoLoader;
private ResolutionLadder nextLevel;
private SizedQueue<Photo> photoQueue;

public ResolutionLadder(int maxPhotosAllowed, float resolution, AsynchPhotoLoader asynchPhotoLoader, ResolutionLadder nextLevel) {
public ResolutionLadder(int maxPhotosAllowed, float resolution, AsyncPhotoLoader asyncPhotoLoader, ResolutionLadder nextLevel) {
this.resolution = resolution;
this.asynchPhotoLoader = asynchPhotoLoader;
this.asyncPhotoLoader = asyncPhotoLoader;
this.nextLevel = nextLevel;
photoQueue = new SizedQueue<Photo>(maxPhotosAllowed);
}
Expand Down Expand Up @@ -65,7 +65,7 @@ private void enqueue(Photo photo, boolean fiddleWithBitmaps) {
}

private void loadWithRes(float res, Photo p) {
asynchPhotoLoader.addLoadingTask(p, res);
asyncPhotoLoader.addLoadingTask(p, res);
}

}

0 comments on commit 3d03820

Please sign in to comment.