/**
  * Load a picture from assets.
  *
  * <p>This method will throw RuntimeException if the image file does not exist.
  *
  * @param context
  * @param assetPath The image file path in the assets folder. For example, if the image file is
  *     <code>assets/images/abc.png</code>, then assetPath is <code>images/abc.png</code>
  * @return
  */
 public static Bitmap loadBitmapFromAssetNoThrow(Context context, String assetPath) {
   try {
     return loadBitmapFromAsset(context, assetPath);
   } catch (IOException e) {
     throw ErrorUtil.runtimeException(e);
   }
 }
Пример #2
0
 @Override
 public void apply(Instruction instruction) {
   switch (instruction.getSyllable().getMedialJamo()) {
     case A:
       instruction.setDirectionModifier(DirectionModifier.Rigth);
       break;
     case Eo:
       instruction.setDirectionModifier(DirectionModifier.Left);
       break;
     case U:
       instruction.setDirectionModifier(DirectionModifier.Down);
       break;
     case O:
       instruction.setDirectionModifier(DirectionModifier.Up);
       break;
     case Ya:
       instruction.setDirectionModifier(DirectionModifier.DoubleRigth);
       break;
     case Yeo:
       instruction.setDirectionModifier(DirectionModifier.DoubleLeft);
       break;
     case Yu:
       instruction.setDirectionModifier(DirectionModifier.DoubleDown);
       break;
     case Yo:
       instruction.setDirectionModifier(DirectionModifier.DoubleUp);
       break;
     case Eu:
       instruction.setDirectionModifier(DirectionModifier.MirrorVertical);
       break;
     case I:
       instruction.setDirectionModifier(DirectionModifier.MirrorHorizontal);
       break;
     case Ui:
       instruction.setDirectionModifier(DirectionModifier.MirrorBoth);
       break;
     default:
       ErrorUtil.error(instruction, invalidDirection, "invalid direction modifier");
       break;
   }
 }