鸿蒙开源组件——自定义卡片

jacksky
发布于 2022-2-22 17:33
浏览
0收藏

Swipecards

本项目是基于开源项目Swipecards进行鸿蒙化的移植和开发的,可以通过项目标签以及github地址(https://github.com/Diolor/Swipecards)追踪到原安卓项目版本

项目介绍

自定义卡片,左右飞滑删除卡片,上下滑卡片回弹复位。

片,左右飞滑删除卡片,上下滑卡片回弹复位鸿蒙开源组件——自定义卡片-鸿蒙开发者社区

集成

方式一:
添加har包到entry模块libs文件夹
在entry的gradle内添加如下代码:
implementation fileTree(dir: 'libs', include: ['.jar', '.har'])

方式二:
allprojects {
    repositories {
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:Swipecards:1.0.2'

使用教程

1、xml布局里添加SwipeFlingAdapterView

    <com.lorentzos.flingswipe.SwipeFlingAdapterView
        ohos:id="$+id:frame"
        ohos:width="match_parent"
        ohos:height="match_parent"
        ohos:background_element="$graphic:background_ability_main"/>

 

2、Ability中添加

flingContainer = (SwipeFlingAdapterView) findComponentById(ResourceTable.Id_frame);
mProvider = new BaseAdapter(this);
mProvider.setData(al);
flingContainer.setItemProvider(mProvider);

版权和许可信息

   Copyright 2014 Dionysis Lorentzos

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Swipecards-master.zip 869.3K 7次下载
已于2022-2-22 17:33:10修改
收藏
回复
举报
回复
    相关推荐