Card Library
Card Library предоставляет простой способ отображения пользовательского интерфейса (UI) Card с использованием официального Google CardView в вашем домашнем приложении.
Как собрать?
Как использовать для своего проекта?
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);
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.
You can comment after Login
Inappropriate content may be displayed here and will not be shown on the page. You can check and modify it through the relevant editing function
If you confirm that the content does not involve inappropriate language/advertisement redirection/violence/vulgar pornography/infringement/piracy/false/insignificant or illegal content related to national laws and regulations, you can click submit to make an appeal, and we will handle it as soon as possible.
Comments ( 0 )