How to use recyclerlistview - 10 common examples

To help you get started, we’ve selected a few recyclerlistview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hummingbird-me / kitsu-mobile / src / screens / Profiles / UserLibrary / components / UserLibraryList / component.js View on Github external
componentWillMount() {
    const dataProvider = new DataProvider((rowA, rowB) => {
      // If the rows are the same
      // Then we check if the data within them is different
      if (rowA.id === rowB.id) {
        return !isEqual(rowA, rowB);
      }

      // Rows are different
      return true;
    }).cloneWithRows(this.props.libraryEntries.slice());
    this.setState({ dataProvider });

    // Only one type of row item
    this.layoutProvider = new LayoutProvider(() => LAYOUT_PROVIDER_TYPE, (type, dim, index) => {
      switch (type) {
        case LAYOUT_PROVIDER_TYPE: {
          dim.width = LAYOUT_WIDTH;
github naqvitalha / recyclerlistview-context-preservation-demo / contextProviderSampleApp / src / MainComponent.js View on Github external
'Raspberries',
            'Strawberries',
            'Tomato',
            'Ugni',
            'Vanilla Bean',
            'Watermelon',
            'Ximenia caffra fruit',
            'Yellow Passion Fruit',
            'Zuchinni'
        ];

        //Every list in parent has its own data provider and context provider which we create here, to know more about this
        //check samples of RecyclerListView
        for (let i = 0; i < this._parentArr.length; i++) {
            this._parentArr[i] = {
                dataProvider: new DataProvider((r1, r2) => {
                    return r1 !== r2;
                }).cloneWithRows(this._childArr),

                //Proving unique key to context provider, using index as unique key here. You can choose your own, this should be
                //unique in global scope ideally.
                contextProvider: new ContextHelper(i + '')
            };
        }
    }
github rainbow-me / rainbow / src / components / send / SendContactList.js View on Github external
render = () => (
    
      {this.state.contacts.length === 0 ? (
        
      ) : (
        
      )}
    
  );
}
github naqvitalha / recyclerlistview-context-preservation-demo / contextProviderSampleApp / src / MainComponent.js View on Github external
//Layout provider for children lists
        this._childRLVLayoutProvider = new LayoutProvider(
            index => {
                return ViewTypes.SIMPLE_ROW;
            },
            (type, dim) => {
                dim.height = 100;
                dim.width = 100;
            }
        );

        this._parentContextProvider = new ContextHelper('PARENT');

        this.state = {
            isViewMounted: true,
            parentRLVDataProvider: new DataProvider((r1, r2) => {
                return r1 !== r2;
            }).cloneWithRows(this._parentArr)
        };
    }
github sskhandek / react-native-emoji-input / example / src / EmojiInput.js View on Github external
emojiRenderer = emojis => {
        let dataProvider = new DataProvider((e1, e2) => {
            return e1.char !== e2.char;
        });

        this.emoji = [];
        let categoryIndexMap = _(category)
            .map((v, idx) => ({ ...v, idx }))
            .keyBy('key')
            .value();

        let tempEmoji = _
            .range(_.size(category))
            .map((v, k) => [
                { char: category[k].key, categoryMarker: true, ...category[k] }
            ]);
        _(emojis)
            .values()
github rainbow-me / rainbow / src / components / change-wallet / ProfileList.js View on Github external
asset: [],
            isCurrentProfile: true,
            onCloseModal: (editedProfile) => onCloseEditProfileModal(editedProfile),
            profile: currentProfile,
            type: 'profile_creator',
          })}
          onTouch={this.closeAllDifferentContacts}
          onTransitionEnd={this.changeCurrentlyUsedContact}
          isInitializationOver={isInitializationOver}
        />}
github rainbow-me / rainbow / src / components / avatar-builder / EmojiSelector.js View on Github external
{showSearchBar && Searchbar}
            {!isReady && (
              
            )}
            
          
        
        {showTabs && (
github Flipkart / recyclerlistview / docs / guides / samplecode / reactnative / Sample1.js View on Github external
constructor(args) {
        super(args);

        let { width } = Dimensions.get("window");

        //Create the data provider and provide method which takes in two rows of data and return if those two are different or not.
        let dataProvider = new DataProvider((r1, r2) => {
            return r1 !== r2;
        });

        //Create the layout provider
        //First method: Given an index return the type of item e.g ListItemType1, ListItemType2 in case you have variety of items in your list/grid
        //Second: Given a type and object set the height and width for that type on given object
        //If you need data based check you can access your data provider here
        //You'll need data in most cases, we don't provide it by default to enable things like data virtualization in the future
        //NOTE: For complex lists LayoutProvider will also be complex it would then make sense to move it to a different file
        this._layoutProvider = new LayoutProvider(
            index => {
                if (index % 3 === 0) {
                    return ViewTypes.FULL;
                } else if (index % 3 === 1) {
                    return ViewTypes.HALF_LEFT;
                } else {
github rainbow-me / rainbow / src / components / asset-list / RecyclerAssetList.js View on Github external
constructor(props) {
    super(props);

    this.state = {
      dataProvider: new DataProvider(hasRowChanged, this.getStableId),
      headersIndices: [],
      isRefreshing: false,
      itemsCount: 0,
    };

    this.layoutProvider = new LayoutProvider(
      index => {
        const { openFamilyTabs, openInvestmentCards, sections } = this.props;

        const { headersIndices } = this.state;
        if (headersIndices.includes(index)) {
          return ViewTypes.HEADER;
        }

        if (index === this.state.itemsCount - 1) {
          return ViewTypes.FOOTER;

recyclerlistview

The listview that you need and deserve. It was built for performance, uses cell recycling to achieve smooth scrolling.

Apache-2.0
Latest version published 5 months ago

Package Health Score

82 / 100
Full package analysis