Exemplo n.º 1
0
  private void createCards() {
    properties = new ArrayList<Card>();

    Card house1 = new Card(this);
    house1.setText("First house");
    house1.setFootnote("Footer");
    properties.add(house1);

    Card house2 = new Card(this);
    house2.setText("House2");
    house2.setImageLayout(Card.ImageLayout.LEFT);
    // house2.addImage(uri)
    properties.add(house2);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mCard = new Card(this);

    mCard.setImageLayout(ImageLayout.LEFT);
    mCard.addImage(R.drawable.ic_angle_150);
    mCard.setFootnote(R.string.tap_to_set_angle);

    mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    mGravity = mSensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);

    setContentView(mCard.getView());
  }