Esempio n. 1
0
 @Override
 public int getNextPart() {
   if (parts.size() > 0) {
     currentPart = parts.get(0);
     parts.remove(0);
     return currentPart;
   }
   return -1;
 }
Esempio n. 2
0
 @Override
 public void updatePartition(int index, String curPackage) {
   ((ImageView) ((Activity) photoContext).findViewById(GlobalResource.partviewID[index]))
       .setBackgroundResource(
           getContext()
               .getResources()
               .getIdentifier(colorfiles.get(index), "drawable", curPackage));
 }
Esempio n. 3
0
 @Override
 public void solveHint() {
   ((ImageView) ((Activity) photoContext).findViewById(R.id.currentPart))
       .setBackgroundResource(
           getContext()
               .getResources()
               .getIdentifier(colorfiles.get(currentPart), "drawable", curPackage));
   getNextPart();
 }
Esempio n. 4
0
 @Override
 public void setResourceOn(String curPackage) {
   super.setResourceOn(curPackage);
   for (int i = 0; i < GlobalResource.PARTITION_PIECE; i++) {
     ((ImageView) ((Activity) photoContext).findViewById(GlobalResource.partviewID[i]))
         .setBackgroundResource(
             getContext().getResources().getIdentifier(blackfiles.get(i), "drawable", curPackage));
   }
 }
Esempio n. 5
0
 @Override
 public void resetTouch() {
   // TODO Auto-generated method stub
   for (int i = 0; i < GlobalResource.PARTITION_PIECE; i++) {
     parts.add(i);
     /*Drawable drawable = ((ImageView)((Activity)photoContext).findViewById(GlobalResource.partviewID[i])).getDrawable();
     if (drawable instanceof BitmapDrawable) {
     BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
     Bitmap bitmap = bitmapDrawable.getBitmap();
     bitmap.recycle();
     }*/
   }
 }
Esempio n. 6
0
 public void addSource(String filecode) {
   for (int i = 1; i <= 9; i++) {
     colorfiles.add(filecode + "_" + i);
     blackfiles.add(filecode + "_" + i + "_b");
   }
 }
Esempio n. 7
0
 public PartitionPhoto(Context context) {
   super(context);
   timeAllow = 25000;
   for (int i = 0; i < GlobalResource.PARTITION_PIECE; i++) parts.add(i);
   Collections.shuffle(parts);
 }