App
APDImagePresentation.java
Go to the documentation of this file.
1 package mhr.appandroid.adapters;
2 
3 import android.app.Activity;
4 import android.graphics.Bitmap;
5 
6 import mhr.appcore.interfaces.PDBitmap;
7 import mhr.appcore.interfaces.PDImageDataPresentation;
8 
13 
14  //===== INTERFACES, CLASSES, ENUMS ==========================================================================================================//
15  //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
16  //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
26  }
27 
28  //===== FIELDS ==============================================================================================================================//
29  //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
30  protected int layerThumbWidth;
31  protected int layerThumbHeight;
32  protected int maskThumbWidth;
33  protected int maskThumbHeight;
34 
36  protected Activity activity = null;
37  //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
38 
39  //===== CONSTRUCTORS, DESTRUCTORS, RELATED METHODS ==========================================================================================//
40  //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
41  //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
50  this.layerThumbWidth = layerThumbWidth;
51  this.layerThumbHeight = layerThumbHeight;
52  this.maskThumbWidth = maskThumbWidth;
53  this.maskThumbHeight = maskThumbHeight;
54  }
55 
56  //===== METHODS =============================================================================================================================//
57  //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
58  //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
65  this.listener = listener;
66  this.activity = activity;
67  }
68 
69  @Override
71  return new APDBitmap(Bitmap.createBitmap(layerThumbWidth, layerThumbHeight, Bitmap.Config.ARGB_8888));
72  }
73 
74  @Override
76  return new APDBitmap(Bitmap.createBitmap(maskThumbWidth, maskThumbHeight, Bitmap.Config.ALPHA_8));
77  }
78 
79  @Override
80  public void hasChanged() {
81  if (listener != null && activity != null) {
82  activity.runOnUiThread(new Runnable() {
83  @Override
84  public void run() {
86  }
87  });
88  }
89  }
90 
91 }