# StackOverView **Repository Path**: HarmonyOS-tpc/StackOverView ## Basic Information - **Project Name**: StackOverView - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-17 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # StackOverView ## Introduction This library is used to show stack of cards. ### Features Allow to create stack of cards. Allow to dismiss the card on left or right swipe. Allow to scroll the cards list to up and down. ## Usage Instructions Step 1. Create the stack in resource file. ``` ``` Step 2. Create the task view list. ``` ArrayList models = new ArrayList<>(); for (int i = 0; i < 10; ++i) { Random random = new Random(); random.setSeed(i); RgbColor color = new RgbColor(random.nextInt(255), random.nextInt(255), random.nextInt(255)); models.add(color); } ``` Step 3. Create and populate the task view and set adapter with task view. ``` OverviewAdapter stack = new OverviewAdapter, RgbColor>(models) { @Override public ViewHolder onCreateViewHolder(Context context, ComponentContainer parent) { Component v = LayoutScatter.getInstance(context).parse(ResourceTable.Layout_recents_dummy,null,false); return new ViewHolder(v); } @Override public void onBindViewHolder(ViewHolder viewHolder) { ShapeElement shapeElement = new ShapeElement(); shapeElement.setRgbColor(viewHolder.model); viewHolder.itemView.setBackground(shapeElement); }}; mRecentsView.setTaskStack(stack); ``` ## Installation tutorial Solution 1: local har package integration 1. Add the .har package to the lib folder. 2. Add the following code to the gradle of the entry: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) } Solution 2: Add following dependencies in your build.gradle: dependencies { implementation project(':lib') }