예제 #1
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   matrix.set(getImageMatrix());
   switch (msg.what) {
     case 1:
       if (!isFinish) {
         return;
       } else {
         isFinish = false;
         count = 0;
         s = (float) Math.sqrt(Math.sqrt(minScale));
         BeginScale(matrix, s);
         handler.sendEmptyMessage(2);
       }
       break;
     case 2:
       BeginScale(matrix, s);
       if (count < 4) {
         handler.sendEmptyMessage(2);
       } else {
         isFinish = true;
         if (!isActionMove && onclick != null) {
           onclick.onClick();
         }
       }
       count++;
       break;
     case 6:
       if (!isFinish) {
         handler.sendEmptyMessage(6);
       } else {
         isFinish = false;
         count = 0;
         s = (float) Math.sqrt(Math.sqrt(1.0f / minScale));
         BeginScale(matrix, s);
         handler.sendEmptyMessage(2);
       }
       break;
   }
 }
예제 #2
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   matrix.set(getImageMatrix());
   switch (msg.what) {
     case 1:
       count = 0;
       BeginRolate(matrix, (XbigY ? count : 0), (XbigY ? 0 : count));
       rolateHandler.sendEmptyMessage(2);
       break;
     case 2:
       BeginRolate(matrix, (XbigY ? count : 0), (XbigY ? 0 : count));
       if (count < getDegree()) {
         rolateHandler.sendEmptyMessage(2);
       } else {
         isFinish = true;
       }
       count++;
       count++;
       break;
     case 3:
       BeginRolate(matrix, (XbigY ? count : 0), (XbigY ? 0 : count));
       if (count > 0) {
         rolateHandler.sendEmptyMessage(3);
       } else {
         isFinish = true;
         if (!isActionMove && onclick != null) {
           onclick.onClick();
         }
       }
       count--;
       count--;
       break;
     case 6:
       count = getDegree();
       BeginRolate(matrix, (XbigY ? count : 0), (XbigY ? 0 : count));
       rolateHandler.sendEmptyMessage(3);
       break;
   }
 }