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

OSCHINA-MIRROR/archermind-ti-materialplaypausedrawable

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
README.md 2.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
fengrenjie Отправлено 13.07.2021 11:25 b8a90eb

MaterialPlayPauseDrawable

简介

material design play/pause 的动画

功能

  1. 自定义的Material Design 的play/pause Image控件

演示效果

sample.gif

集成

  1. 在project的build.gradle中添加mavenCentral()的引用

    allprojects {
        repositories {
            ……
            mavenCentral()
        }
    }
  2. 在需要使用的module的build.gradle的文件中,添加如下内容:

    dependencies {
    	implementation 'com.gitee.archermind-ti:material_play_pause_drawable:1.0.1'
        ……
    }

使用说明

xml文件中定义:

<me.zhanghai.openharmony.materialplaypausedrawable.MaterialPlayPauseImage
        ohos:id="$+id:play_pause"
        ohos:height="160vp"
        ohos:width="160vp"
        ohos:background_element="$graphic:play_pause_button_background"
        ohos:center_in_parent="true"
        />

Java中使用:

//1. 使用MaterialPlayPauseImage控件
mPlayPauseButton = (MaterialPlayPauseImage)findComponentById(ResourceTable.Id_play_pause);


//2. 设置setState或jumpToState
MaterialPlayPauseImage.State newState =
mPlayPauseButton.getState() == MaterialPlayPauseImage.State.Play ?
MaterialPlayPauseImage.State.Pause : MaterialPlayPauseImage.State.Play;
mPlayPauseButton.setState(newState);

编译说明

  1. 将项目通过git clone 至本地
  2. 使用DevEco Studio 打开该项目,然后等待Gradle 构建完成
  3. 点击Run运行即可(真机运行可能需要配置签名)

版权和许可信息

Copyright 2018 Zhang Hai

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/archermind-ti-materialplaypausedrawable.git
git@api.gitlife.ru:oschina-mirror/archermind-ti-materialplaypausedrawable.git
oschina-mirror
archermind-ti-materialplaypausedrawable
archermind-ti-materialplaypausedrawable
master