fuse-open / fuselibs

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps
https://npmjs.com/package/@fuse-open/fuselibs
MIT License
176 stars 72 forks source link

Introduce Fuse.Shortcut #1440

Closed ichan-mb closed 2 years ago

ichan-mb commented 2 years ago

This module allows you to shows menu items when pressing App Icon on the device home screen. This feature refers to the home screen actions on iOS and App Shortcut on Android (introduced in Android 7.1 / API Level 25)

Example

<App>
    <JavaScript>

        var Observable = require("FuseJS/Observable")
        var selectedShortcut = new Observable("-")

        var shortcut = require("FuseJS/Shortcut");
        shortcut.registerShortcuts([
            {
                id: 'compose',
                title: "Compose",
                icon: "assets/images/compose.png"
            },
            {
                id: 'profile',
                title: "Profile",
                icon: "assets/images/user.png"
            },
            {
                id: 'book_store',
                title: "Book Store",
                icon: "assets/images/book.png"
            }
        ])

        shortcut.on('shortcutClicked', (type) => {
            selectedShortcut.value = type;
        })

        module.exports = {
            selectedShortcut
        }

    </JavaScript>
    <StackPanel Margin="20">
        <Text Value="Selected Shortcut: {selectedShortcut}" />
    </StackPanel>
</App>

please add Fuse.Shortcut to your Uno Project

This PR contains: