Cyjan's Blog

I don't know why are you here, but enjoy.


Epstein didn't kill himself | Design | General
Politically Incorrect | Raspberry PI | Technologic
btw I'm using Ubuntu Touch

Getting Started with app development for Ubuntu Touch

July 19, 2020 | btw I'm using Ubuntu Touch

This post is just an explanation of what I've created in this video.

I assume that you have downloaded clickable from clickable-ut.dev, and followed video instructions, if not follow them now or get source code from Microsoft's Github).

I've made changes to qml/Main.qml file. I'll explain some lines of code that are visible there.

property var doge: 0

This line sets property (think about it like of variable, if you are familiar with other programming languages)

Button {
    id: clickbtn
    anchors.top: header.bottom
    anchors.horizontalCenter: parent.horizontalCenter
    color: UbuntuColors.green
    text: i18n.tr('Dig Dogecoins. By hand.')
    width: parent.width*0.75
    onClicked: {
        doge++;
    }
}

Label {
    id: dogeamt
    anchors.top: clickbtn.bottom
    anchors.horizontalCenter: parent.horizontalCenter
    text: doge + ' ' + i18n.tr('Dogecoin')
}

We don't have many new things used in this one, except for text: doge, as you may see there's no logic to update text of that Label, it updates whenever doge property changes.

Feel free to get the source of this version from Microsoft's Github.