Compare commits
3 Commits
790a5fabcd
...
31c81021ce
Author | SHA1 | Date | |
---|---|---|---|
31c81021ce | |||
82d62132c0 | |||
1a1b3677f9 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
secrets.properties
|
14
NOTICE.md
14
NOTICE.md
@ -8,12 +8,6 @@ This project incorporates components from the following third-party libraries:
|
||||
Licensed under Apache License 2.0
|
||||
[https://developer.android.com](https://developer.android.com)
|
||||
|
||||
## ACRA
|
||||
- **ch.acra:acra-http**
|
||||
Copyright ACRA
|
||||
Licensed under Apache License 2.0
|
||||
[https://github.com/ACRA/acra](https://github.com/ACRA/acra)
|
||||
|
||||
## Coil
|
||||
- **io.coil-kt:coil-compose**
|
||||
Copyright Coil Contributors
|
||||
@ -53,6 +47,12 @@ This project incorporates components from the following third-party libraries:
|
||||
Copyright Google LLC
|
||||
Licensed under Apache License 2.0
|
||||
|
||||
## Sentry Android
|
||||
- **io.sentry:sentry-android**
|
||||
Copyright Sentry and contributors
|
||||
Licensed under MIT License
|
||||
[https://github.com/getsentry/sentry-java](https://github.com/getsentry/sentry-java)
|
||||
|
||||
## Build Tools
|
||||
- **Gradle Plugins** (Android, Kotlin)
|
||||
Copyright Google LLC / JetBrains s.r.o.
|
||||
@ -67,4 +67,4 @@ This product includes software developed by:
|
||||
- Google LLC
|
||||
- And other contributors listed above
|
||||
|
||||
Full license texts are available in the [LICENSE](LICENSE) file and respective library repositories.
|
||||
Full license texts are available in the [LICENSE](LICENSE) file and respective library repositories.
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.androidApplication)
|
||||
@ -9,6 +10,7 @@ plugins {
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
|
||||
id("com.google.devtools.ksp")
|
||||
id("io.sentry.android.gradle") version "5.5.0"
|
||||
}
|
||||
|
||||
secrets {
|
||||
@ -32,6 +34,15 @@ android {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
|
||||
val secretProperties = Properties().apply {
|
||||
val secretFile = rootProject.file("secrets.properties")
|
||||
if (secretFile.exists())
|
||||
secretFile.inputStream().use { load(it) }
|
||||
else
|
||||
println("Warning: secrets.properties not found!")
|
||||
}
|
||||
manifestPlaceholders["sentry_url"] = secretProperties.getProperty("SENTRY_URL")!!
|
||||
|
||||
// javaCompileOptions {
|
||||
// annotationProcessorOptions {
|
||||
// arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
@ -44,18 +55,21 @@ android {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
resValue("string", "app_name", "@string/app_name_reg")
|
||||
manifestPlaceholders["sentry_env"] = "production"
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix =
|
||||
"-debug+${LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)}"
|
||||
resValue("string", "app_name", "@string/app_name_dev")
|
||||
manifestPlaceholders["sentry_env"] = "debug"
|
||||
}
|
||||
create("beta") {
|
||||
versionNameSuffix =
|
||||
"-beta+${LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)}"
|
||||
resValue("string", "app_name", "@string/app_name_beta")
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
manifestPlaceholders["sentry_env"] = "beta"
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@ -120,9 +134,9 @@ dependencies {
|
||||
|
||||
implementation(libs.compose)
|
||||
|
||||
implementation(libs.acra.http)
|
||||
implementation(libs.sentry)
|
||||
|
||||
implementation(libs.androidx.room.runtime)
|
||||
implementation(libs.androidx.room.ktx)
|
||||
ksp(libs.androidx.room.compiler)
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,35 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.UNN"
|
||||
tools:targetApi="31">
|
||||
|
||||
<meta-data
|
||||
android:name="io.sentry.dsn"
|
||||
android:value="${sentry_url}" />
|
||||
<meta-data
|
||||
android:name="io.sentry.environment"
|
||||
android:value="${sentry_env}" />
|
||||
<meta-data
|
||||
android:name="io.sentry.send-default-pii"
|
||||
android:value="true" />
|
||||
<meta-data
|
||||
android:name="io.sentry.traces.sample-rate"
|
||||
android:value="1.0" />
|
||||
<meta-data
|
||||
android:name="io.sentry.traces.user-interaction.enable"
|
||||
android:value="true" />
|
||||
<meta-data
|
||||
android:name="io.sentry.attach-screenshot"
|
||||
android:value="true" />
|
||||
<meta-data
|
||||
android:name="io.sentry.attach-view-hierarchy"
|
||||
android:value="true" />
|
||||
<meta-data
|
||||
android:name="io.sentry.session-replay.on-error-sample-rate"
|
||||
android:value="1.0" />
|
||||
<meta-data
|
||||
android:name="io.sentry.session-replay.session-sample-rate"
|
||||
android:value="0.1" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.layout.MainActivity"
|
||||
android:exported="true"
|
||||
@ -31,4 +60,4 @@
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -8,16 +8,5 @@ import android.content.Context
|
||||
class UNNApp : Application() {
|
||||
override fun attachBaseContext(base: Context) {
|
||||
super.attachBaseContext(base)
|
||||
|
||||
// initAcra {
|
||||
// buildConfigClass = BuildConfig::class.java
|
||||
// reportFormat = StringFormat.JSON
|
||||
// httpSender {
|
||||
// uri = BuildConfig.ACRA_URL
|
||||
// basicAuthLogin = BuildConfig.ACRA_LOGIN
|
||||
// basicAuthPassword = BuildConfig.ACRA_PASS
|
||||
// httpMethod = HttpSender.Method.POST
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
38
app/src/main/java/ru/sweetbread/unn/ui/composes/About.kt
Normal file
38
app/src/main/java/ru/sweetbread/unn/ui/composes/About.kt
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright (c) 2025 Gleb Zaharov. License: GPLv3 (see LICENSE).
|
||||
|
||||
package ru.sweetbread.unn.ui.composes
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ru.sweetbread.unn.R
|
||||
import splitties.resources.appStr
|
||||
|
||||
@Composable
|
||||
fun About() {
|
||||
Column(Modifier.fillMaxSize()) {
|
||||
Text(
|
||||
appStr(R.string.developer),
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
)
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.background(
|
||||
color = MaterialTheme.colorScheme.surfaceContainerHigh,
|
||||
shape = RoundedCornerShape(16.dp)
|
||||
)
|
||||
.padding(16.dp)
|
||||
) {
|
||||
Text("meow")
|
||||
}
|
||||
}
|
||||
}
|
@ -187,7 +187,7 @@ fun PostItem(modifier: Modifier = Modifier, post: Post, extended: Boolean = fals
|
||||
LinearProgressIndicator(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(8.dp),
|
||||
.padding(horizontal = 8.dp, vertical = 38.dp),
|
||||
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||
trackColor = MaterialTheme.colorScheme.secondary,
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ import androidx.compose.material.icons.filled.AccountBox
|
||||
import androidx.compose.material.icons.filled.DateRange
|
||||
import androidx.compose.material.icons.filled.Home
|
||||
import androidx.compose.material.icons.filled.Menu
|
||||
import androidx.compose.material.icons.outlined.Info
|
||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||
import androidx.compose.material3.DrawerValue
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
@ -60,6 +61,7 @@ import kotlinx.coroutines.launch
|
||||
import ru.sweetbread.unn.R
|
||||
import ru.sweetbread.unn.api.ME
|
||||
import ru.sweetbread.unn.api.portalURL
|
||||
import ru.sweetbread.unn.ui.composes.About
|
||||
import ru.sweetbread.unn.ui.composes.Blogposts
|
||||
import ru.sweetbread.unn.ui.composes.Schedule
|
||||
import ru.sweetbread.unn.ui.theme.UNNTheme
|
||||
@ -178,6 +180,9 @@ class MainActivity : ComponentActivity() {
|
||||
composable("journal/schedule") {
|
||||
Schedule()
|
||||
}
|
||||
composable("about") {
|
||||
About()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -219,7 +224,8 @@ class MainActivity : ComponentActivity() {
|
||||
TextButton(
|
||||
{},
|
||||
Modifier.fillMaxWidth(),
|
||||
shape = RectangleShape
|
||||
shape = RectangleShape,
|
||||
enabled = false
|
||||
) {
|
||||
Text(
|
||||
appStr(R.string.record_book),
|
||||
@ -231,7 +237,8 @@ class MainActivity : ComponentActivity() {
|
||||
TextButton(
|
||||
{},
|
||||
Modifier.fillMaxWidth(),
|
||||
shape = RectangleShape
|
||||
shape = RectangleShape,
|
||||
enabled = false
|
||||
) {
|
||||
Text(
|
||||
appStr(R.string.documents),
|
||||
@ -243,7 +250,8 @@ class MainActivity : ComponentActivity() {
|
||||
TextButton(
|
||||
{},
|
||||
Modifier.fillMaxWidth(),
|
||||
shape = RectangleShape
|
||||
shape = RectangleShape,
|
||||
enabled = false
|
||||
) {
|
||||
Text(
|
||||
appStr(R.string.materials),
|
||||
@ -256,10 +264,15 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
HorizontalDivider()
|
||||
TextButton(
|
||||
{},
|
||||
{navController.navigate("about")},
|
||||
Modifier.fillMaxWidth(),
|
||||
shape = RectangleShape
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Info,
|
||||
contentDescription = "Info",
|
||||
modifier = Modifier.padding(horizontal = 4.dp)
|
||||
)
|
||||
Text(appStr(R.string.about_app))
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
<string name="about_app">About app</string>
|
||||
<string name="documents">Documents</string>
|
||||
<string name="materials">Materials</string>
|
||||
<string name="developer">Developer</string>
|
||||
<string-array name="short_weekdays">
|
||||
<item>Mn</item>
|
||||
<item>Tu</item>
|
||||
|
@ -1,5 +1,4 @@
|
||||
[versions]
|
||||
acraHttp = "5.11.3"
|
||||
agp = "8.7.3"
|
||||
calendar = "2.6.2"
|
||||
coilCompose = "2.7.0"
|
||||
@ -23,11 +22,11 @@ activity = "1.10.1"
|
||||
navigationCompose = "2.8.9"
|
||||
roomRuntime = "2.7.1"
|
||||
secretsGradlePlugin = "2.0.1"
|
||||
sentryAndroid = "8.12.0"
|
||||
splitties = "3.0.0"
|
||||
materialIconsCoreAndroid = "1.7.8"
|
||||
|
||||
[libraries]
|
||||
acra-http = { module = "ch.acra:acra-http", version.ref = "acraHttp" }
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
|
||||
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
|
||||
@ -62,6 +61,7 @@ androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecy
|
||||
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
|
||||
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||
secrets-gradle-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" }
|
||||
sentry = { module = "io.sentry:sentry-android", version.ref = "sentryAndroid" }
|
||||
splitties-base = { module = "com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl", version.ref = "splitties" }
|
||||
splitties-room = { module = "com.louiscad.splitties:splitties-arch-room", version.ref = "splitties" }
|
||||
androidx-material-icons-core-android = { group = "androidx.compose.material", name = "material-icons-core-android", version.ref = "materialIconsCoreAndroid" }
|
||||
@ -70,4 +70,3 @@ androidx-material-icons-core-android = { group = "androidx.compose.material", na
|
||||
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
||||
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
# Copyright (c) 2025 Gleb Zaharov. License: GPLv3 (see LICENSE).
|
||||
|
||||
ACRA_URL=https://bugs.coders-squad.com/report
|
||||
ACRA_LOGIN=pMJkqPlNLX4kQ3kK
|
||||
ACRA_PASS=HYY72oV4ybmpCggC
|
Loading…
x
Reference in New Issue
Block a user