Skip to content

Commit 16e0159

Browse files
committed
Initial commit
0 parents  commit 16e0159

File tree

110 files changed

+5363
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5363
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: BlazeCodeDev
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Smartphone (please complete the following information):**
27+
- Device: [e.g. Pixel 6]
28+
- OS: [e.g. Android 13]
29+
- Version [e.g. 1.0]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature request
6+
assignees: BlazeCodeDev
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
/.idea/inspectionProfiles/Project_Default.xml
17+
/.idea/.gitignore
18+
/.idea/compiler.xml
19+
/.idea/deploymentTargetDropDown.xml
20+
/.idea/gradle.xml
21+
/.idea/misc.xml
22+
/.idea/vcs.xml
23+
/app/release/app-release.apk
24+
/app/release/output-metadata.json
25+
/app/src/androidTest/java/com/blazecode/eventtool/ExampleInstrumentedTest.kt
26+
/app/src/main/res/values-land/dimens.xml
27+
/app/src/main/res/values-w600dp/dimens.xml
28+
/app/src/main/res/values-w1240dp/dimens.xml
29+
/.idea/copyright/

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# EventTool
2+
Android tool which helps you to keep track of future events
3+
4+
### Features
5+
- Save events locally on your device
6+
- View events in a calendar view
7+
- Get notified 2h before you are supposed to be ready
8+
- Import / Export all saved data for backups and / or device transfer
9+
- Generate PDF files from your events to print out
10+
11+
### Screenshots
12+
<img src="screenshots.png" />
13+
14+
15+
### Bug reporting
16+
If you encounter any bugs please open an issue in the repo. Please consider including a logcat/screenshot or screen recording. If you open an issue please also include the app version and android version of your device.
17+
18+
### Disclaimer
19+
You are using this software at your own risk, I cannot be held responsible for any kind of damage this may produce in any way. Make use of the export feature and regularly create backups. Please only use the app when downloaded from official sources linked above.
20+
21+
### License
22+
MIT License
23+
24+
Copyright (c) 2022 BlazeCodeDev, Ralf Lehmann
25+
26+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
27+
28+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
29+
30+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-kapt'
5+
id 'kotlin-parcelize'
6+
id("com.mikepenz.aboutlibraries.plugin")
7+
}
8+
9+
android {
10+
compileSdk 33
11+
12+
defaultConfig {
13+
applicationId "com.blazecode.eventtool"
14+
minSdk 33
15+
targetSdk 33
16+
versionCode 10
17+
versionName "1.0"
18+
19+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20+
vectorDrawables {
21+
useSupportLibrary true
22+
}
23+
}
24+
25+
buildTypes {
26+
release {
27+
minifyEnabled false
28+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
29+
}
30+
}
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
buildFeatures {
39+
compose true
40+
viewBinding true
41+
}
42+
composeOptions {
43+
kotlinCompilerExtensionVersion = "1.3.1"
44+
}
45+
packagingOptions {
46+
resources {
47+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
48+
}
49+
}
50+
namespace 'com.blazecode.eventtool'
51+
}
52+
53+
dependencies {
54+
implementation platform('androidx.compose:compose-bom:2022.10.00')
55+
56+
implementation 'androidx.core:core-ktx:1.9.0'
57+
implementation "androidx.compose.ui:ui"
58+
implementation 'androidx.compose.material3:material3'
59+
implementation "androidx.compose.ui:ui-tooling-preview"
60+
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose'
61+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
62+
implementation 'androidx.activity:activity-compose:1.6.1'
63+
implementation 'androidx.appcompat:appcompat:1.5.1'
64+
implementation 'com.google.android.material:material:1.7.0'
65+
implementation 'androidx.annotation:annotation:1.5.0'
66+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
67+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
68+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
69+
testImplementation 'junit:junit:4.13.2'
70+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
71+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
72+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
73+
debugImplementation "androidx.compose.ui:ui-tooling"
74+
debugImplementation "androidx.compose.ui:ui-test-manifest"
75+
76+
// ROOM DB
77+
def room_version = "2.4.3"
78+
implementation "androidx.room:room-ktx:$room_version"
79+
kapt "androidx.room:room-compiler:$room_version"
80+
annotationProcessor "androidx.room:room-compiler:$room_version"
81+
82+
// ACCOMPANIST
83+
implementation 'com.google.accompanist:accompanist-flowlayout:0.27.0'
84+
implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
85+
implementation "com.google.accompanist:accompanist-navigation-animation:0.27.0"
86+
87+
// CALENDAR
88+
implementation 'com.kizitonwose.calendar:compose:2.0.2'
89+
90+
// NAVIGATION
91+
implementation("androidx.navigation:navigation-compose:2.5.3")
92+
93+
// GSON
94+
implementation 'com.google.code.gson:gson:2.10'
95+
96+
// LOTTIE
97+
implementation "com.airbnb.android:lottie-compose:5.2.0"
98+
99+
//ABOUT LIBRARIES
100+
implementation("com.mikepenz:aboutlibraries-compose:$ABOUT_LIBRARIES_VERSION")
101+
102+
//DATA STORE
103+
implementation("androidx.datastore:datastore-preferences:1.0.0")
104+
105+
// VOLLEY
106+
implementation 'com.android.volley:volley:1.2.1'
107+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ /*
4+
~ * Copyright (c) BlazeCode / Ralf Lehmann, 2022.
5+
~ */
6+
-->
7+
8+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
9+
xmlns:tools="http://schemas.android.com/tools">
10+
11+
<uses-permission android:name="android.permission.INTERNET" />
12+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
13+
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
14+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
15+
16+
<application
17+
android:allowBackup="true"
18+
android:dataExtractionRules="@xml/data_extraction_rules"
19+
android:enableOnBackInvokedCallback="true"
20+
android:fullBackupContent="@xml/backup_rules"
21+
android:icon="@mipmap/ic_launcher"
22+
android:label="@string/app_name"
23+
android:supportsRtl="true"
24+
android:theme="@style/Theme.EventTool"
25+
tools:targetApi="31">
26+
<activity
27+
android:name=".MainActivity"
28+
android:exported="true"
29+
android:label="@string/app_name"
30+
android:theme="@style/Theme.EventTool">
31+
<intent-filter>
32+
<action android:name="android.intent.action.MAIN" />
33+
34+
<category android:name="android.intent.category.LAUNCHER" />
35+
</intent-filter>
36+
</activity>
37+
38+
<receiver
39+
android:name=".reminders.ReminderBroadcastReceiver"
40+
android:enabled="true" />
41+
42+
<receiver
43+
android:name=".reminders.BootReceiver"
44+
android:enabled="true"
45+
android:exported="true">
46+
<intent-filter>
47+
<action android:name="android.intent.action.BOOT_COMPLETED" />
48+
</intent-filter>
49+
</receiver>
50+
51+
</application>
52+
53+
</manifest>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
*
3+
* * Copyright (c) BlazeCode / Ralf Lehmann, 2022.
4+
*
5+
*/
6+
7+
package com.blazecode.eventtool
8+
9+
import android.os.Bundle
10+
import android.widget.Toast
11+
import androidx.activity.ComponentActivity
12+
import androidx.activity.compose.setContent
13+
import androidx.compose.animation.ExperimentalAnimationApi
14+
import androidx.compose.material3.*
15+
import androidx.compose.runtime.mutableStateOf
16+
import androidx.compose.ui.res.stringResource
17+
import androidx.lifecycle.lifecycleScope
18+
import com.blazecode.eventtool.data.Event
19+
import com.blazecode.eventtool.database.DataBaseExporter
20+
import com.blazecode.eventtool.database.DataBaseImporter
21+
import com.blazecode.eventtool.navigation.NavRoutes
22+
import com.blazecode.eventtool.screens.*
23+
import com.blazecode.eventtool.ui.theme.EventToolTheme
24+
import com.blazecode.eventtool.util.PermissionManager
25+
import com.blazecode.eventtool.util.pdf.PdfPrinter
26+
import com.blazecode.eventtool.viewmodels.HomeViewModel
27+
import com.blazecode.eventtool.viewmodels.NewEventViewModel
28+
import com.blazecode.eventtool.viewmodels.SettingsViewModel
29+
import com.google.accompanist.navigation.animation.AnimatedNavHost
30+
import com.google.accompanist.navigation.animation.composable
31+
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
32+
import kotlinx.coroutines.launch
33+
34+
var errorDialogMessage = mutableStateOf("")
35+
var notificationTapEvent = mutableStateOf<Event?>(null)
36+
37+
class MainActivity : ComponentActivity() {
38+
@OptIn(ExperimentalAnimationApi::class)
39+
override fun onCreate(savedInstanceState: Bundle?) {
40+
super.onCreate(savedInstanceState)
41+
42+
// HACKY WAY TO PREVENT WHITE SCREEN BETWEEN TRANSITIONS
43+
lifecycleScope.launch {
44+
window.setBackgroundDrawableResource(android.R.color.transparent)
45+
}
46+
47+
// GET EVENT IF TAPPED NOTIFICATION
48+
notificationTapEvent.value = intent.extras?.getParcelable("event", Event::class.java)
49+
50+
val permissionManager = PermissionManager(this)
51+
52+
val exporter = DataBaseExporter(this)
53+
val importer = DataBaseImporter(this)
54+
val printer = PdfPrinter(this)
55+
// CONTENT
56+
setContent {
57+
val navController = rememberAnimatedNavController()
58+
AnimatedNavHost(navController = navController, startDestination = NavRoutes.Home.route) {
59+
// HOME
60+
composable(route= NavRoutes.Home.route,) { Home(HomeViewModel(application), navController, printer) }
61+
// NEW EVENT
62+
composable(NavRoutes.NewEvent.route) {
63+
val event = navController.previousBackStackEntry?.savedStateHandle?.get<Event>("event")
64+
event?.let {
65+
NewEvent(NewEventViewModel(application, event), navController) }
66+
}
67+
// SETTINGS
68+
composable(NavRoutes.Settings.route){ Settings(SettingsViewModel(application), navController, permissionManager, exporter, importer) }
69+
// OPEN SOURCE LICENSES
70+
composable(NavRoutes.OpenSourceLicenses.route){ OpenSourceLicenses(navController) }
71+
}
72+
73+
// ERROR DIALOG
74+
EventToolTheme {
75+
if(errorDialogMessage.value != ""){
76+
AlertDialog(
77+
onDismissRequest = { errorDialogMessage.value = "" },
78+
title = { Text(stringResource(R.string.error)) },
79+
text = { Text(errorDialogMessage.value) },
80+
confirmButton = { OutlinedButton(onClick = { errorDialogMessage.value = "" })
81+
{ Text(stringResource(R.string.close)) } }
82+
)
83+
}
84+
}
85+
}
86+
}
87+
88+
fun sendToast(text:String){
89+
Toast.makeText(this, text, Toast.LENGTH_LONG).show()
90+
println(text)
91+
}
92+
93+
fun sendErrorDialog(text: String){
94+
errorDialogMessage.value = text
95+
}
96+
}
97+

0 commit comments

Comments
 (0)