Floating Chip

You can display a circular Floating Chip Player to allow the user to see the current playing audio progression and to access the full embedded player on click

Display the Floating Chip

Android
iOS
Android
class MainActivity : AppCompatActivity() {
private fun displayChip() {
// your_view must be a ViewGroup (RelativeLayout or ConstraintLayout)
val viewGroup = your_view
// options is optionnal
val options = STFloatingChipConfiguration()
val chipView = STFloatingChip.getInstance()?.display(viewGroup, options)
// Then you can use freely the chipView (STFloatingChipView)
}
}
iOS
import UIKit
import StayTunedSDK
class SampleViewController: UIViewController {
private func displayChip() {
let configuration = STFloatingChipConfiguration()
STFloatingChip.shared?.display(
in: self,
with: configuration
)
}
}

Chip Configuration

You will see here the configuration you can set on the Floating Chip

Android
iOS
Android
class STFloatingChipConfiguration {
enum class Size {
Small,
Medium,
Big
}
enum class Position {
BottomRight,
BottomLeft
}
var animate: Boolean = true
var size: Size = Size.Medium
var position: Position = Position.BottomRight
var verticalMargin: Int = getDimensionPixelSize(R.dimen.st_size_16)
var horizontalMargin: Int = getDimensionPixelSize(R.dimen.st_size_16)
}
iOS
struct STFloatingChipConfiguration {
public enum Size: CGFloat {
case small = 46
case medium = 50
case large = 62
}
public enum Position {
case bottomRight(horizontalMargin: CGFloat, verticalMargin: CGFloat)
case bottomLeft(horizontalMargin: CGFloat, verticalMargin: CGFloat)
}
public let size: STFloatingChipConfiguration.Size = .medium
public let position: STFloatingChipConfiguration.Position = .bottomRight(horizontalMargin: 10, verticalMargin: 10)
public let animate: Bool = true
}