npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nexle-tvguide-lib

v1.0.6

Published

TV guide library for Android TV

Downloads

5

Readme

React Native Android TVGuide

An Android TV Guide programs React Native applications.

Default UI screen

Custom styles screen

  • [x] EPG component
    • Material design similar to Android TV's Live Channels app
    • Supports extended data fields (channel logos, programme series/episode information, programme images, etc)
    • Supports custom actions for programmes (e.g. Open in BBC iPlayer)
    • Renderer support:
      • [x] React Native
      • Supports and directional controls for TVs
    • TODO:
      • [x] Automatic directional controls handling with react-native-tvos
      • [x] Automatically scroll when using directional controls
      • [x] Support using a custom colour scheme
      • [x] Support callback function to get program focused
      • [x] Support slient load more programs by date
      • [x] Hooks for loading additional data when scrolling to the end of the loaded data
      • [x] Shows the current and next programme and it's start tim

Data

Data is provided in formats defined.

export interface Channel {
  id: number;
  externalChannelId: string;
  description?: string;
  number: number;
  name: string;
  assest: string;
  url?: string;
  category?:string
}

const channeList: Channel[] = [
    // ...
];

export interface Program {
  id: number;
  name: string;
  shortName: string;
  serisName?: string;
  description?: string;
  prName: string;
  startDate: Date;//timestamp
  endDate: Date;//timestamp
  referanceProgramId: string;
  flags: number;
  seriesSeasion?: string;
  responseElementType: string;
  price: number
}
const programList: Program[] = [
    // ...
];

Import to your app:


Import TVGuide component with default properties below:

  • [x] tvGuideWidth: Width of TV guide component, default Device Width screen size;// important!
  • [x] tvGuideHeight: Height of TV guide component, default = (3/4) * Device height screen size;// important!
  • [x] channeList: list channels width array data example data type Channel above ;// important!
  • [x] programList: list programs width array data example data type Program above;// important!
  • [x] currentDate: The date current display data TVGuide component;// important! support for load multiple days
  • [x] onDateChanged: Functions call back when current date display changed : return Date // important!
  • [x] onProgramFocusChange: Functions call back when current program focused changed : return Program // important!
  • [x] onSilentLoadMorePrograms: Functions call back when focus to index programs need to load next day progrograms or previos day
import React from 'react'
import { View, Text } from 'react-native';
import { TVGuide, TV_GUIDE_CONSTANTS } from "nexle-tvguide-lib";

export default function doc() {
    return (
        <View>
          <TVGuide
                tvGuideWidth={TV_GUIDE_CONSTANTS.WIDTH_DEVICE}
                tvGuideHeight={TV_GUIDE_CONSTANTS.HEIGHT_DEVICE * 3 / 4}
                channeList={listChannels}
                programList={programsCurrentDisplay}
                onReachingEndChannel={onReadEndChannelsPrograms}
                currentDate={currentDateDisplay}
                onDateChanged={onDateChanged}
                onProgramFocusChange={onProgramFocusChange}
                onSilentLoadMorePrograms={onSilentLoadMorePrograms}
            />
        </View>
    )
}

Custom Configs layout TVGuide component:


You can change layout:

  • [x] timeLineHeaderHeight: Height time line header default = 50;
  • [x] numberShowChannel: Number channels display in TVGuide component, default = 4
  • [x] numberShowTimeLine: Number Time cell in time line header default 4;// equal 2 hours: 30 minutes per cell
  • [x] widthChannelList: Width list channels left of TV Guide component default = 200;
  • [x] numberDatesFuture: Number Dates Can show in the future, default = 3;
  • [x] numberDatesPast: Number Dates Can show in the past, default = 3;
import React from 'react'
import { View, Text } from 'react-native';
import { TVGuide, TV_GUIDE_CONSTANTS } from "nexle-tvguide-lib";

export default function doc() {
    return (
        <View>
          <TVGuide
                tvGuideWidth={TV_GUIDE_CONSTANTS.WIDTH_DEVICE}
                tvGuideHeight={TV_GUIDE_CONSTANTS.HEIGHT_DEVICE * 7 / 10}
                timeLineHeaderHeight={50}
                numberShowChannel={4}
                numberShowTimeLine={6}
                widthChannelList={150}
                channeList={listChannels}
                programList={programsCurrentDisplay}
                numberDatesFuture={3}
                numberDatesPast={2}
                onReachingEndChannel={onReadEndChannelsPrograms}
                currentDate={currentDateDisplay}
                onDateChanged={onDateChanged}
                onProgramFocusChange={onProgramFocusChange}
                onSilentLoadMorePrograms={onSilentLoadMorePrograms}
            />
        </View>
    )
}

Custom Styles background color, text color...


You can custom UI TV Guide components with styles:

import React from 'react'
import { View, Text } from 'react-native';
import { TVGuide, TV_GUIDE_CONSTANTS } from "nexle-tvguide-lib";

export default function doc() {
    return (
        <View>
          <TVGuide
                tvGuideWidth={TV_GUIDE_CONSTANTS.WIDTH_DEVICE}
                tvGuideHeight={TV_GUIDE_CONSTANTS.HEIGHT_DEVICE * 7 / 10}
                programList={programsCurrentDisplay}
                onReachingEndChannel={onReadEndChannelsPrograms}
                currentDate={currentDateDisplay}
                programStylesColors={{
                    activeProgramBackgroundColor: '#fcfcfc',
                    nowTodayProgramBackgroundColor: '#289959',
                    pastProgramBackgroundColor: '#c4c1b5',
                    futureProgramBackgroundColor: '#993328',
                    activeProgramTextColor: '#0ac92a',
                    nowTodayProgramTextColor: '#0a3dc9',
                    pastProgramTextColor: 'grey',
                    futureProgramTextColor: 'white',

                }}
                programContainerStyles={{ borderRadius: 3 }}
                timeIndicatorStyles={{ backgroundColor: '#a6c90a', width: 5, borderRadius: 10 }}
                onDateChanged={onDateChanged}
                onProgramFocusChange={onProgramFocusChange}
                onSilentLoadMorePrograms={onSilentLoadMorePrograms}
            />
        </View>
    )
}