Git Product home page Git Product logo

voir-native's Introduction

voir native

Voir Native

It is a framework to develop android and ios applications in a more organized way with tabrisjs


Documentation

Getting Started

when installing voir-native installs with the dependency of tabrisjs you can go to the documentation of tabrisjs and see the entire list of widgets, services and more.

Installation

execute command

npm i voir-native

Helpers View

addView

addView function adds views to the CoordinatePage

parameter types
...Array<tabris.Action | tabris.Page>

example

import addView, { CoordinatePage } from "voir-native";
import { Action, Page, contentView } from "tabris";

contentView.append(<CoordinatePage layoutData="stretch" />);

addView(<Action title="setting" />, <Page title="setting" stretch />);

menuDrawer

parameter types
Array<IMenuItemOption>
interface IMenuItemOption {
  id: string;
  text: string;
  image?: string;
}

example

import { menuDrawer } from "voir-native";
import { drawer } from "tabris";

drawer.enabled = true;

menuDrawer([
  {
    text: "home",
    id: "home",
    image: "/images/home.png",
  },
  {
    text: "favorite",
    id: "favorite",
    image: "/images/favorite.png",
  },
  {
    text: "configure",
    id: "config",
    image: "/images/settings.png",
  },
]);

popup

displays as a popup element in the user interface

Toast

show popup message with duration time

method parameter types
contructor string, number
static makeToast string, number
show

example

import { Toast } from "voir-native";

Toast.makeText("hello");

Modal

displays a popup that represents a view

method parameter types return
addView ...Widget[]
setButtonCancel string tabris.Listeners
setButtonAccept string tabris.Listeners
remove
removeView
removeButtons
show

example

import { Modal } from "voir-native";
import {TextView} from "tabris";

const modal = new Modal();

modal.addView(
    <TextView text="this is my text" />
);

modal.setButtonCancel("cancel").addListener(() => {
    modal.remove();
});

modal.setButtonAccept("accept").addListener(() => {
    modal.remove();
});

modal.show();

helpers storage

setPreference

añade nuevo datos de preferencia

parameter types
string
any

getValuePreference

recupera el valor de preferencia

parameter types return
string any

existsKeyPreference

comprueba si existe la preferencia

parameter types return
string boolean

Components

Preference

to add preferences where data can be saved in which the user preference persists

properties received by default to:

  • ListPreference
  • SwitchPreference
  • CheckBoxPreference
property type
title string
summary string
key string
value string | boolean | number
onSelect (event: any)=> any

PreferenceScreen

create preference page

ListPreference

create a modal displaying a view of options to select

received aditional property

property type
entries IEntry[]
interface IPropertyListPreference extends IPropertyChildPreference {
  entries: IEntry[];
}

interface IEntry {
  text: string;
  id: string;
}

TextPreference

property type
title string
summary string
onSelect (event: any)=> any

Example

import {
  PreferenceScreen,
  TextPreference,
  SwitchPreference,
  CheckBoxPreference,
  ListPreference,
} from "voir-native";
import { contentView } from "tabris";

contentView.append(
  PreferenceScreen({
    layoutData: "stretch",
  }).append(
    TextPreference({
      title: "text info",
      summary: "summary",
    }),
    SwitchPreference({
      title: "title",
      summary: "summary",
      key: "keySwitch",
      value: true,
    }),
    CheckBoxPreference({
      title: "title",
      summary: "summary",
      key: "cbPreference",
      value: false,
    }),
    ListPreference({
      title: "my list preference",
      key: "list",
      value: 0, // default value select
      entries: [{ id: "myId", text: "item 1" }],
    })
  )
);

CoordinatePage

handles the elements of a current page

import { CoordinatePage } from "voir-native";

import { contentView } from "tabris";

contentView.append(
  CoordinatePage({
    layoutData: "stretch",
    drawerActionVisible: true,
  })
);

// or

contentView.append(<CoordinatePage layoutData="stretch" />);



new features will be added little by little

voir-native's People

Contributors

everskyblue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.