ILayoutRender.java 3.93 KB

/*
 * Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
 */

package com.wd.display.comp.layoutmanager;

import java.util.List;

import androidx.annotation.NonNull;

import com.people.component.comp.layoutdata.AbsPage;
import com.people.component.comp.layoutdata.AbsSection;
import com.people.component.comp.layoutdata.Page;

/**
 * Page 布局渲染器, 将comp渲染到页面上
 * 
 * @author wd
 */
public interface ILayoutRender {
    /**
     * 从startIndex开始有count个item被移除
     *
     * @param startIndex 移除item范围的开始位置
     * @param count 移除item的个数
     */
    void itemRangeRemoved(int startIndex, int count);

    /**
     *  移除置指定的item
     * @param positon
     */
    void itemRemoved(int positon);

    /**
     * 依据LayoutManager的 HashCode值删除对应的LayoutManager
     * @param hashCode
     */
    void itemRemovedByLayoutManagerHashCode(int hashCode);

    /**
     * 从startIndex开始添加count个item
     *
     * @param startIndex 添加item范围的开始位置
     * @param count 添加item的个数
     */
    void itemRangeInserted(int startIndex, int count);

    /**
     * 从startIndex开始有count个item数据被更新
     *
     * @param startIndex 更新item范围的开始位置
     * @param count 更新item的个数
     */
    void itemRangeChanged(int startIndex, int count);
    //
    // /**
    // * 获取在position位置的item对应的ItemLayoutManager
    // *
    // * @param position adapter position
    // */
    // ILayoutManager layoutManagerAtPosition(int position);

    /**
     * 渲染页面
     *
     * @param page Page实例
     */
    void renderPage(AbsPage page,boolean isRefresh);

    // /**
    // * 渲染overlay浮层
    // *
    // * @param overlay 浮层实例定义
    // */
    // void renderOverlay(List<MGOverlay> overlay);
    //
    // /**
    // * 获取从位置start启到end之间的所有布局管理器
    // *
    // * @param start 启示位置
    // * @param end 结束位置
    // * @return 从位置start启到end之间的所有布局管理器列表
    // */
    // List<ILayoutManager> layoutManagerForRange(int start, int end);
    //
    // /**
    // * 获取Page中Item总条数
    // *
    // * @return
    // */
    // int getItemCount();
    //

    /**
     * 获取所有comp 的布局管理器
     * 
     * @return list
     */
    List<ItemLayoutManager> getAllSectionLayoutManager();

    //
    //
    // void refreshGroup(AbsGroup group, boolean needNotify);
    //
    // void refreshSection(AbsSection section, boolean needNotify);
    //
    // /**
    // * section中item被删除,并更新section的索引,后续所有section的索引也会被更新
    // *
    // * @param section 需要更新索引的section
    // * @param start 删除item的开始位置, item处在section中的相对位置
    // * @param count item删除的个数
    // * @param needNotify 申明是否需要通知页面刷新数据
    // */
    // void sectionItemRemoved(AbsSection section, int start, int count, boolean needNotify);
    //
    // /**
    // * section中添加新的item,并更新section的索引,后续所有section的索引也会被更新
    // *
    // * @param section 需要更新索引的section
    // * @param start 删除item的开始位置, item处在section中的相对位置
    // * @param count item删除的个数
    // * @param needNotify 申明是否需要通知页面刷新数据
    // */
    // void sectionItemInserted(AbsSection section, int start, int count, boolean needNotify);
    //
    /**
     * section中添加新的item,并更新section的索引,后续所有section的索引也会被更新
     *
     * @param section 需要更新索引的section
     */
    void sectionItemUpdated(@NonNull AbsSection section);

    /**
     * notifyDataSetChanged
     */
    void notifyDataSetChanged();

    void releaseLayoutManagers();

    void addBaseLine(Page mPage);

}