# Path: android_env/components/action_type.py
# class ActionType(enum.IntEnum):
#   TOUCH = 0
#   LIFT = 1
#   REPEAT = 2


from typing import Dict
from android_env.components import action_type
from android_env.proto import task_pb2
from dm_env import specs
import dm_env
import numpy as np
  Args:
    num_fingers: Number of virtual fingers of the agent.
  Returns:
    A dict of action specs, each item corresponding to a virtual finger.
    action_type: An integer of type ActionType: TOUCH=0, LIFT=1, REPEAT=2
    touch_position: Position [x, y] of the touch action, where x, y are float
      values between 0.0 and 1.0 corresponding to the relative position on the
      screen. IGNORED when (action_type != ActionType.TOUCH).
    action_type_i: Action type for additional fingers (i>1).
    touch_position_i: Touch position for additional fingers (i>1).
  """

  action_spec = {
      'action_type':
          specs.DiscreteArray(
              num_values=len(action_type.ActionType),
              name='action_type'),
      'touch_position':
          specs.BoundedArray(
              shape=(2,),
              dtype=np.float32,
              minimum=[0.0, 0.0],
              maximum=[1.0, 1.0],
              name='touch_position'),
  }

  for i in range(2, num_fingers + 1):
    action_spec.update({
        f'action_type_{i}':
            specs.DiscreteArray(

# Path: android_env/components/action_type.py
# class ActionType(enum.IntEnum):
#   TOUCH = 0
#   LIFT = 1
#   REPEAT = 2


# Path: android_env/components/specs.py
from typing import Dict
from android_env.components import action_type
from android_env.proto import task_pb2
from dm_env import specs
import dm_env
import numpy as np

  Args:
    num_fingers: Number of virtual fingers of the agent.
  Returns:
    A dict of action specs, each item corresponding to a virtual finger.
    action_type: An integer of type ActionType: TOUCH=0, LIFT=1, REPEAT=2
    touch_position: Position [x, y] of the touch action, where x, y are float
      values between 0.0 and 1.0 corresponding to the relative position on the
      screen. IGNORED when (action_type != ActionType.TOUCH).
    action_type_i: Action type for additional fingers (i>1).
    touch_position_i: Touch position for additional fingers (i>1).
  """

  action_spec = {
      'action_type':
          specs.DiscreteArray(
              num_values=len(action_type.ActionType),
              name='action_type'),
      'touch_position':
          specs.BoundedArray(
              shape=(2,),
              dtype=np.float32,
              minimum=[0.0, 0.0],
              maximum=[1.0, 1.0],
              name='touch_position'),
  }

  for i in range(2, num_fingers + 1):
    action_spec.update({
        f'action_type_{i}':
            specs.DiscreteArray(

                num_values=len(action_type.ActionType),