Friendiqa/source-android/androidnative.pri/qml/AndroidNative/Toast.qml

26 lines
717 B
QML
Raw Normal View History

2017-11-08 21:15:07 +01:00
import QtQuick 2.0
import AndroidNative 1.0
Item {
/// The message that will be displayed when show() is called
property string text: ''
/// If set to true, the toast duration will be long
property bool longDuration: false
readonly property string m_TOAST_MESSAGE: "androidnative.Toast.showToast"
/// Displays the Toast with the current set text and duration
function show() {
SystemDispatcher.dispatch(m_TOAST_MESSAGE, {
text: text,
longLength: longDuration
});
}
Component.onCompleted: {
SystemDispatcher.loadClass("androidnative.Toast");
}
}