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

OSCHINA-MIRROR/HarmonyOS-tpc-SectorProgressView

Присоединиться к 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 4.5 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
gitlife-traslator Отправлено 25.11.2024 20:42 8efa50e

Данный текст описывает библиотеку с открытым исходным кодом SectorProgressView, которая была разветвлена (forked) из репозитория на GitHub.

Fork адрес: https://github.com/timqi/SectorProgressView

Версия и дата: версия 0.9.9 от 7 февраля 2021 года.

SectorProgressView

Эффект демонстрации

Демонстрация эффекта работы библиотеки представлена в виде двух изображений:

Добавление библиотеки в проект

Есть два способа добавить библиотеку в проект:

  1. Добавить har-пакет в папку libs и добавить следующий код в файл gradle:
    implementation fileTree(dir: 'libs', include: ['.jar', '.har'])
  2. В файле gradle добавить следующую строку:
    allprojects { repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:SectorProgressView:1.0.0'

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

The ColorfulRingProgressView

Определение вида в XML:

<com.timqi.sectorprogressview.ColorfulRingProgressView
             ohos:id="$+id:crpv"
             ohos:width="match_parent"
             ohos:height="match_parent"
             app:bgColor="#e1e1e1"
             app:fgColorEnd="#ff4800"
             app:fgColorStart="#ffe400"
             app:percent="75"
             app:startAngle="0"
             app:strokeWidth="21vp" />

Описание параметров: Изображение d.png не представлено в тексте запроса. — Настройка вида с помощью Java-кода:

crpv = (ColorfulRingProgressView) findViewById(R.id.crpv);
crpv.setPercent(75);
crpv.setStartAngle(0);
crpv.setBgColor(0xffe1e1e1);
crpv.setFgColorStart(0xffffe400);
crpv.setFgColorEnd(0xffff4800);
crpv.setStrokeWidthDp(21);

The SectorProgressView

Определение вида в XML:

<com.timqi.sectorprogressview.SectorProgressView
         ohos:id="$+id:spv"
         ohos:width="200vp"
         ohos:height="200vp"
         ohos:horizontal_center="true"
         ohos:top_margin="40vp"
         app:bgColor="#e1e1e1"
         app:fgColorEnd="#ff4800"
         app:fgColorStart="#ffe400"
         app:percent="25"
         app:startAngle="0" />

Настройка вида с помощью Java-кода:

spv = (SectorProgressView) findViewById(R.id.spv);
spv.setPercent(25);
spv.setStartAngle(0);
spv.setBgColor(0xffe5e5e5);
spv.setFgColor(0xffff765c);

Неопределённый статус

В библиотеке есть API для неопределённого статуса SectorProgressView и ColorfulRingProgressView. Необходимо настроить параметры угла или процента и вызвать animateIndeterminate.

animateIndeterminate()

// если вы хотите настроить длительность или TimeInterpolator
animateIndeterminate(int durationOneCircle, TimeInterpolator interpolator)

// чтобы остановить анимацию
stopAnimateIndeterminate()

Скачать демо-версию APK можно для ознакомления.

Интеграция

Используя Gradle, добавьте зависимость в app.gradle.

Автор

Информация об авторе отсутствует.

Лицензия

Copyright 2017 Tim Qi

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-SectorProgressView.git
git@api.gitlife.ru:oschina-mirror/HarmonyOS-tpc-SectorProgressView.git
oschina-mirror
HarmonyOS-tpc-SectorProgressView
HarmonyOS-tpc-SectorProgressView
master