Проект ExpandableHeightListView
Описание проекта:
Демонстрация эффекта:
[Рисунок: printscreen/screenshot.gif]
Инструкция по установке:
allprojects {
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
}
dependencies {
implementation('com.gitee.chinasoft_ohos:expandableHeightListView:1.0.0')
......
}
Проект можно запустить напрямую на SDK6 и DevEco Studio 2.2 Beta1. Если проект не запускается, удалите файлы .gradle, .idea, build, gradle, build.gradle и создайте новый проект с соответствующей версией. Затем скопируйте файлы из нового проекта в корневой каталог.
Использование:
<com.github.paolorotolo.expandableheightlistview.ExpandableHeightListView
ohos:id="$+id:expandable_listview"
ohos:height="match_content"
ohos:long_click_enabled="false"
ohos:width="match_parent"
ohos:padding="8vp">
</com.github.paolorotolo.expandableheightlistview.ExpandableHeightListView>
ExpandableHeightListView expandableListView = (ExpandableHeightListView) findComponentById(ResourceTable.Id_expandable_listview);
for (int i = 0; i <= 20; i++) {
arrayList.add(i);
}
expandableListView.setExpanded(true);
expandableListView.setProvider(this, arrayList);
<com.github.paolorotolo.expandableheightlistview.ExpandableHeightGridView
ohos:id="$+id:expandable_gridview"
ohos:height="match_content"
ohos:width="match_parent"
ohos:long_click_enabled="false"
ohos:padding="8vp">
</com.github.paolarotolo.expandableheightlistview.ExpandableHeightGridView>
gridListContainer = (ExpandableHeightGridView) findComponentById(ResourceTable.Id_expandable_gridview);
ArrayList<Integer> arrayList = new ArrayList<>();
for (int i = 0; i <= 20; i++) {
arrayList.add(i);
}
int padding = gridListContainer.getPaddingLeft() + gridListContainer.getPaddingRight();
DirectionalLayout componentParent = (DirectionalLayout) gridListContainer.getComponentParent();
int paddingPar = componentParent.getPaddingLeft() + componentParent.getPaddingRight();
gridListContainer.setExpanded(true);
gridListContainer.setProvider(3, arrayList, padding, paddingPar);
Тестирование:
CodeCheck — тестирование кода без исключений. CloudTest — тестирование кода без исключений. Вирусная безопасность — проверка пройдена. Текущая версия demo функционально не отличается от исходного компонента.
Версии:
— 1.0.0; — 0.0.1-SNAPSHOT.
Авторские права и лицензии:
Apache License 2.0.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )