该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

cardslib

Card Library provides an easy way to display a UI Card using the Official Google CardView in your homs app.

How to build?

1.Delete the visible tag from the config.json file.
2.For entry running requirements, use DevEco Studio and download the openHarmonySDK.
Change the dependencies→classpath version in the build.gradle file to the corresponding version. (that is, the version used in your IDE's new project)

How to use for your project?

gradle

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:cardslib_core:1.0.1'
implementation 'io.openharmony.tpc.thirdlib:cardslib_cards:1.0.1'

How to use?

Create a Card

   //Create a Card
        Card card = new Card(this);

        //Create a CardHeader
        CardHeader header = new CardHeader(this);

        //Set the header title
        try {
            header.setTitle(getResourceManager().getElement(ResourceTable.String_demo_header_basetitle).getString());
        } catch (Exception e) {
            HiLog.error(Constants.LABEL_LOG, e.toString());
        }

        card.addCardHeader(header);

        //Set card in the CardView
        CardView cardView = (CardView) findComponentById(ResourceTable.Id_carddemo_header_std);
        cardView.setCard(card);

addCardExpand

         header.setButtonExpandVisible(true);
        //This provides a simple (and useless) expand area
        CardExpand expand = new CardExpand(this);
        //Set inner title in Expand Area
        try {
            expand.setTitle(getResourceManager().getElement(ResourceTable.String_demo_expand_basetitle).getString());
        } catch (Exception e) {
            HiLog.error(Constants.LABEL_LOG, e.toString());
        }
        card.addCardExpand(expand);

##screenshot

card add header card add expand
material_card top_color_expand
:---: :---:
list_base refresh_card
:---: :---:
list_different_layout list_sections
:---: :---:
misc colored_cards
:---: :---:

License

Copyright 2013-2014 Gabriele Mariotti

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.

空文件

简介

Card Library provides an easy way to display a UI Card using the Official Google CardView in your homs app. 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化