Have android build use material theme and splash. Fix no context drawer on mobile.

This commit is contained in:
2020-06-27 10:43:47 -04:00
parent 5023455cb2
commit 4d7c2592bd
7 changed files with 25 additions and 1 deletions

View File

@@ -18,6 +18,8 @@
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="Vehicle Voyage"
android:icon="@drawable/logo"
android:theme="@style/AppTheme"
android:screenOrientation="unspecified"
android:launchMode="singleTop">
<intent-filter>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_logo</item>
</style>
</resources>

View File

@@ -7,7 +7,7 @@ set(vehiclevoyage_SRCS
qt5_add_resources(RESOURCES resources.qrc)
add_executable(vehiclevoyage ${vehiclevoyage_SRCS} ${RESOURCES})
target_link_libraries(vehiclevoyage Qt5::Core Qt5::Qml Qt5::Quick Qt5::Sql Qt5::Svg Qt5::Widgets KF5::CoreAddons)
target_link_libraries(vehiclevoyage Qt5::Core Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Sql Qt5::Svg Qt5::Widgets KF5::CoreAddons)
install(TARGETS vehiclevoyage ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
if (CMAKE_SYSTEM_NAME STREQUAL "Android")

View File

@@ -21,6 +21,10 @@ Kirigami.ApplicationWindow {
ListElement {value: -1; text: qsTr("Other");}
}
contextDrawer: Kirigami.ContextDrawer {
id: contextDrawer
}
Kirigami.PageRouter {
id: router
initialRoute: "main"

View File

@@ -28,6 +28,7 @@
#include <QDebug>
#include <QSqlQuery>
#include <QQmlContext>
#include <QtQuickControls2/QQuickStyle>
#include "db/sqlvehicle.h"
#include "db/sqlservicerecord.h"
#include "jsonio.h"
@@ -38,6 +39,10 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication app(argc, argv);
#ifdef Q_OS_ANDROID
QQuickStyle::setStyle("Material");
#endif
KAboutData aboutData("org.eyecreate.vehiclevoyage", "Vehicle Voyage", "1.0", "Track vehicle service history.",KAboutLicense::GPL_V3);//TODO:i18n
aboutData.setProductName("vehiclevoyage");

View File

@@ -0,0 +1,6 @@
[Material]
Primary=Indigo
Accent=Amber
Theme=System

View File

@@ -3,5 +3,6 @@
<file alias="main.qml">contents/ui/main.qml</file>
<file alias="speed.svg">contents/speed.svg</file>
<file alias="license.svg">contents/license.svg</file>
<file>qtquickcontrols2.conf</file>
</qresource>
</RCC>