1 Star 0 Fork 0

OSCHINA-MIRROR/HarmonyOS-tpc-cardslib

Clone/Download
Contribute code
Sync code
Cancel
Hint: Since Git does not support empty folders, creating a folder will generate an empty .keep file.
Loading...
README.md

Card Library

Card Library предоставляет простой способ отображения пользовательского интерфейса (UI) Card с использованием официального Google CardView в вашем домашнем приложении.

Как собрать?

  1. Удалите видимый тег из файла config.json.
  2. Для выполнения требований к запуску используйте DevEco Studio и загрузите openHarmonySDK. Измените версию зависимостей → classpath в файле build.gradle на соответствующую версию (то есть версию, используемую в новом проекте вашей IDE).

Как использовать для своего проекта?

Gradle:

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

Использование

Создание карточки

//Создание карточки
Card card = new Card(this);

//Создание заголовка карточки
CardHeader header = new CardHeader(this);

//Установка заголовка
try {
    header.setTitle(getResourceManager().getElement(ResourceTable.String_demo_header_basetitle).getString());
} catch (Exception e) {
    HiLog.error(Constants.LABEL_LOG, e.toString());
}

card.addCardHeader(header);

//Добавление карточки в CardView
CardView cardView = (CardView) findComponentById(ResourceTable.Id_carddemo_header_std);
cardView.setCard(card);

Добавление CardExpand

header.setButtonExpandVisible(true);
//Это обеспечивает простую (и бесполезную) область расширения
CardExpand expand = new CardExpand(this);
//Установка внутреннего заголовка в области расширения
try {
    expand.setTitle(getResourceManager().getElement(ResourceTable.String_demo_expand_basetitle).getString());
} catch (Exception e) {
    HiLog.error(Constants.LABEL_LOG, e.toString());
}
card.addCardExpand(expand);

Скриншоты

Карточка с заголовком Карточка с расширением
Материалная карточка Верхняя цветная карточка
:---: :---:
Базовая карточка списка Обновлённая карточка
:---: :---:
Различная компоновка списка Секционированный список
:---: :---:
Разное Цветные карточки
:---: :---:

Лицензия

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.

Comments ( 0 )

You can comment after Login

Introduction

No description available Expand Collapse
Apache-2.0
Cancel

Releases

No releases yet

Contributor

All

Recent Activities

Load more
No more results to load
1
https://gitlife.ru/oschina-mirror/HarmonyOS-tpc-cardslib.git
git@gitlife.ru:oschina-mirror/HarmonyOS-tpc-cardslib.git
oschina-mirror
HarmonyOS-tpc-cardslib
HarmonyOS-tpc-cardslib
master