1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/HarmonyOS-tpc-StatusView

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать

A permissive license whose main conditions require preservation of copyright and license notices. Contributors provide an express grant of patent rights. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

Permissions
  • Commercial use
  • Modification
  • Distribution
  • Patent use
  • Private use
Limitations
  • Trademark use
  • Liability
  • Warranty
Conditions
  • License and copyright notice
  • State changes
README.md 3.3 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
gitlife-traslator Отправлено 30.11.2024 16:01 e5f6738

StatusView

Компонент пользовательского состояния системы openharmony.

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

Добавьте в XML:

Если вы хотите использовать ConnectionStatusView:

<iammert.com.library.ConnectionStatusView
        ohos:id="$+id:status"
        ohos:width="match_parent"
        ohos:height="50vp"
        ohos:dismissOnComplete="true" />

Если вы хотите использовать собственный макет для получения статуса:

<iammert.com.library.StatusView
        ohos:id="$+id:/status"
        ohos:layout_width="match_parent"
        ohos:layout_height="48dp"
        ohos:dismissOnComplete="true"
        ohos:complete="$layout:custom_layout_complete"
        ohos:error="$layout:custom_layout_error"
        ohos:loading="$layout:custom_layout_loading"/>

Затем вызовите методы состояния:

statusView.setStatus(Status.LOADING);
statusView.setStatus(Status.ERROR);
statusView.setStatus(Status.COMPLETE);
statusView.setStatus(Status.IDLE); //hide status

Чтобы автоматически закрыть после вызова oncomplete, добавьте app:dismissOnComplete = "true" в качестве атрибута.

Получение Вы можете добавить пользовательский вид для всех состояний (ошибка / завершение / загрузка). Кроме того, вы можете получить этот вид, чтобы управлять содержащимися в нём элементами пользовательского интерфейса, такими как кнопки или изображения:

View viewError = statusView.getErrorView();
View viewComplete = statusView.getCompleteView();
View viewLoading = statusView.getLoadingView();

Слушатели

statusView.setOnErrorClickListener(listener);
statusView.setOnLoadingClickListener(listener);

Требования к запуску entry

Запустите через DevEco studio и загрузите openharmonySDK. В файле build.gradle в разделе dependencies → classpath версии проекта измените на соответствующую версию (то есть версию, которую вы используете в новом проекте, созданном в вашей текущей среде IDE).

Интеграция

allprojects{
    repositories{
        mavenCentral()
    }
}
implementation 'io.openharmony.tpc.thirdlib:StatusView:1.0.3'

Лицензия Copyright 2017 Mert Şimşek.

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.

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/HarmonyOS-tpc-StatusView.git
git@api.gitlife.ru:oschina-mirror/HarmonyOS-tpc-StatusView.git
oschina-mirror
HarmonyOS-tpc-StatusView
HarmonyOS-tpc-StatusView
master