version v0.6

This commit is contained in:
LubuWest 2021-05-12 21:41:34 +02:00
commit 8482bde3ed
86 changed files with 7064 additions and 3208 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.5.4" android:versionCode="22" android:installLocation="auto">
<manifest package="org.qtproject.friendiqa" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6" android:versionCode="25" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
@ -8,7 +8,7 @@
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
<!-- %%INSERT_FEATURES android:requestLegacyExternalStorage="true" -->
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
@ -16,11 +16,13 @@
android:name="org.qtproject.qt5.android.bindings.QtApplication"
android:label="Friendiqa"
android:extractNativeLibs="true"
android:requestLegacyExternalStorage="true"
android:icon="@drawable/friendiqa"
android:theme="@android:style/Theme.Holo.Light"
android:logo="@drawable/friendiqa">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="androidnative.friendiqa.FriendiqaActivity" android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleInstance" android:taskAffinity="">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:name="androidnative.friendiqa.FriendiqaActivity"
android:label="Friendiqa" android:screenOrientation="unspecified" android:launchMode="singleTask" android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

0
source-android/android/arm/libcrypto_1_1.so Executable file → Normal file
View file

0
source-android/android/arm/libssl_1_1.so Executable file → Normal file
View file

0
source-android/android/arm64/libcrypto_1_1.so Executable file → Normal file
View file

0
source-android/android/arm64/libssl_1_1.so Executable file → Normal file
View file

View file

@ -1,7 +1,4 @@
# androidBuildToolsVersion=25.0.3
# androidCompileSdkVersion=26
buildDir=.build
# qt5AndroidDir=/home/pankraz/Qt/5.11.1/android_armv7/src/android/java
android.useAndroidX=true
android.enableJetifier=true
android.enforceUniquePackageName=false

0
source-android/android/gradlew vendored Executable file → Normal file
View file

View file

@ -8,8 +8,6 @@ import java.util.HashMap;
import android.content.pm.PackageManager;
import android.content.Context;
import android.Manifest.permission;
//import android.support.v4.app.ActivityCompat;
//import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
@ -43,6 +41,7 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
//} else {
System.loadLibrary("friendiqa_arm64-v8a");
//System.loadLibrary("friendiqa_armeabi-v7a");
if((getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_NEW_TASK) || (getIntent().getFlags() == Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) || (getIntent().getFlags() == (Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED))) {
SystemDispatcher.onActivityResume();
} else {
@ -94,6 +93,7 @@ public class AndroidNativeActivity extends org.qtproject.qt5.android.bindings.Qt
protected void onNewIntent(Intent data) {
System.loadLibrary("friendiqa_arm64-v8a");
//System.loadLibrary("friendiqa_armeabi-v7a");
super.onNewIntent(data);
if ((data!=null) && (data.getType() != null) && !(data.getBooleanExtra("used",false))){
String type = data.getType();

View file

@ -112,7 +112,6 @@ public class ImagePicker {
return;
int requestCode = (Integer) message.get("requestCode");
Intent data = (Intent) message.get("data");
if (requestCode == PICK_IMAGE_ACTION) {
importImage(data);
} else if (requestCode == TAKE_PHOTO_ACTION) {
@ -127,8 +126,8 @@ public class ImagePicker {
static private void importImage(Intent data) {
Uri uri = data.getData();
Log.d(TAG,"importImage: uri:" + uri);
Log.d(TAG,"importImage: type: " + data.getType());
//Log.d(TAG,"importImage: uri:" + uri);
//Log.d(TAG,"importImage: type: " + data.getType());
if (data.getClipData() != null) {
importImageFromClipData(data);

View file

@ -140,6 +140,7 @@ public class SystemDispatcher {
waitingIntent=null;
isIntentPending=false;
} else { //onIntent start
Log.e(TAG,"notInitialized: onIntentStart "+data);
message.put("text",data.getStringExtra(Intent.EXTRA_TEXT));
message.put("subject",data.getStringExtra(Intent.EXTRA_SUBJECT));
waitingIntent = message;

View file

@ -67,13 +67,13 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) {
}
else{
QApplication app(argc, argv);
QQuickView view;
QQmlApplicationEngine view;
//qDebug()<<"FriendiqaMain started";
QTranslator qtTranslator;
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
app.installTranslator(&qtTranslator);
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
view.engine()->addImageProvider("remoteauthimage",imageProvider);
view.addImageProvider("remoteauthimage",imageProvider);
view.rootContext()->setContextProperty("remoteauth", imageProvider);
XHR* xhr = XHR::instance();
view.rootContext()->setContextProperty("xhr", xhr);
@ -83,8 +83,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) {
view.rootContext()->setContextProperty("alarm", alarm);
UPDATENEWS* updatenews = UPDATENEWS::instance();
view.rootContext()->setContextProperty("updatenews", updatenews);
view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
view.show();
view.load(QUrl("qrc:/qml/friendiqa.qml"));
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
return app.exec();

View file

@ -52,7 +52,8 @@ OTHER_FILES += qml/friendiqa.qml \
TRANSLATIONS += translations/friendiqa-de.ts \
translations/friendiqa-es.ts \
translations/friendiqa-it.ts
translations/friendiqa-it.ts \
translations/friendiqa-hu.ts
HEADERS += \
common/uploadableimage.h \
@ -85,5 +86,3 @@ DISTFILES += \
ANDROID_EXTRA_LIBS = $$PWD/android/arm/libcrypto_1_1.so $$PWD/android/arm/libssl_1_1.so $$PWD/android/arm64/libcrypto_1_1.so $$PWD/android/arm64/libssl_1_1.so
ANDROID_ABIS = arm64-v8a
android: include(/home/pankraz/git/android_openssl/openssl.pri)

View file

@ -36,47 +36,52 @@ import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service
import "qrc:/qml/genericqml"
StackView{
ApplicationWindow{
id:root
title: "Friendiqa"
property var globaloptions: Service.readGO(db)
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsAndroid.qml");return tmp.createObject(root)}
width: osSettings.appWidth
height:osSettings.appHeight
visible: true
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
property var login: Service.readActiveConfig(db)
property var globaloptions: Service.readGO(db)
property real fontFactor: root.font.pixelSize/root.font.pointSize
property var contactlist: []
property real mm: osSettings.osType=="Android"?Screen.pixelDensity:Screen.pixelDensity*1.5
signal messageSignal(var friend)
property bool wideScreen : width>height
signal fotoSignal(var username, var friend)
signal directmessageSignal(var friend)
signal newsSignal(var news)
signal newstypeSignal(var type)
signal friendsSignal(var username)
signal contactdetailsSignal(var contact)
signal searchSignal (var searchterm)
signal eventSignal(var contact)
signal uploadSignal(var urls)
signal sendtextSignal(var intenttext)
signal changeimage(var method, var type, var id)
signal updateSyncinterval(int interval)
signal replySignal(var newsobject)
property var news:[]
property var newContacts:[]
property var contactposts:[]
//property string contactLoadType: ""
property bool imagePicking: false
onLoginChanged:{
if(login==""){root.push("qrc:/qml/configqml/AccountPage.qml")}
else{root.push(rootStackItem)
function onLoginChanged(login){
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
else{//rootstackView.push(rootstack)
if (login.newsViewType!="" || login.newsViewType!=null){newstab.newstabstatus=login.newsViewType;}
Newsjs.getCurrentContacts(login,db,function(contacts){
contactlist=contacts})}
}
onNewContactsChanged:{
function onNewContactsChanged(newContacts){
if(newContacts.length>0){// download contact images and update db
var contacturls=[];
var contactnames=[];
for (var link in newContacts){
for (var link in newContacts){//print("new contact " +newContacts[link].screen_name);
contacturls.push(newContacts[link].profile_image_url);
contactnames.push(newContacts[link].screen_name);
Service.updateContactInDB(login,db,newContacts[link].isFriend,newContacts[link])
@ -91,9 +96,32 @@ StackView{
}
Connections {
target: root
function onWidthChanged(appWidth) {
if(osSettings.osType=="Linux" && Math.abs(appWidth-(globaloptions.appWidth||0))>50){
Service.updateglobaloptions(db,"appWidth",appWidth)
}
}
}
Connections {
target: root
function onHeightChanged(appHeight) {
if(osSettings.osType=="Linux" && Math.abs(appHeight-(globaloptions.appHeight||0))>50){
Service.updateglobaloptions(db,"appHeight",appHeight)
}
}
}
function showContact(contact){ //print(JSON.stringify(contact));
rootstackView.push("qrc:/qml/newsqml/ContactPage.qml",{"contact": contact})
}
Connections{
target:xhr
onDownloaded:{
function onDownloaded(type,url,filename,i){
if(type=="contactlist"){
var database=LocalStorage.openDatabaseSync(root.db[0],root.db[1],root.db[2],root.db[3]);
var result;
@ -104,10 +132,12 @@ StackView{
}
}
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
if (event.key === osSettings.backKey) {
//Keys.onReleased: {//print(event.key + "Backkey"+newstab.conversation.length+" "+root.depth)
onClosing: {
//if (event.key === osSettings.backKey) {
if (rootstack.currentIndex==0){
newstab.active=true;
if (newstab.newstabstatus!=globaloptions.newsViewType){
@ -119,278 +149,147 @@ StackView{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
newsSignal(dbnews)
})}
close.accepted=false;
}
else if (newstab.conversation.length>0){newstab.conversation=[]}
else if (root.depth>1){root.pop()}
else{Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})}
else if (newstab.conversation.length>0){
newstab.conversation=[];
close.accepted=false
}
else if (root.depth>1){
root.pop();
close.accepted=false
}
else{
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})})
close.accepted=true
}
}
else if (rootstack.currentIndex==2){fotoSignal("backButton")}
else {rootstack.currentIndex=0}
event.accepted = true
}}
Drawer{
id: leftDrawer
width: 0.66* root.width
height: root.height
edge: Qt.LeftEdge
position: 1.0
Column{
x:mm
width:parent.width-mm
Label{
text: login.hasOwnProperty("username")?login.username:""
font.pixelSize: 4*mm
width: parent.width
height: 6*mm
}
// Label{
// text:login.hasOwnProperty("server")?"@"+login.server:""
// font.pixelSize: 5*mm
// width: parent.width
// }
Label{
text: "\uf021 " + qsTr("Refresh")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
// newstypeSignal("refresh")
updatenews.setDatabase();
updatenews.login();
updatenews.startsync();
}
}
}
Label{
text: "\uf1da " + qsTr("Timeline")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("timeline")
}
}
}
Label{
text: "\uf086 " + qsTr("Conversations")
width: parent.width
font.pixelSize: 4*mm
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("conversation")
}
}
}
Label{
text: "\uf005 " + qsTr("Favorites")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("favorites")
}
}
}
Label{
text: "\uf0ec " + qsTr("Replies")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("replies")
}
}
}
Label{
text: "\uf0ac " + qsTr("Public Timeline")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("publictimeline")
}
}
}
Label{
text: "\uf0c0 " + qsTr("Group news")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("groupnews")
}
}
}
Label{
text: "\uf002 " + qsTr("Search")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.close();
newstypeSignal("search")
}
}
}
Label{
text: "\uf085 "+ qsTr("Settings")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked: {root.push("qrc:qml/configqml/ConfigPage.qml");
leftDrawer.close()
}
}
}
Label{
text: "\uf2bb " + qsTr("Accounts")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked: {root.push("qrc:qml/configqml/AccountPage.qml");
leftDrawer.close()
}
}
}
Label{
text: "\uf08b " +qsTr("Quit")
font.pixelSize: 4*mm
width: parent.width
MouseArea{
anchors.fill: parent
onClicked:{
Service.cleanNews(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})
}
}
}
}
//event.accepted = true
//}
}
Item{
id:rootStackItem
width:parent.width
height: parent.height
//anchors.fill:parent
states: State {
name: "fullscreen";
PropertyChanges { target: bar; height:0 }
PropertyChanges { target: rootstack; height:parent.height }
}
transitions: Transition {
PropertyAnimation { properties: "height";
easing.type: Easing.InOutQuad
duration: 1000
footer:ToolBar{
//position: ToolBar.Footer
background: Rectangle{
anchors.fill: parent
color: "#EEEEEE"//"#F8F8F8"
}
//RowLayout{
// anchors.fill: parent
TabBar {
id: bar
width:parent.width
// Layout.fillWidth: true
//width: wideScreen?contentWidth:parent.width-10*mm
//x: 7*mm
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
TabButton {
text: "\uf03a"
font.pointSize: osSettings.bigFontSize
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
}
}
TabButton {
text: "\uf0c0"
font.pointSize: osSettings.bigFontSize
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
}
}
TabButton {
text: "\uf03e"
font.pointSize: osSettings.bigFontSize
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
}
}
TabButton {
text: "\uf073"
font.pointSize: osSettings.bigFontSize
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
}
}
}
}
TabBar {
id: bar
width: parent.width
height: 7*mm
position:TabBar.Footer
anchors.top: rootstack.bottom
onCurrentIndexChanged: rootstack.currentIndex=bar.currentIndex
TabButton {
text: "\uf03a"
font.pixelSize: 3*mm
height: 6*mm
}
TabButton {
text: "\uf0c0"
font.pixelSize: 3*mm
height: 6*mm
}
TabButton {
text: "\uf03e"
font.pixelSize: 3*mm
height: 6*mm
}
// }
}
TabButton {
text: "\uf073"
font.pixelSize: 3*mm
height: 6*mm
}
}
StackLayout{
// states: State {
// name: "fullscreen";
// PropertyChanges { target: bar; height:0 }
// PropertyChanges { target: rootstack; height:parent.height }
// }
// transitions: Transition {
// PropertyAnimation { properties: "height";
// easing.type: Easing.InOutQuad
// duration: 1000
// }
// }
StackView{id:rootstackView
width:root.width
height: root.height
initialItem: StackLayout{
id:rootstack
width:parent.width
height: parent.height-7*mm
width:rootstackView.width
height: rootstackView.height//-7*mm
//y:wideScreen?7*mm:0
currentIndex:bar.currentIndex
Loader{
id: newstab
Layout.fillWidth:true
Layout.fillHeight: true
property string newstabstatus
property var conversation:[]
property var contactposts:[]
source:(rootstack.currentIndex==0)? "qrc:/qml/newsqml/NewsTab.qml":""
}
Loader{
id: friendstab
Layout.fillWidth:true
Layout.fillHeight: true
// Layout.fillWidth:true
// Layout.fillHeight: true
source: (rootstack.currentIndex==1)?"qrc:/qml/contactqml/FriendsTab.qml":""
}
Loader{
id: fotostab
property string phototabstatus:"Images"
Layout.fillWidth:true
Layout.fillHeight: true
// Layout.fillWidth:true
// Layout.fillHeight: true
source: (rootstack.currentIndex==2)?"qrc:/qml/photoqml/PhotoTab.qml":""
}
Loader{
id: calendartab
property string calendartabstatus:"Events"
Layout.fillWidth:true
Layout.fillHeight: true
// Layout.fillWidth:true
// Layout.fillHeight: true
source: (rootstack.currentIndex==3)?"qrc:/qml/calendarqml/CalendarTab.qml":""
}
}
}
//}
Component.onCompleted: {
forceActiveFocus();
//print(xhr.networktype());
onLoginChanged(login);
globaloptions=Service.readGO(db);
//forceActiveFocus();
if(osSettings.osType=="Android"){
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
var IntentReceiverQml = component.createObject(root);
@ -400,5 +299,5 @@ StackView{
var LinuxSyncQml = component.createObject(root);
}
}
}
//}
}