コード例 #1
0
 @Override
 public int getNextPart() {
   if (parts.size() > 0) {
     currentPart = parts.get(0);
     parts.remove(0);
     return currentPart;
   }
   return -1;
 }
コード例 #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));
 }
コード例 #3
0
 @Override
 public void solveHint() {
   ((ImageView) ((Activity) photoContext).findViewById(R.id.currentPart))
       .setBackgroundResource(
           getContext()
               .getResources()
               .getIdentifier(colorfiles.get(currentPart), "drawable", curPackage));
   getNextPart();
 }
コード例 #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));
   }
 }
コード例 #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();
     }*/
   }
 }
コード例 #6
0
 public void addSource(String filecode) {
   for (int i = 1; i <= 9; i++) {
     colorfiles.add(filecode + "_" + i);
     blackfiles.add(filecode + "_" + i + "_b");
   }
 }
コード例 #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);
 }