Skip to content

Commit

Permalink
Merge pull request #51 from FazziCLAY/pre-release
Browse files Browse the repository at this point in the history
Pre release
  • Loading branch information
WilliamPhysics committed Nov 5, 2023
2 parents d0de217 + d85ea10 commit 1066ef5
Show file tree
Hide file tree
Showing 283 changed files with 8,243 additions and 1,862 deletions.
16 changes: 16 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/render.experimental.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
12 changes: 12 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id 'java-library'
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
implementation 'org.jetbrains:annotations:15.0'
}
4 changes: 4 additions & 0 deletions api/src/main/java/com/fazziclay/opentoday/api/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.fazziclay.opentoday.api;

public interface Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.fazziclay.opentoday.api;

public class EventExceptionEvent implements Event {
private final Event event;
private final Exception exception;

public EventExceptionEvent(Event event, Exception e) {
this.event = event;
this.exception = e;
}

public Event getEvent() {
return event;
}

public Exception getException() {
return exception;
}
}
15 changes: 15 additions & 0 deletions api/src/main/java/com/fazziclay/opentoday/api/EventHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.fazziclay.opentoday.api;

public class EventHandler {
public static void call(Event event) {
try {
PluginManager.callEvent(event);
} catch (Exception e) {
PluginManager.callEvent(new EventExceptionEvent(event, e));
}
}

public void handle(Event event) {

}
}
10 changes: 10 additions & 0 deletions api/src/main/java/com/fazziclay/opentoday/api/OpenTodayPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.fazziclay.opentoday.api;

public abstract class OpenTodayPlugin {
public void onEnable() {}
public void onDisable() {}

public EventHandler[] getEventHandlers() {
return new EventHandler[0];
}
}
33 changes: 33 additions & 0 deletions api/src/main/java/com/fazziclay/opentoday/api/PluginException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.fazziclay.opentoday.api;

public class PluginException extends RuntimeException {
private final OpenTodayPlugin plugin;

public PluginException(OpenTodayPlugin plugin) {
this.plugin = plugin;
}

public PluginException(String message, OpenTodayPlugin plugin) {
super(message);
this.plugin = plugin;
}

public PluginException(String message, Throwable cause, OpenTodayPlugin plugin) {
super(message, cause);
this.plugin = plugin;
}

public PluginException(Throwable cause, OpenTodayPlugin plugin) {
super(cause);
this.plugin = plugin;
}

public PluginException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, OpenTodayPlugin plugin) {
super(message, cause, enableSuppression, writableStackTrace);
this.plugin = plugin;
}

public OpenTodayPlugin getPlugin() {
return plugin;
}
}
57 changes: 57 additions & 0 deletions api/src/main/java/com/fazziclay/opentoday/api/PluginManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.fazziclay.opentoday.api;

import java.util.HashMap;

public class PluginManager {
private static final HashMap<String, OpenTodayPlugin> activePlugins = new HashMap<>();

public static void loadPlugin(String packageId, OpenTodayPlugin plugin) {
disablePlugin(packageId);
activePlugins.put(packageId, plugin);
plugin.onEnable();
}

public static void disablePlugin(String packageId) {
OpenTodayPlugin openTodayPlugin = activePlugins.get(packageId);
if (openTodayPlugin != null) {
openTodayPlugin.onDisable();
activePlugins.remove(packageId);
}
}

public static void disableAllPlugins() {
if (activePlugins.isEmpty()) return;
for (String s : activePlugins.keySet()) {
disablePlugin(s);
}
}

public static void callEvent(Event event) {
activePlugins.forEach((s, plugin) -> {
try {
for (EventHandler eventHandler : plugin.getEventHandlers()) {
eventHandler.handle(event);
}
} catch (Exception e) {
throw new PluginException("Exception while process eventHandlers in \"" + s + "\"(" + plugin + ") plugin", e, plugin);
}
});
}

public static OpenTodayPlugin getActivePlugin(String key) {
return activePlugins.get(key);
}

public static <T extends OpenTodayPlugin> T getActivePlugin(Class<T> clazz) {
for (OpenTodayPlugin value : activePlugins.values()) {
if (value.getClass() == clazz) {
return (T) value;
}
}
return null;
}

public static boolean isPluginActive(String key) {
return getActivePlugin(key) != null;
}
}
43 changes: 23 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ plugins {
}

// =====
var isDev = true
var beta = false
var appIdSuffix = "" // EMPTY FOR RELEASES!!!!
var verBuild = 140
var verName = "1.2+[patches:[fix-tick] + [special_widget] + [fixes-itemstorageviewer] + [item-sleepTime] + [notification-manager]"
var verBranch = "fixes-itemstorageviewer + special_widget + item-sleepTime + notification-manager (currently main)" // use "RELEASE" for releases versions
var verReleaseTime = 1689778441 // in seconds
var isDev = false // add .dev to applicationId
var beta = false // add .beta to applicationId
var appIdSuffix = "" // add this to applicationId (E M P T Y F O R R E L E A S E S)
var verBuild = 160 // versionCode
var verName = "1.3" // versionName...
var verBranch = "main" // branch
var verReleaseTime = 1699198506 // releaseTime

android {
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "com.fazziclay.opentoday" + (isDev ? ".dev" : "") + (beta ? ".beta" : "") + appIdSuffix
minSdk 26
targetSdk 33
targetSdk 34
versionCode verBuild
versionName verName + " (build " + verBuild + (isDev ? " dev" : "") + ")"

Expand Down Expand Up @@ -51,24 +51,27 @@ android {
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
resources.excludes.add("META-INF/*") // fix build errors
}
namespace 'com.fazziclay.opentoday'
}

dependencies {
// Application
implementation files("./libs/OpenTodayTelemetry-v2-v11.jar")
implementation files("./libs/NeoSocket-1.0.jar")
implementation files("./libs/JavaNeoUtil-1.1.jar")
implementation files("./libs/WarningRose-v0.4.1.jar")
implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.0.1'
implementation files("./libs/OpenTodayTelemetry-v2-v11.jar") // telemetry library for OpenToday SourceCode: https://github.com/FazziCLAY/OpenTodayTelemetry
implementation files("./libs/NeoSocket-1.0.jar") // for network (bad library...) uses by OpenTodayTelemetry SourceCode: https://github.com/FazziCLAY/NeoSocket
implementation files("./libs/JavaNeoUtil-1.1.jar") // java utils by FazziCLAY (uses FileUtil) SourceCode: https://github.com/FazziCLAY/JavaNeoUtil
implementation files("./libs/WarningRose-v0.4.1.jar") // for DebugTickCounter debug rose (only for developer) SourceCode: https://github.com/FazziCLAY/WarningRose
implementation 'com.github.leondzn:simple-analog-clock:1.0.1' // analog clock
implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.0.1' // color picker
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation project(path: ':api') // api

// Tests
androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
Expand Down
2 changes: 1 addition & 1 deletion app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="abc_launcherName" translatable="false">OpenToday (Debug)</string>
<string name="abc_launcherName" translatable="false">OpenToday</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
android:name="com.fazziclay.opentoday.gui.activity.AlarmActivity"
android:showWhenLocked="true"
android:showOnLockScreen="true"
android:excludeFromRecents="true"
android:turnScreenOn="true"
android:exported="true"
tools:targetApi="o_mr1">
Expand Down
66 changes: 52 additions & 14 deletions app/src/main/assets/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
TODO: changelog
== branch: item-sleepTime
* Added new item: SleepTimeItem - automatically calculate sleep time
* DATA_VERSIONS now is 11

== branch: fixes-itemstoragedrawer
* Keyboard now shows automatically in ItemTextEditorFragment
* Fixes memory-leaks in ItemsEditorFragment if item instance of FilterItemGroup (related with edit-filter buttons)
* Fixes memory-leaks in CycleListItem while rendering
* ItemsStorage: added "getItemAt(int)" method.
* Basic logic of "ItemsStorageDrawer" moved to new parent "AbstractItemsStorageDrawer"
* Drag&Drop re-order now not resets while item updated.
* Drag&Drop re-order(and maybe swipes...) now available in child items
* Fixed DeleteItemsFragment: now all items un-minimized
$[@bold;-#00FF00;S25]# Changelog v160 1.3 (2023.11.05)$[||]
$[@bold;-#44dd44]Innovation:$[@reset;-reset]
* Notification can now come as an alarm clock (full screen)
* When creating an item, its default background color is random (configurable)
* The analog clock can be enabled in the settings
* Tags have been added to items, now you can label them! (not used anywhere yet)
* To date&time format added NO_TIME presets
* The text editor can now edit bold, italic, strikeout and font size
* Added icons
* If the item has notifications, it will have the corresponding icon on it

$[@bold]Gui Improvements:$[@reset]
* Animations added
* Item text editor now automatically show keyboard
* After closing the toolbar, the focus is set to QuickNote
* When deleting, child elements are now counted
* An (+) button has been added to the list of tabs
* Item margins increased
* When the item is clamped inside the group, a specific item is now moved, and not the whole group
* Inside DeleteItemsFragment, now all items are rendered not minimized
* More material style
* Uses new icons
* The color selection button has been changed

$[@bold]Code Improvements:$[@reset]
* SettingsManager rewritten
* Startup performance improved: uses multi-threaded loading (BackendInitializer.java)
* Added minimal plugins support
* Basic logic of "ItemsStorageDrawer" moved to new parent "AbstractItemsStorageDrawer"
* Drag&Drop re-order(and maybe swipes...) now available in child items
* Notifications can now have a custom icon and color
* ColorUtil.colorize now fast if received plain text

$[@bold]Fixes:$[@reset]
* Fixes memory-leaks in ItemsEditorFragment if item instance of FilterItemGroup (related with edit-filter buttons)
* Fixes memory-leaks in CycleListItem while rendering
* [GUI] Drag&Drop re-order now not reset while item updated.
* [GUI] With a large update of Items Storage, ItemsStorageDrawer did not have time to process it and caused a crash.

$[@bold]Other:$[@reset]
* DATA_VERSION is 12
* DataFixer 10->11: nothing; 11->12: fix settings
* Target to android 34
* Secret item: SleepTime - automatically counts sleep time (still in development)
* Secret item: MissingNo - it turns into an item, the import of which failed, it still contains the parent's information, and when re-importing the error will try to be eliminated.
* ItemsStorage: added "getItemAt(int)" method.
* ItemsStorage: added "totalCount()" method.
* [GUI] "main" instead of "RELEASE" is now default branch in AboutFragment
* Added profiler: in releases it disabled.




$[@bold;-#00FF00;S25]# Changelog v134 1.2 (2023.06.18)$[||]
Correct release for 1.1.4
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/assets/beautify_colors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// default colors for OpenToday
#ff0000;fully red
#d19b29;оранжевый
#808000;тёмно-ораньжевый
#2adc0e;хакерский-зелёный
#008000;тёмнозелёный
#6bc6d1;голубой
#008080;цвет блока гвардианов
#e02271;малиновая лада
#0c7a89;цвел блока гвардианов
#6338d3;цвет фиолетово-курсовый
#a290f7;светло фиолетовый-курсовый
#7801d9;цвет курсы-фиолетово
#ff00f0;sorry brother
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1066ef5

Please sign in to comment.