项目作者: DanishAmjad12

项目描述 :
👏 The Zedge App Play Button Effect developed in Android
高级语言: Kotlin
项目地址: git://github.com/DanishAmjad12/PlayButton-Android.git
创建时间: 2020-05-16T16:18:59Z
项目社区:https://github.com/DanishAmjad12/PlayButton-Android

开源协议:

下载


PlayButton-Android

👏 The Zedge Android App Play Button Effect developed in Android using Kotlin.

Demo

Installation 💻

Add this in your app’s build.gradle file:

  1. dependencies {
  2. implementation 'com.github.DanishAmjad12:PlayButton-Android:1.0'
  3. }

Usage 🧾

  1. <com.danish.playbutton.PlayButton
  2. android:layout_width="wrap_content"
  3. android:id="@+id/playButton"
  4. app:play_button_icon="@drawable/ic_play_arrow"
  5. app:pause_button_icon="@drawable/ic_pause"
  6. app:play_button_default_background="@color/fab_background"
  7. app:card_background_color="@drawable/background"
  8. app:progress_color="@color/progress_background"
  9. android:layout_height="wrap_content"></com.danish.playbutton.PlayButton>

Customization and Attributes 🎨

All customizable attributes for Play Button

Attribute Name Default Value Description
app:play_button_icon @drawable/ic_play_arrow The default icon of the Play button
app:pause_button_icon @drawable/ic_pause The default icon of the Pause button
app:play_button_default_background @color/fab_background The background color of the fab button
app:card_background_color @drawable/background The default background image of the frame view
app:progress_color @color/progress_background The default audio progress color

Play Button Listener

  1. override fun onCreate(savedInstanceState: Bundle?) {
  2. super.onCreate(savedInstanceState)
  3. setContentView(R.layout.activity_main)
  4. playButton.playButtonListener=listener
  5. }
  6. private val listener = object : PlayButton.OnButtonListener{
  7. override fun onPlayButtonClicked(playButton: PlayButton) {
  8. playButton.setAudioFileName("audio")
  9. }
  10. }
  11. override fun onDestroy() {
  12. super.onDestroy()
  13. playButton.stopAudio()
  14. }
  15. override fun onPause() {
  16. super.onPause()
  17. playButton.pauseAudio()
  18. }

Developed By

  1. DANISH AMJAD follow me 👇

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.