Skip to content

Commit bef5662

Browse files
committed
Merge branch 'development'
2 parents 9cd544f + 55bcdfa commit bef5662

29 files changed

+997
-438
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ local.properties
2727
/app/src/main/res/values-w600dp/dimens.xml
2828
/app/src/main/res/values-w1240dp/dimens.xml
2929
/.idea/copyright/
30+
/.idea/

app/build.gradle

Lines changed: 0 additions & 110 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
plugins {
2+
id("com.android.application")
3+
id("org.jetbrains.kotlin.android")
4+
id("com.google.devtools.ksp")
5+
id("kotlin-parcelize")
6+
id("com.mikepenz.aboutlibraries.plugin")
7+
}
8+
9+
android {
10+
namespace = "com.blazecode.eventtool"
11+
compileSdk = 34
12+
13+
defaultConfig {
14+
applicationId = "com.blazecode.eventtool"
15+
minSdk = 33
16+
targetSdk = 34
17+
versionCode = 19
18+
versionName = "1.4.0"
19+
20+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
21+
}
22+
23+
buildTypes {
24+
getByName("release") {
25+
isMinifyEnabled = false
26+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
27+
}
28+
}
29+
compileOptions {
30+
sourceCompatibility = JavaVersion.VERSION_17
31+
targetCompatibility = JavaVersion.VERSION_17
32+
}
33+
kotlinOptions {
34+
jvmTarget = "17"
35+
}
36+
buildFeatures {
37+
compose = true
38+
viewBinding = true
39+
}
40+
composeOptions {
41+
kotlinCompilerExtensionVersion = "1.5.4"
42+
}
43+
}
44+
45+
val aboutLibrariesVersion: String by rootProject.extra
46+
val composeVersion: String by rootProject.extra
47+
48+
dependencies {
49+
implementation(platform("androidx.compose:compose-bom:2023.10.01"))
50+
51+
implementation("androidx.core:core-ktx:1.12.0")
52+
implementation("androidx.compose.ui:ui")
53+
implementation("androidx.compose.material3:material3")
54+
implementation("androidx.compose.ui:ui-tooling-preview")
55+
implementation("androidx.lifecycle:lifecycle-viewmodel-compose")
56+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
57+
implementation("androidx.activity:activity-compose:1.8.1")
58+
implementation("androidx.appcompat:appcompat:1.6.1")
59+
implementation("com.google.android.material:material:1.10.0")
60+
implementation("androidx.annotation:annotation:1.7.0")
61+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
62+
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
63+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
64+
testImplementation("junit:junit:4.13.2")
65+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
66+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
67+
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersion")
68+
debugImplementation("androidx.compose.ui:ui-tooling")
69+
debugImplementation("androidx.compose.ui:ui-test-manifest")
70+
71+
// ROOM DB
72+
val room_version = "2.6.0"
73+
implementation("androidx.room:room-ktx:$room_version")
74+
ksp("androidx.room:room-compiler:$room_version")
75+
annotationProcessor("androidx.room:room-compiler:$room_version")
76+
77+
// ACCOMPANIST
78+
val accompanist_version = "0.33.2-alpha"
79+
implementation("com.google.accompanist:accompanist-flowlayout:$accompanist_version")
80+
implementation("com.google.accompanist:accompanist-systemuicontroller:$accompanist_version")
81+
implementation("com.google.accompanist:accompanist-permissions:$accompanist_version")
82+
83+
// CALENDAR
84+
implementation("com.kizitonwose.calendar:compose:2.4.0")
85+
86+
// NAVIGATION
87+
implementation("androidx.navigation:navigation-compose:2.7.5")
88+
89+
// GSON
90+
implementation("com.google.code.gson:gson:2.10.1")
91+
92+
// LOTTIE
93+
implementation("com.airbnb.android:lottie-compose:6.1.0")
94+
95+
//ABOUT LIBRARIES
96+
implementation("com.mikepenz:aboutlibraries-compose:$aboutLibrariesVersion")
97+
98+
//DATA STORE
99+
implementation("androidx.datastore:datastore-preferences:1.0.0")
100+
101+
// VOLLEY
102+
implementation("com.android.volley:volley:1.2.1")
103+
104+
// COMPOSE DATE TIME PICKER
105+
implementation("com.marosseleng.android:compose-material3-datetime-pickers:0.7.2")
106+
107+
// CRASH DETECTION
108+
val acraVersion = "5.11.3"
109+
implementation("ch.acra:acra-mail:$acraVersion")
110+
implementation("ch.acra:acra-dialog:$acraVersion")
111+
implementation("com.google.guava:guava:32.1.3-jre")
112+
}

app/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
android:label="@string/app_name"
2323
android:supportsRtl="true"
2424
android:theme="@style/Theme.EventTool"
25-
tools:targetApi="31">
25+
android:name=".EventToolApplication">
2626
<activity
2727
android:name=".MainActivity"
2828
android:exported="true"
@@ -34,6 +34,14 @@
3434
<category android:name="android.intent.category.LAUNCHER" />
3535
</intent-filter>
3636
</activity>
37+
<activity
38+
android:name=".util.errors.ErrorReportActivity"
39+
android:exported="true"
40+
android:theme="@style/Theme.EventTool.TransparentBackground"
41+
android:process=":acra"
42+
android:excludeFromRecents="true"
43+
android:finishOnTaskLaunch="true"
44+
android:launchMode="singleInstance" />
3745

3846
<receiver
3947
android:name=".reminders.ReminderBroadcastReceiver"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.blazecode.eventtool
2+
3+
import android.app.Application
4+
import android.content.Context
5+
import com.blazecode.eventtool.util.errors.ErrorReportActivity
6+
import org.acra.config.coreConfiguration
7+
import org.acra.config.dialog
8+
import org.acra.config.mailSender
9+
import org.acra.data.StringFormat
10+
import org.acra.ktx.initAcra
11+
12+
class EventToolApplication: Application() {
13+
override fun attachBaseContext(base: Context) {
14+
super.attachBaseContext(base)
15+
16+
initAcra{
17+
coreConfiguration {
18+
withBuildConfigClass(BuildConfig::class.java)
19+
withReportFormat(StringFormat.JSON)
20+
}
21+
mailSender {
22+
mailTo = resources.getString(R.string.email_address)
23+
reportAsFile = true
24+
reportFileName = "error_report.json"
25+
subject = "EventTool - Error Report"
26+
}
27+
dialog {
28+
enabled = true
29+
reportDialogClass = ErrorReportActivity::class.java
30+
}
31+
}
32+
}
33+
}

app/src/main/java/com/blazecode/eventtool/MainActivity.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,37 @@ import android.os.Bundle
1010
import android.widget.Toast
1111
import androidx.activity.ComponentActivity
1212
import androidx.activity.compose.setContent
13+
import androidx.activity.enableEdgeToEdge
1314
import androidx.compose.animation.ExperimentalAnimationApi
1415
import androidx.compose.material3.*
1516
import androidx.compose.runtime.mutableStateOf
1617
import androidx.compose.ui.res.stringResource
1718
import androidx.lifecycle.lifecycleScope
19+
import androidx.navigation.compose.NavHost
20+
import androidx.navigation.compose.composable
21+
import androidx.navigation.compose.rememberNavController
1822
import com.blazecode.eventtool.data.Event
1923
import com.blazecode.eventtool.database.DataBaseExporter
2024
import com.blazecode.eventtool.database.DataBaseImporter
2125
import com.blazecode.eventtool.navigation.NavRoutes
2226
import com.blazecode.eventtool.screens.*
2327
import com.blazecode.eventtool.ui.theme.EventToolTheme
24-
import com.blazecode.eventtool.util.PermissionManager
2528
import com.blazecode.eventtool.util.pdf.PdfPrinter
2629
import com.blazecode.eventtool.viewmodels.HomeViewModel
2730
import com.blazecode.eventtool.viewmodels.NewEventViewModel
2831
import com.blazecode.eventtool.viewmodels.SearchViewModel
2932
import com.blazecode.eventtool.viewmodels.SettingsViewModel
30-
import com.google.accompanist.navigation.animation.AnimatedNavHost
31-
import com.google.accompanist.navigation.animation.composable
32-
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
3333
import kotlinx.coroutines.launch
3434

3535
var errorDialogMessage = mutableStateOf("")
3636
var notificationTapEvent = mutableStateOf<Event?>(null)
3737

3838
class MainActivity : ComponentActivity() {
39-
@OptIn(ExperimentalAnimationApi::class)
4039
override fun onCreate(savedInstanceState: Bundle?) {
4140
super.onCreate(savedInstanceState)
4241

42+
enableEdgeToEdge()
43+
4344
// HACKY WAY TO PREVENT WHITE SCREEN BETWEEN TRANSITIONS
4445
lifecycleScope.launch {
4546
window.setBackgroundDrawableResource(android.R.color.transparent)
@@ -48,15 +49,13 @@ class MainActivity : ComponentActivity() {
4849
// GET EVENT IF TAPPED NOTIFICATION
4950
notificationTapEvent.value = intent.extras?.getParcelable("event", Event::class.java)
5051

51-
val permissionManager = PermissionManager(this)
52-
5352
val exporter = DataBaseExporter(this)
5453
val importer = DataBaseImporter(this)
5554
val printer = PdfPrinter(this)
5655
// CONTENT
5756
setContent {
58-
val navController = rememberAnimatedNavController()
59-
AnimatedNavHost(navController = navController, startDestination = NavRoutes.Home.route) {
57+
val navController = rememberNavController()
58+
NavHost(navController = navController, startDestination = NavRoutes.Home.route) {
6059
// HOME
6160
composable(route= NavRoutes.Home.route,) { Home(HomeViewModel(application), navController, printer) }
6261
// NEW EVENT
@@ -68,7 +67,7 @@ class MainActivity : ComponentActivity() {
6867
// SEARCH
6968
composable(NavRoutes.Search.route) { Search(SearchViewModel(application), navController, printer) }
7069
// SETTINGS
71-
composable(NavRoutes.Settings.route){ Settings(SettingsViewModel(application), navController, permissionManager, exporter, importer) }
70+
composable(NavRoutes.Settings.route){ Settings(SettingsViewModel(application), navController, exporter, importer) }
7271
// OPEN SOURCE LICENSES
7372
composable(NavRoutes.OpenSourceLicenses.route){ OpenSourceLicenses(navController) }
7473
}

app/src/main/java/com/blazecode/eventtool/database/EventDAO.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.room.Insert
1111
import androidx.room.OnConflictStrategy
1212
import androidx.room.Query
1313
import com.blazecode.eventtool.data.Event
14+
import java.time.LocalDate
1415

1516
@Dao
1617
interface EventDAO {
@@ -24,9 +25,19 @@ interface EventDAO {
2425
@Insert(onConflict = OnConflictStrategy.REPLACE)
2526
fun addEvent(vararg users: Event)
2627

27-
@Query("SELECT * FROM Event WHERE name LIKE :name OR firstName1 LIKE :name OR firstName2 LIKE :name OR lastName LIKE :name OR date LIKE :name")
28+
@Query("SELECT * FROM Event " +
29+
"WHERE name LIKE :name " +
30+
"OR firstName1 LIKE :name " +
31+
"OR firstName2 LIKE :name " +
32+
"OR lastName LIKE :name " +
33+
"OR date LIKE :name " +
34+
"OR venue LIKE :name " +
35+
"OR comments LIKE :name ")
2836
fun getEventsByName(name: String): MutableList<Event>
2937

38+
@Query("SELECT * FROM Event WHERE date LIKE :date")
39+
fun getEventsByDate(date: LocalDate): MutableList<Event>
40+
3041
@Query("DELETE FROM Event WHERE id LIKE :id")
3142
fun deleteById(id: Int)
3243

0 commit comments

Comments
 (0)