Skip to content

Commit

Permalink
Merge pull request #243 from HelloVolla/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wurzer authored Jun 23, 2024
2 parents a580e74 + da881ca commit 75e05d6
Show file tree
Hide file tree
Showing 17 changed files with 470 additions and 423 deletions.
2 changes: 1 addition & 1 deletion Collections.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ LauncherPage {
|| currentCollectionMode === mainView.collectionMode.Threads) {
message["messages"].forEach(function (aThread, index) {
aThread["isSignal"] = true
aThread["read"] = true // workaround for allways false negative
//aThread["read"] = true // workaround for allways false negative
// for (const [aThreadKey, aThreadValue] of Object.entries(aThread)) {
// console.log("Collections | * " + aThreadKey + ": " + aThreadValue)
// }
Expand Down
13 changes: 10 additions & 3 deletions OnBoarding.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Popup {
font.pointSize: mainView.mediumFontSize
onClicked: {
if (text === qsTr("Show demo")) {
enabled = false
swipeView.showTextfieldDemo()
} else {
swipeView.currentIndex = 1
Expand All @@ -113,6 +114,7 @@ Popup {
font.pointSize: mainView.mediumFontSize
onClicked: {
if (text === qsTr("Show demo")) {
enabled = false
swipeView.showRedDotDemo()
} else {
swipeView.currentIndex = 2
Expand All @@ -135,10 +137,12 @@ Popup {
id: button3
anchors.top: label3.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: "Show demo"
text: qsTr("Show demo")
font.pointSize: mainView.mediumFontSize
onClicked: {
console.debug("OnBoarding | Text " + text)
if (text === qsTr("Show demo")) {
enabled = false
swipeView.showCollectionDemo()
} else {
swipeView.currentIndex = 3
Expand All @@ -161,7 +165,7 @@ Popup {
id: button4
anchors.top: label4.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: "Show demo"
text: qsTr("Show demo")
font.pointSize: mainView.mediumFontSize
onClicked: {
if (text === qsTr("Show demo")) {
Expand All @@ -188,7 +192,7 @@ Popup {
id: button5
anchors.top: label5.bottom
anchors.horizontalCenter: parent.horizontalCenter
text: "Show demo"
text: qsTr("Show demo")
font.pointSize: mainView.mediumFontSize
onClicked: {
if (text === qsTr("Show demo")) {
Expand Down Expand Up @@ -224,6 +228,7 @@ Popup {
mainView.contacts = new Array
label1.text = qsTr("Learn about more use cases in the printed manual")
button1.text = qsTr("Next hint")
button1.enabled = true
}, 2000)
}, 2000)
}, 2000)
Expand All @@ -236,6 +241,7 @@ Popup {
timer.setTimeout(function() {
mainView.currentIndex = 2
button3.text = qsTr("Next hint")
button3.enabled = true
}, 6000)
}

Expand All @@ -247,6 +253,7 @@ Popup {

timer.setTimeout(function() {
button2.text = qsTr("Next hint")
button2.enabled = true
}, 2000)
}, 2000)
}
Expand Down
7 changes: 6 additions & 1 deletion Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ LauncherPage {
designSettingsItemColumn.menuState = false
designSettingsItemColumn.destroyCheckboxes()
}
if (item !== pluginSettingsItemColumn && pluginSettingsItemColumn.checkboxes.length > 0) {
pluginSettingsItemColumn.menuState = false
pluginSettingsItemColumn.destroyCheckboxes()
}
if (item !== resetSettingsItemColumn && resetSettingsItemColumn.menuState) {
resetSettingsItemColumn.menuState = false
}
Expand Down Expand Up @@ -641,7 +645,7 @@ LauncherPage {
console.log("Settings | Security state: " + message["isActive"] + ", " + message["error"])
securitySettingsItemTitle.text = message["isActive"] ? securityModeOnOption.text
: securityModeOffOption.text
securitySettingsItem.visible = message["error"] === undefined && message["isInstalled"]
securitySettingsItem.visible = message["error"] === undefined && message["isInstalled"] && message["isAvailable"]
} else if (type === "volla.launcher.checkSecurityPasswordResponse") {
console.log("Settings | Password is set: " + message["isPasswordSet"])
passwordDialog.backgroundColor = mainView.fontColor.toString() === "white" || mainView.fontColor.toString() === "#ffffff"
Expand Down Expand Up @@ -981,6 +985,7 @@ LauncherPage {
AN.SystemDispatcher.dispatch("volla.launcher.signalEnable", { "enableSignal": active})
mainView.updateSettings("activateSignal", active)
sourceSettings.signalIsActivated = active
mainView.isActiveSignal = active
}
}

Expand Down
1 change: 1 addition & 0 deletions SttSetup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Dialog {

onClicked: {
AN.SystemDispatcher.dispatch("volla.launcher.runAppAction", {"appId": "com.volla.vollaboard"})
dialog.close()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.4.10" android:versionCode="307" android:installLocation="auto">
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.4.11" android:versionCode="308" android:installLocation="auto">
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ public void deleteAllThreadsHavingTimeStampLessThen(long threadAge) {
usersDao.deleteAllThreadsHavingTimeStampLessThen(threadAge);
}

public void updateReadStatusInUserTableUsingThreadId(String threadId) {
usersDao.updateReadStatusInUserTableUsingThreadId(threadId);
}

public void updateReadStatusInUserTableUsingName(String uuid) {
usersDao.updateReadStatusInUserTableUsingName(uuid);
}

public Maybe<List<Users>> getAllUsers(long age) {
Log.d("VollaNotification Calling getAllUsers","");
return usersDao.getAllUsers(age).observeOn(Schedulers.io()).subscribeOn(Schedulers.io());
Expand Down
7 changes: 7 additions & 0 deletions android/src/com/volla/launcher/storage/UsersDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public interface UsersDao {
@Query("DELETE FROM users WHERE timeStamp < :threadAge")
void deleteAllThreadsHavingTimeStampLessThen(long threadAge);

@Query("UPDATE users SET read = true WHERE user_name = :thread_id")
void updateReadStatusInUserTableUsingThreadId(String thread_id);

@Query("UPDATE users SET read = true WHERE uuid = :uuid")
void updateReadStatusInUserTableUsingName(String uuid);


// @Query("SELECT * FROM users WHERE title IN ('Thanos ', 'Arvind Yadav') GROUP BY title ORDER BY timeStamp ASC ")
// Maybe<List<Message>> getMessageListBySender();
//
Expand Down
19 changes: 14 additions & 5 deletions android/src/com/volla/launcher/util/AppUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,26 @@ public void run() {
} else if (type.equals(GET_SECURITY_STATE)) {
try {
Intent childModeSettings = pm.getLaunchIntentForPackage("com.volla.childmodesettings");
boolean available = true;
boolean isInstalled = true;
try {
// check if available
// check if installed
pm.getPackageInfo("com.volla.childmodesettings", 0);
} catch (PackageManager.NameNotFoundException e) {
// if not available set available as false
available = false;
isInstalled = false;
}
ChildModeManager childModeManager = ChildModeManager.getInstance(activity);
boolean isAvailable = true;
// try {
// // check if available
// isAvailable = childModeManager.isAvailable();
// } catch (MethodNotFoundException e) {
// // outdated api library
// }
Map reply = new HashMap();
reply.put("isActive", childModeManager.isActivate() );
reply.put("isInstalled", available);
reply.put("isAvailable", isAvailable );
reply.put("isInstalled", isInstalled);
SystemDispatcher.dispatch(GOT_SECURITY_STATE, reply);
} catch (Exception e) {
Map reply = new HashMap();
Expand All @@ -251,7 +259,8 @@ public void run() {
Map reply = new HashMap();
reply.put("isPasswordSet", childModeManager.isPasswortSet() );
SystemDispatcher.dispatch(GOT_IS_SECURITY_PW_SET, reply);
} else if (type.equals(GET_IS_STT_AVAILABLE)) { InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
} else if (type.equals(GET_IS_STT_AVAILABLE)) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
List<InputMethodInfo> mInputMethodProperties = imm.getEnabledInputMethodList();
final int N = mInputMethodProperties.size();
boolean isActivated = false;
Expand Down
4 changes: 3 additions & 1 deletion android/src/com/volla/launcher/worker/SignalWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ static void retrieveMessageConversations(Map message, Activity activity){
result.put("messagesCount", messageList.size());
Log.d(TAG, "Will dispatch messages: " + result.toString());
SystemDispatcher.dispatch(GOT_SIGNAL_MESSAGES, result);
});
repository.updateReadStatusInUserTableUsingName(person);
});
} else {
repository.getAllMessageByThreadId(threadId,timeFrame).subscribe(it -> {
for (Message m : it) {
Expand Down Expand Up @@ -153,6 +154,7 @@ static void retrieveMessageConversations(Map message, Activity activity){
result.put("messagesCount", messageList.size());
Log.d(TAG, "Will dispatch messages: " + result.toString());
SystemDispatcher.dispatch(GOT_SIGNAL_MESSAGES, result);
repository.updateReadStatusInUserTableUsingThreadId(threadId);
});

}
Expand Down
16 changes: 12 additions & 4 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ApplicationWindow {
}
mainView.keepLastIndex = false
} else {
if (settings.showAppsAtStartup && mainView.currentIndex !== mainView.swipeIndex.Apps)
if (settings.showAppsAtStartup && mainView.currentIndex === mainView.swipeIndex.Apps)
appGrid.children[0].item.updateNotifications()
mainView.currentIndex = settings.showAppsAtStartup ? mainView.swipeIndex.Apps : mainView.swipeIndex.Springboard
}
Expand Down Expand Up @@ -1087,8 +1087,16 @@ ApplicationWindow {
}
if (presetDict.quickmenu !== undefined && presetDict.quickmenu.length > 0) {
console.debug("AppWindow | Set default actions to " + presetDict.quickmenu)
mainView.defaultActions = presetDict.quickmenu
if (presetDict.firstStart) mainView.resetActions()
var isValid = true
Object.keys(presetDict.quickmenu).forEach(function(key) {
if (!isNaN(presetDict.quickmenu[key])) isValid = false
})
if (isValid) {
mainView.defaultActions = presetDict.quickmenu
if (presetDict.firstStart) mainView.resetActions()
} else {
console.debug("AppWindow | Preset actions for quick menu are invalid")
}
}
if (presetDict.theme !== undefined && settings.firstStart) {
console.debug("AppWindow | Set default theme to " + presetDict.theme)
Expand Down Expand Up @@ -1132,7 +1140,7 @@ ApplicationWindow {
if (signalIsActivated) {
AN.SystemDispatcher.dispatch("volla.launcher.signalEnable", { "enableSignal": signalIsActivated})
}
mainView.isActiveSignal = signalIsActivated
mainView.isActiveSignald = signalIsActivated
mainView.useVibration = useHapticMenus
if (settings.sync) {
settings.sync()
Expand Down
Loading

0 comments on commit 75e05d6

Please sign in to comment.