1 Star 0 Fork 0

OSCHINA-MIRROR/HarmonyOS-tpc-FloatingActionButton

Join Gitlife
Discover and participate in excellent open source projects with over 10 million developers. Private repositories are also completely free :)
Join for free
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

FloatingActionButton

Введение

Ещё одна реализация кнопки Floating Action Button для HMOS с множеством функций.

Скриншоты

Функции

  • Возможность задать пользовательские цвета для состояний normal и pressed.
  • Возможность задавать пользовательские анимации.
  • Возможность задать собственный значок для отрисовки.
  • Поддержка размеров кнопок normal 56 dp и mini 40 dp.
  • Пользовательские анимации иконок FloatingActionMenu.
  • Возможность разворачивать меню вверх и вниз.
  • Возможность показывать метки слева и справа от меню.
  • Возможность показать круговой прогресс на FloatingActionButton.
  • Возможность программно добавить кнопку в FloatingActionMenu.
  • Возможность затемнить фон FloatingActionMenu.
  • Возможность удалить все кнопки из FloatingActionMenu.
  • Возможность задать метку для кнопки FloatingActionMenu.

Ниже функции сейчас не поддерживаются

  • Эффект пульсации.
  • Возможность задать цвет пульсации.
  • Возможность задать цвета тени и смещения.
  • Возможность отключить тень для кнопок и (или) меток.

Инструкции по использованию

Кнопка Floating action Button

Добавьте com.github.clans.fab.FloatingActionButton в файл макета XML.

<StackLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:id="$+id:parent"
    ohos:height="match_parent"
    ohos:width="match_parent">

    <ListContainer
        ohos:id="$+id:list"
        ohos:height="match_parent"
        ohos:width="match_parent"/>

    <com.github.clans.fab.FloatingActionButton
        ohos:id="$+id:fabBtn"
        ohos:height="match_content"
        ohos:width="match_content"
        ohos:bottom_margin="12vp"
        ohos:fab_elevation="4vp"
        ohos:image_src="$media:ic_menu"
        ohos:layout_alignment="bottom|right"
        ohos:right_margin="16vp"/>

</StackLayout>

Меню Floating action menu

 <com.github.clans.fab.FloatingActionMenu
        ohos:id="$+id:menu_green"
        ohos:height="match_content"
        ohos:width="match_content"
        ohos:align_parent_bottom="true"
        ohos:align_parent_right="true"
        ohos:bottom_margin="10vp"
        ohos:left_margin="10vp"
        ohos:menu_animationDelayPerItem="500"
        ohos:menu_colorNormal="#43A047"
        ohos:menu_colorPressed="#2E7D32"
        ohos:menu_icon="$media:ic_star"
        ohos:right_margin="150vp"
        ohos:top_margin="10vp"
        >

        <com.github.clans.fab.FloatingActionButton
            ohos:height="match_content"
            ohos:width="match_content"
            ohos:fab_colorNormal="#43A047"
            ohos:fab_colorPressed="#2E7D32"
            ohos:fab_label="Menu item 1"
            ohos:fab_size="1"
            ohos:image_src="$media:ic_edit"/>


        <com.github.clans.fab.FloatingActionButton
            ohos:height="match_content"
            ohos:width="match_content"
            ohos:fab_colorNormal="#43A047"
            ohos:fab_colorPressed="#2E7D32"
            ohos:fab_label="Menu item 2"
            ohos:fab_size="1"
            ohos:image_src="$media:ic_edit"/>

        <com.github.clans.fab.FloatingActionButton
            ohos:height="match_content"
            ohos:width="match_content"
            ohos:fab_colorNormal="#43A047"
            ohos:fab_colorPressed="#2E7D32"
            ohos:fab_label="lorem_ipsum"
            ohos:fab_size="1"
            ohos:image_src="$media:ic_edit"/>
    </com.github.clans.fab.FloatingActionMenu>

Инструкция по установке

Способ 1: Сгенерируйте har-пакет из библиотеки и добавьте его в папку lib.
       добавьте следующий код в gradle основного проекта
       implementation fileTree(dir: 'libs', ```
include: ['*.jar', '*.har']

Метод 2: allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:floatingactionbutton:1.0.0'

License

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