Skip to content

[Feature] Add new examples for Android #61

@Angelk90

Description

@Angelk90

Feature Description

  1. Examples that update in real time.
Image
  1. Examples that allow you to have buttons like in the image and execute functions in js, inside there could be an http call that activates a service.
Image
  1. Examples that take data from http api, to show the updated real-time result.
Image
  1. Have an example that allows you to click on a refresh image, it allows you to update the component.
import { VoltraAndroid } from 'voltra'
import { useState } from 'react'

export const  TimeWidget = () => {
  const [time, setTime] = useState<string>(
    new Date().toLocaleTimeString()
  )

  const refresh = () => {
    setTime(new Date().toLocaleTimeString())
  }

  return (
    <VoltraAndroid.Column
      style={{
        backgroundColor: '#FFFFFF',
        width: '100%',
        height: '100%',
        padding: 16,
      }}
      horizontalAlignment="center-horizontally"
      verticalAlignment="center-vertically"
    >
      <VoltraAndroid.Text>{time}</VoltraAndroid.Text>
      <VoltraAndroid.Image
        source={{ assetName: 'refresh' }}
        style={{ width: 100, height: 100, borderRadius: 8, marginTop: 16 }}
        onClick={refresh}
      />
    </VoltraAndroid.Column>
  )
}

Problem Statement

Having more examples would help us fully understand how to use this library.

Proposed Solution

No response

Alternatives Considered

No response

Current Library Version

1.1.2

Implementation

  • I would be willing to submit a pull request for this feature

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions