QML Material Design Component and Support Library for Android
Features
- Set of UI components implemented Google's Material Design
- Support hardware "Back" key nagivation
- Dimension in "dp" unit. Auto-scale according to system's DP value.
- Provide page transition animation
- Drawable Image provider
- Load image resource from Android resource style file tree. (e.g drawable-xxxhdpi)
- Tint image at load time
- Choose the best image according to current resolution automatically.
- Unified “Drawable” component
- A single component that supports color , image , QML component, simulated nine patch image as input source
- Auto scale image to fit current screen resolution
- Derived StateListDrawable for animated drawable like button
- Messege queue between C++/Qt and Java/Android code
- Auto conversion between C++ and Java data type. No need to write in JNI.
- Theme / Style Engine
- A global Theme object. Set once for all components.
- Helper function to create your own derived style.
- "Apache license" - Free to use for commerical application
System Requirements
- Qt 5.4 or above
UI Components
ActionBar , Button , BottomSheet , Drawable , StateListDrawable
Page , PageStack , MaterialShadow , Text, TextField, DropDownMenu, Paper
TabBar, TabView, FloatingActionButton, ListItem, RaisedButton
Native Components
ImagePicker
Utility Components
InverseMouseArea, RectToRectMatrix, SystemDispatcher, MouseSensor
Installation Instruction (qpm)
For user who are already using qpm from qpm.io
-
Run
qpm install
qpm install com.github.benlau.quickandroid
-
Include vendor/vendor.pri in your .pro file
You may skip this step if you are already using qpm
include(vendor/vendor.pri)
Installation Instruction
-
Download a release and bundle the folder within your source tree.
-
Add this line to your profile file(.pro):
include(quickandroid/quickandroid.pri) # You should modify the path by yourself
Initalization
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include "quickandroid.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
/* QuickAndroid Initialization */
view.engine()->addImportPath("qrc:///"); // Add QuickAndroid into the import path
// Setup "drawable" image provider
QADrawableProvider* provider = new QADrawableProvider();
provider->setBasePath("qrc:///res");
view.engine()->addImageProvider("drawable",provider)
/* End of QuickAndroid Initialization */
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl(QStringLiteral("qrc:///splash.qml")));
view.show();
return app.exec();
}
Import the package within your QML file by :
import QuickAndroid 0.1
Demonstration
An example program is available in the folder of tests/quickandroidexample . You may build it by yourself or download the daily build from drone.io .
Remarks: Daily build for non-master branch may not be working.
Class Reference (Under Construction)
If you have any question, please feel free to ask.
License
Apache License 2.0
TODO
v0.1.6
- Ink
v1.0
- Switch
- NavigationDrawer
- Slider
Wish
- SwipeableListItem
- AssetsManager
- Haptic Feedback
FAQ
Q. Looking for component that is not supported yet?
Please feel free to submit the request to our issue tracker. Moreover, you may take a look on other component library:
Q. Looking for iOS Native Component?
Q. Any library for ...?
- Sharing
- bdentino/Qtino.SharingKit
Related Projects
- benlau/quickpromise - Promise library for QML
- benlau/quickflux - Message Dispatcher / Queue solution for QML