Commit cbb41bd7 authored by kempe's avatar kempe

Added basic new design

parent 20bdd925
......@@ -60,7 +60,9 @@ DISTFILES += \
qml/harbour-received.qml \
qml/cover/layouts/CoverDesign.qml \
qml/components/audioplayer/StationInfoLabel.qml \
qml/components/listmodels/ApiLanguageListModel.qml
qml/components/listmodels/ApiLanguageListModel.qml \
qml/components/audioplayer/DockerAudioPlayerSmalForm.ui.qml \
qml/components/audioplayer/DockerAudioPlayerSmal.qml
OTHER_FILES += \
rpm/harbour-received.changes.in \
......
import QtQuick 2.6
import Sailfish.Silica 1.0
import it.kempe.AudioPlayer 1.0
import "../js/Storage.js" as DB
import "../js/Favorites.js" as FavoritesUtils
import "../js/Utils.js" as Utils
DockerAudioPlayerSmalForm {
id: player
// Layout
width: parent.width
dock: Dock.Bottom
Behavior on opacity { FadeAnimation {duration: 300}}
Behavior on y { }
// Property assignment
isPlaying: AudioPlayer.isPlaying
showProgressBar: AudioPlayer.isLoading || AudioPlayer.isBuffering
bufferProgress: AudioPlayer.bufferProgress
currentTrack: AudioPlayer.title
// Triggers
opener.onClicked: console.debug("Show fullscreen player controls")
buttonPlay.onClicked: AudioPlayer.togglePlayback();
sleepTimer.onSleepTriggered: AudioPlayer.stop()
// Helper functions
function play(station) {
if(!player.expanded)
player.open = true;
player.stationData = JSON.parse(JSON.stringify(station));
player.isFavorite = FavoritesUtils.isFavorite(stationData);
window.stationIcon = stationData.stationLogo;
AudioPlayer.loadUrl(stationData.url)
}
function playNext() {
var nextStation = FavoritesUtils.getNextFavorite(stationData);
console.debug("Playing next favorite", JSON.stringify(nextStation));
play(nextStation);
}
function playPrev() {
var prevStation = FavoritesUtils.getPrevFavorite(stationData);
console.debug("Playing prev favorite", JSON.stringify(prevStation));
play(prevStation);
}
}
import QtQuick 2.6
import Sailfish.Silica 1.0
import "../"
DockedPanel {
id: player
property alias opener: opener
property alias buttonPlay: buttonPlay
property bool showProgressBar: false
property bool isPlaying: false
property bool isFavorite: false
property int bufferProgress: 0
property string currentTrack: ""
property alias sleepTimer: sleepTimer
property real hightPadding: Theme.paddingMedium
property var stationData
height: Theme.itemSizeSmall + (hightPadding * 2)
contentHeight: height
flickableDirection: Flickable.VerticalFlick
SleepTimer {
id: sleepTimer
}
MouseArea {
id: opener
anchors.fill: parent
}
Row {
id: quickControlsItem
anchors.fill: parent
spacing: Theme.paddingLarge
anchors.leftMargin: Theme.horizontalPageMargin
anchors.rightMargin: Theme.horizontalPageMargin
anchors.topMargin: hightPadding
anchors.bottomMargin: hightPadding
Image {
id: stationIcon
height: parent.height
width: parent.height
source: window.stationIcon
smooth: true
cache: true
fillMode: Image.PreserveAspectFit
sourceSize.height: height
sourceSize.width: height
}
StationInfoLabel {
name: stationData ? stationData.name : ""
track: currentTrack
width: parent.width - (buttonPlay.width + stationIcon.width + Theme.paddingLarge*2)
height: parent.height
}
IconButton {
id: buttonPlay
width: parent.height
height: parent.height
anchors.verticalCenter: parent.verticalCenter
icon.source: isPlaying ? "image://theme/icon-m-pause" : "image://theme/icon-m-play"
}
}
}
......@@ -27,7 +27,7 @@ ApplicationWindow
id: favorites
}
Audio.DockedAudioPlayer {
Audio.DockerAudioPlayerSmal {
id: player
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment