Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23963e295c | ||
|
|
dd921c6e78 | ||
|
|
0c27450560 | ||
|
|
4084c3b2cb | ||
|
|
f52cddd311 | ||
|
|
156342e379 | ||
|
|
06e7efe55e | ||
|
|
d3d96d0130 | ||
|
|
2ee1df0d7f | ||
|
|
647fcc8ba6 | ||
|
|
57cc25ba9a | ||
|
|
06f9d7521b | ||
|
|
12d891a0e4 | ||
|
|
3bac016a8b | ||
|
|
81e875bea8 | ||
|
|
aed00c0694 | ||
|
|
6cbe12fb10 | ||
|
|
992c0b4a34 | ||
|
|
d8bda87b38 | ||
|
|
cca561f11b | ||
|
|
7907429aea | ||
|
|
4cb07126e2 | ||
|
|
1d885ade70 | ||
|
|
8615eee3a7 | ||
|
|
e3bb1b9cfa | ||
|
|
0109c7aa09 | ||
|
|
7800eeb61b | ||
|
|
4b7fbfd766 |
+2
-15
@@ -1,16 +1,3 @@
|
|||||||
*.iml
|
|
||||||
.gradle
|
|
||||||
/local.properties
|
|
||||||
/.idea/caches
|
|
||||||
/.idea/libraries
|
|
||||||
/.idea/modules.xml
|
|
||||||
/.idea/workspace.xml
|
|
||||||
/.idea/navEditor.xml
|
|
||||||
/.idea/assetWizardSettings.xml
|
|
||||||
.DS_Store
|
|
||||||
/build
|
|
||||||
/captures
|
|
||||||
.externalNativeBuild
|
|
||||||
.cxx
|
|
||||||
local.properties
|
|
||||||
mobile/app/build
|
mobile/app/build
|
||||||
|
mobile/local.properties
|
||||||
|
mobile/.gradle
|
||||||
Generated
-10
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetSelector">
|
|
||||||
<selectionStates>
|
|
||||||
<SelectionState runConfigName="app">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
</selectionStates>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-12
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MaterialThemeProjectNewConfig">
|
|
||||||
<option name="metadata">
|
|
||||||
<MTProjectMetadataState>
|
|
||||||
<option name="migrated" value="true" />
|
|
||||||
<option name="pristineConfig" value="false" />
|
|
||||||
<option name="userId" value="-239e49af:192a4be9597:-7ffe" />
|
|
||||||
</MTProjectMetadataState>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-17
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-6
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1,3 +1,13 @@
|
|||||||

|

|
||||||
# Zorientujte se rychleji v této odlehčené verzi Školy OnLine
|
# Zorientujte se rychleji v této odlehčené verzi Školy OnLine
|
||||||
# Odkaz na stažení aplikace pro Android [zde](https://gitlab.com/Odweta/solon/-/releases/2.5/downloads/app-release.apk) (verze 2.5)
|
# Odkaz na stažení aplikace pro Android [zde](https://gitlab.com/Odweta/solon/-/releases/2.5.2/downloads/app-release.apk) (verze 2.5.2)
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||||
|
alt="Nyní na F-Droidu"
|
||||||
|
height="80">](https://f-droid.org/packages/com.odweta.solon/)
|
||||||
|
|
||||||
|
[<img src='https://play.google.com/intl/en_us/badges/static/images/badges/cs_badge_web_generic.png'
|
||||||
|
alt='Nyní na Google Play'
|
||||||
|
height="80">](https://play.google.com/store/apps/details?id=com.odweta.solon)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ echo
|
|||||||
echo
|
echo
|
||||||
echo "[signing]"
|
echo "[signing]"
|
||||||
echo
|
echo
|
||||||
~/Android/Sdk/build-tools/35.0.0/apksigner sign --alignment-preserved --ks ~/Documents/android-keystore.jks --ks-pass pass:$ks_pass app/build/outputs/apk/release/com.odweta.solon_$ver.apk
|
apksigner sign --alignment-preserved --ks ~/docs/android-keystore.jks --ks-pass pass:$ks_pass app/build/outputs/apk/release/com.odweta.solon_$ver.apk
|
||||||
|
|
||||||
# create the tag
|
# create the tag
|
||||||
echo
|
echo
|
||||||
|
|||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/data/data/com.termux/files/usr/bin/bash
|
||||||
|
|
||||||
|
cd mobile
|
||||||
|
|
||||||
|
INTERNAL_STORAGE=/data/data/com.termux/files/home/storage/downloads/..
|
||||||
|
|
||||||
|
echo -n 'keystore key for signing: '
|
||||||
|
read kskey
|
||||||
|
|
||||||
|
echo 'building the release bundle'
|
||||||
|
|
||||||
|
gradle bundleRelease
|
||||||
|
|
||||||
|
mkdir -p $INTERNAL_STORAGE/solon-bin/
|
||||||
|
|
||||||
|
cp $SOLON/mobile/app/build/outputs/bundle/release/app-release.aab $INTERNAL_STORAGE/solon-bin/
|
||||||
|
|
||||||
|
echo 'app-bundle.aab copied to \$INTERNAL_STORAGE/solon-bin'
|
||||||
|
|
||||||
|
apksigner sign --ks $INTERNAL_STORAGE/Documents/android-keystore.jks --ks-pass pass:$kskey --min-sdk-version=28 $INTERNAL_STORAGE/solon-bin/app-release.aab
|
||||||
|
|
||||||
|
echo 'aab signed with default android keystore'
|
||||||
|
|
||||||
|
cd ..
|
||||||
Generated
+2
@@ -1,3 +1,5 @@
|
|||||||
# Default ignored files
|
# Default ignored files
|
||||||
/shelf/
|
/shelf/
|
||||||
/workspace.xml
|
/workspace.xml
|
||||||
|
/AndroidProjectSystem.xml
|
||||||
|
/deviceManager.xml
|
||||||
|
|||||||
Generated
+123
@@ -0,0 +1,123 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<JetCodeStyleSettings>
|
||||||
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
|
</JetCodeStyleSettings>
|
||||||
|
<codeStyleSettings language="XML">
|
||||||
|
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
|
<arrangement>
|
||||||
|
<rules>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:android</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:id</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>style</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
</rules>
|
||||||
|
</arrangement>
|
||||||
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="kotlin">
|
||||||
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
-6
@@ -13,12 +13,6 @@
|
|||||||
</DropdownSelection>
|
</DropdownSelection>
|
||||||
<DialogSelection />
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
<SelectionState runConfigName="TimetablePreview">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
<SelectionState runConfigName="RBPreview">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
</SelectionState>
|
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
-4
@@ -6,10 +6,6 @@
|
|||||||
<component name="Kotlin2JvmCompilerArguments">
|
<component name="Kotlin2JvmCompilerArguments">
|
||||||
<option name="jvmTarget" value="1.8" />
|
<option name="jvmTarget" value="1.8" />
|
||||||
</component>
|
</component>
|
||||||
<component name="KotlinCommonCompilerArguments">
|
|
||||||
<option name="apiVersion" value="2.0" />
|
|
||||||
<option name="languageVersion" value="2.0" />
|
|
||||||
</component>
|
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.0.0" />
|
<option name="version" value="2.0.0" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Generated
+9
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -32,8 +32,8 @@ android {
|
|||||||
applicationId = "com.odweta.solon"
|
applicationId = "com.odweta.solon"
|
||||||
minSdk = 28
|
minSdk = 28
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 211
|
versionCode = 216
|
||||||
versionName = "2.4"
|
versionName = "2.6.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,10 @@ object BackButtonFactory: BackButtonFactoryInterface {
|
|||||||
@Composable
|
@Composable
|
||||||
override fun get(type: BackButtonType): @Composable () -> Unit {
|
override fun get(type: BackButtonType): @Composable () -> Unit {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
BackButtonType.Menu -> { { BackButton { global.currentScreenElement = ScreenElement.Menu } } }
|
BackButtonType.Menu -> { { BackButton {
|
||||||
|
global.currentScreenElement = ScreenElement.Menu
|
||||||
|
global.currentScreen = Screen.Main
|
||||||
|
} } }
|
||||||
BackButtonType.MarksAll -> { { BackButton {
|
BackButtonType.MarksAll -> { { BackButton {
|
||||||
global.currentScreenElement = ScreenElement.Marks
|
global.currentScreenElement = ScreenElement.Marks
|
||||||
global.marksDepthLevel = MarksDepthLevel.All
|
global.marksDepthLevel = MarksDepthLevel.All
|
||||||
|
|||||||
@@ -15,12 +15,16 @@ import androidx.compose.foundation.layout.height
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.MutableState
|
import androidx.compose.runtime.MutableState
|
||||||
import androidx.compose.runtime.RecomposeScope
|
import androidx.compose.runtime.RecomposeScope
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.key
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.LocalViewConfiguration
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.odweta.solon.ui.theme.PastelYellow
|
import com.odweta.solon.ui.theme.PastelYellow
|
||||||
@@ -32,7 +36,9 @@ import java.util.concurrent.Callable
|
|||||||
enum class Screen {
|
enum class Screen {
|
||||||
Main,
|
Main,
|
||||||
Splash,
|
Splash,
|
||||||
SignIn
|
SignIn,
|
||||||
|
Settings,
|
||||||
|
Temp
|
||||||
}
|
}
|
||||||
|
|
||||||
// default settings (will get overwritten by the saved settings)
|
// default settings (will get overwritten by the saved settings)
|
||||||
@@ -187,15 +193,17 @@ enum class ScreenElement {
|
|||||||
FinalMarks,
|
FinalMarks,
|
||||||
Menu,
|
Menu,
|
||||||
About,
|
About,
|
||||||
Settings,
|
SignOut,
|
||||||
SignOut
|
Temp
|
||||||
}
|
}
|
||||||
|
|
||||||
class Global {
|
class Global {
|
||||||
lateinit var timetableJSON: JSONObject
|
lateinit var timetableJSON: JSONObject
|
||||||
lateinit var marksJSON: JSONObject
|
lateinit var marksJSON: JSONObject
|
||||||
|
lateinit var finalMarksJSON: JSONObject
|
||||||
lateinit var marks: MutableMap<String, MutableList<Mark>>
|
lateinit var marks: MutableMap<String, MutableList<Mark>>
|
||||||
lateinit var newMarks: MutableMap<String, MutableList<Mark>>
|
lateinit var newMarks: MutableMap<String, MutableList<Mark>>
|
||||||
|
lateinit var finalMarks: Map<String, Int>
|
||||||
lateinit var settings: SettingsData
|
lateinit var settings: SettingsData
|
||||||
lateinit var fileDir: File
|
lateinit var fileDir: File
|
||||||
|
|
||||||
@@ -217,11 +225,14 @@ class Global {
|
|||||||
var selectedLecture: Int = 0
|
var selectedLecture: Int = 0
|
||||||
var currentLectureNumber: Int = 0
|
var currentLectureNumber: Int = 0
|
||||||
|
|
||||||
|
var tempScreen by mutableStateOf(Screen.Settings)
|
||||||
|
var tempScreenElement by mutableStateOf(ScreenElement.Timetable)
|
||||||
var currentScreen by mutableStateOf(Screen.Main)
|
var currentScreen by mutableStateOf(Screen.Main)
|
||||||
var currentScreenElement by mutableStateOf(ScreenElement.Timetable)
|
var currentScreenElement by mutableStateOf(ScreenElement.Timetable)
|
||||||
|
|
||||||
var status by mutableStateOf("")
|
var status by mutableStateOf("")
|
||||||
|
|
||||||
|
var returnToTempScreen by mutableStateOf(false)
|
||||||
var isAPISetUp by mutableStateOf(false)
|
var isAPISetUp by mutableStateOf(false)
|
||||||
var launched by mutableStateOf(false)
|
var launched by mutableStateOf(false)
|
||||||
var refreshed by mutableStateOf(false)
|
var refreshed by mutableStateOf(false)
|
||||||
@@ -230,6 +241,8 @@ class Global {
|
|||||||
var subjectToShow by mutableStateOf("")
|
var subjectToShow by mutableStateOf("")
|
||||||
var markToShow by mutableStateOf(Mark())
|
var markToShow by mutableStateOf(Mark())
|
||||||
|
|
||||||
|
var demoMode: Boolean = false
|
||||||
|
|
||||||
inner class FilePaths {
|
inner class FilePaths {
|
||||||
val accountData: String = "account_data.txt"
|
val accountData: String = "account_data.txt"
|
||||||
val timetable: String = "timetable.json"
|
val timetable: String = "timetable.json"
|
||||||
@@ -237,6 +250,7 @@ class Global {
|
|||||||
val marks: String = "marks.json"
|
val marks: String = "marks.json"
|
||||||
val settings: String = "settings.txt"
|
val settings: String = "settings.txt"
|
||||||
val lectureNotes: String = "lecture_notes.csv"
|
val lectureNotes: String = "lecture_notes.csv"
|
||||||
|
val finalMarks: String = "final_marks.txt"
|
||||||
}
|
}
|
||||||
val filePaths = FilePaths()
|
val filePaths = FilePaths()
|
||||||
|
|
||||||
@@ -246,6 +260,7 @@ class Global {
|
|||||||
val userData = "$apiBase/v1/user"
|
val userData = "$apiBase/v1/user"
|
||||||
val timetable = "$apiBase/v1/timeTable"
|
val timetable = "$apiBase/v1/timeTable"
|
||||||
var marks: String = "$apiBase/v1/students/<student id>/marks/list"
|
var marks: String = "$apiBase/v1/students/<student id>/marks/list"
|
||||||
|
var finalMarks: String ="$apiBase/v1/students/<student id>/marks/final"
|
||||||
}
|
}
|
||||||
val apiEndPoints = APIEndPoints()
|
val apiEndPoints = APIEndPoints()
|
||||||
|
|
||||||
@@ -273,9 +288,16 @@ val global = Global()
|
|||||||
|
|
||||||
var settings = SettingsData()
|
var settings = SettingsData()
|
||||||
|
|
||||||
|
private fun <T> changeAndRevert(variable: T, newValue: T, revert: (T) -> Unit) {
|
||||||
|
val orig = variable
|
||||||
|
revert(newValue)
|
||||||
|
revert(orig)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun <T> Animate(targetState: T, content: @Composable (target: T) -> Unit) {
|
fun <T> Animate(targetState: T, content: @Composable (target: T) -> Unit) {
|
||||||
if (settings.useAnimations.checked.value == true) {
|
if (settings.useAnimations.checked.value == true) {
|
||||||
|
// When animations are enabled, apply AnimatedContent
|
||||||
AnimatedContent(
|
AnimatedContent(
|
||||||
targetState = targetState,
|
targetState = targetState,
|
||||||
transitionSpec = {
|
transitionSpec = {
|
||||||
@@ -283,11 +305,16 @@ fun <T> Animate(targetState: T, content: @Composable (target: T) -> Unit) {
|
|||||||
slideOutVertically(targetOffsetY = { it }) + fadeOut()
|
slideOutVertically(targetOffsetY = { it }) + fadeOut()
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier.fillMaxSize(), label = "animated content"
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
label = "animated content"
|
||||||
) { target ->
|
) { target ->
|
||||||
content(target)
|
content(target)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// When animations are disabled, just show content without animation
|
||||||
content(targetState)
|
content(targetState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,15 +34,18 @@ fun remoteLoad(ctx: Context) {
|
|||||||
// fetch remote data
|
// fetch remote data
|
||||||
global.timetableJSON = networkRequestFactory.perform(NetworkRequestType.Timetable)
|
global.timetableJSON = networkRequestFactory.perform(NetworkRequestType.Timetable)
|
||||||
global.marksJSON = networkRequestFactory.perform(NetworkRequestType.Marks)
|
global.marksJSON = networkRequestFactory.perform(NetworkRequestType.Marks)
|
||||||
|
global.finalMarksJSON = networkRequestFactory.perform(NetworkRequestType.FinalMarks)
|
||||||
|
|
||||||
// save to local for later local load
|
// save to local for later local load
|
||||||
Util.saveStringToFile(global.filePaths.timetable, global.timetableJSON.toString())
|
Util.saveStringToFile(global.filePaths.timetable, global.timetableJSON.toString())
|
||||||
Util.saveStringToFile(global.filePaths.marks, global.marksJSON.toString())
|
Util.saveStringToFile(global.filePaths.marks, global.marksJSON.toString())
|
||||||
|
Util.saveStringToFile(global.filePaths.finalMarks, global.finalMarksJSON.toString())
|
||||||
|
|
||||||
launchContinue(
|
launchContinue(
|
||||||
ctx,
|
ctx,
|
||||||
global.timetableJSON,
|
global.timetableJSON,
|
||||||
global.marksJSON
|
global.marksJSON,
|
||||||
|
global.finalMarksJSON
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -50,7 +53,8 @@ fun remoteLoad(ctx: Context) {
|
|||||||
launchContinue(
|
launchContinue(
|
||||||
ctx,
|
ctx,
|
||||||
networkRequestFactory.perform(NetworkRequestType.Timetable),
|
networkRequestFactory.perform(NetworkRequestType.Timetable),
|
||||||
networkRequestFactory.perform(NetworkRequestType.Marks)
|
networkRequestFactory.perform(NetworkRequestType.Marks),
|
||||||
|
networkRequestFactory.perform(NetworkRequestType.FinalMarks)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,39 +65,43 @@ fun localLoad(ctx: Context) {
|
|||||||
global.studentId = Parsing.getStudentId()
|
global.studentId = Parsing.getStudentId()
|
||||||
global.studentClass = Parsing.getStudentClass()
|
global.studentClass = Parsing.getStudentClass()
|
||||||
global.apiEndPoints.marks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/list"
|
global.apiEndPoints.marks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/list"
|
||||||
|
global.apiEndPoints.finalMarks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/final"
|
||||||
val localTimetable = JSONObject(Util.fileToString(global.filePaths.timetable))
|
val localTimetable = JSONObject(Util.fileToString(global.filePaths.timetable))
|
||||||
val localMarks = JSONObject(Util.fileToString(global.filePaths.marks))
|
val localMarks = JSONObject(Util.fileToString(global.filePaths.marks))
|
||||||
|
val localFinalMarks = JSONObject(Util.fileToString(global.filePaths.finalMarks))
|
||||||
|
|
||||||
launchContinue(
|
launchContinue(
|
||||||
ctx,
|
ctx,
|
||||||
localTimetable,
|
localTimetable,
|
||||||
localMarks
|
localMarks,
|
||||||
|
localFinalMarks
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun launchContinue(
|
fun launchContinue(
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
timetable: JSONObject,
|
timetable: JSONObject,
|
||||||
marks: JSONObject
|
marks: JSONObject,
|
||||||
|
finalMarks: JSONObject
|
||||||
) {
|
) {
|
||||||
// parse timetable and marks
|
// parse timetable and marks
|
||||||
val parsedTimetable = Parsing.parseTimetable(timetable)
|
global.timetable = Parsing.parseTimetable(timetable)
|
||||||
global.timetable = parsedTimetable
|
global.marks = Parsing.parseMarks(marks)
|
||||||
val parsedMarks = Parsing.parseMarks(marks)
|
|
||||||
global.marks = parsedMarks
|
|
||||||
global.newMarks = Parsing.parseNewMarks(marks)
|
global.newMarks = Parsing.parseNewMarks(marks)
|
||||||
|
global.finalMarks = Parsing.parseFinalMarks(finalMarks)
|
||||||
// // load the settings
|
|
||||||
// global.settings = Util.fileToString(global.filePaths.settings).toSettingsData()
|
|
||||||
|
|
||||||
// load the lecture notes
|
// load the lecture notes
|
||||||
Util.loadLectureNotes()
|
//Util.loadLectureNotes()
|
||||||
Util.csvToLectureNotes()
|
//Util.csvToLectureNotes()
|
||||||
|
|
||||||
|
// load the settings
|
||||||
|
settings = Util.fileToString(global.filePaths.settings).toSettingsData()
|
||||||
|
|
||||||
// listen for internet availability in case of disconnection
|
// listen for internet availability in case of disconnection
|
||||||
if (!global.internetAwaitListenerRunning)
|
if (!global.internetAwaitListenerRunning)
|
||||||
setOnInternetAvailListener(ctx)
|
setOnInternetAvailListener(ctx)
|
||||||
|
|
||||||
|
// FIXME maybe? causes IndexOutOfBoundsException????? prob not tho
|
||||||
if (!global.launched) {
|
if (!global.launched) {
|
||||||
// show the default (main) screen
|
// show the default (main) screen
|
||||||
global.currentScreen = Screen.Main
|
global.currentScreen = Screen.Main
|
||||||
@@ -106,6 +114,8 @@ fun launchContinue(
|
|||||||
global.refreshed = true
|
global.refreshed = true
|
||||||
refreshButtonContentColor.value = Color.White
|
refreshButtonContentColor.value = Color.White
|
||||||
|
|
||||||
|
showTempScreen(Screen.Main)
|
||||||
|
|
||||||
// show the full name of the user in the toolbar as a status
|
// show the full name of the user in the toolbar as a status
|
||||||
if (Util.internetAvail(ctx)) {
|
if (Util.internetAvail(ctx)) {
|
||||||
statusFactory.show(StatusType.NameRole)
|
statusFactory.show(StatusType.NameRole)
|
||||||
|
|||||||
@@ -43,51 +43,53 @@ class MainActivity : ComponentActivity() {
|
|||||||
Screen.Main -> if (global.launched) MainScreen()
|
Screen.Main -> if (global.launched) MainScreen()
|
||||||
Screen.Splash -> SplashScreen()
|
Screen.Splash -> SplashScreen()
|
||||||
Screen.SignIn -> SignInScreen()
|
Screen.SignIn -> SignInScreen()
|
||||||
|
Screen.Settings -> SettingsScreen()
|
||||||
|
Screen.Temp -> TempScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MainScreen() {
|
fun MainScreen() {
|
||||||
Column(
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.background(Color.Black)
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = global.modifiers.bar,
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
ToolbarScreen()
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxWidth()
|
||||||
.background(Color.Black)
|
.weight(1f)
|
||||||
) {
|
) {
|
||||||
Box(
|
Animate(global.currentScreenElement) { targetScreen ->
|
||||||
modifier = global.modifiers.bar,
|
when (targetScreen) {
|
||||||
contentAlignment = Alignment.Center
|
ScreenElement.Timetable -> TimetableScreen()
|
||||||
) {
|
ScreenElement.Marks -> MarksScreen()
|
||||||
ToolbarScreen()
|
ScreenElement.NewMarks -> NewMarksScreen()
|
||||||
}
|
ScreenElement.FinalMarks -> FinalMarksScreen()
|
||||||
|
ScreenElement.Menu -> MenuScreen()
|
||||||
Box(
|
ScreenElement.About -> AboutScreen()
|
||||||
modifier = Modifier
|
ScreenElement.SignOut -> SignOutScreen()
|
||||||
.fillMaxWidth()
|
ScreenElement.Temp -> {}
|
||||||
.weight(1f)
|
|
||||||
) {
|
|
||||||
Animate(global.currentScreenElement) { targetScreen ->
|
|
||||||
when (targetScreen) {
|
|
||||||
ScreenElement.Timetable -> TimetableScreen()
|
|
||||||
ScreenElement.Marks -> MarksScreen()
|
|
||||||
ScreenElement.NewMarks -> NewMarksScreen()
|
|
||||||
ScreenElement.FinalMarks -> FinalMarksScreen()
|
|
||||||
ScreenElement.Menu -> MenuScreen()
|
|
||||||
ScreenElement.About -> AboutScreen()
|
|
||||||
ScreenElement.Settings -> SettingsScreen()
|
|
||||||
ScreenElement.SignOut -> SignOutScreen()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = global.modifiers.bar,
|
modifier = global.modifiers.bar,
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
NavbarScreen()
|
NavbarScreen()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.odweta.solon
|
package com.odweta.solon
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@@ -25,6 +27,7 @@ import androidx.compose.material3.FloatingActionButton
|
|||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
@@ -121,7 +124,8 @@ fun NewMarksScreen() {
|
|||||||
modifier = Modifier.verticalScroll(ss)
|
modifier = Modifier.verticalScroll(ss)
|
||||||
) {
|
) {
|
||||||
for ((k, v) in global.newMarks) {
|
for ((k, v) in global.newMarks) {
|
||||||
if (v.size > 0) {
|
if (v.filter { it.grade in "0123456789" }.size == 0) continue
|
||||||
|
if (v.isNotEmpty()) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 10.dp)
|
.padding(horizontal = 10.dp)
|
||||||
@@ -242,14 +246,16 @@ fun FinalMarksScreen() {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.verticalScroll(ss)
|
modifier = Modifier.verticalScroll(ss)
|
||||||
) {
|
) {
|
||||||
Text("test", color = Color.White)
|
Text(Util.fileToString(global.filePaths.finalMarks), color = Color.White)
|
||||||
Text("test", color = Color.White)
|
for ((subject, mark) in global.finalMarks) {
|
||||||
Text("test", color = Color.White)
|
// LaunchedEffect(Unit) {
|
||||||
Text("test", color = Color.White)
|
// Log.d("debug", networkRequestFactory.perform(NetworkRequestType.Apologies).body.string?.toString())
|
||||||
Text("test", color = Color.White)
|
//}
|
||||||
Text("test", color = Color.White)
|
Row {
|
||||||
Text("test", color = Color.White)
|
Text(subject, color = Color.White)
|
||||||
Text("test", color = Color.White)
|
Text(mark.toString(), color = Color.White, modifier = Modifier.padding(10.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,6 +308,7 @@ fun MarksAll() {
|
|||||||
.verticalScroll(scrollState)
|
.verticalScroll(scrollState)
|
||||||
) {
|
) {
|
||||||
for ((subject, markList) in global.marks) {
|
for ((subject, markList) in global.marks) {
|
||||||
|
if (markList.filter { it.grade in "0123456789" }.size == 0) continue
|
||||||
val amoledModifier = if (settings.useAmoledMode.checked.value == true) {
|
val amoledModifier = if (settings.useAmoledMode.checked.value == true) {
|
||||||
Modifier
|
Modifier
|
||||||
.width(150.dp)
|
.width(150.dp)
|
||||||
@@ -337,8 +344,10 @@ fun MarksAll() {
|
|||||||
shape = RoundedCornerShape(global.dimens.roundedCorner)
|
shape = RoundedCornerShape(global.dimens.roundedCorner)
|
||||||
)
|
)
|
||||||
.clickable {
|
.clickable {
|
||||||
global.marksDepthLevel = MarksDepthLevel.Subject
|
if (markList[0].grade != "0") {
|
||||||
global.subjectToShow = subject
|
global.marksDepthLevel = MarksDepthLevel.Subject
|
||||||
|
global.subjectToShow = subject
|
||||||
|
} // else { isInDemo == true }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Modifier
|
Modifier
|
||||||
@@ -349,8 +358,10 @@ fun MarksAll() {
|
|||||||
shape = RoundedCornerShape(global.dimens.roundedCorner)
|
shape = RoundedCornerShape(global.dimens.roundedCorner)
|
||||||
)
|
)
|
||||||
.clickable {
|
.clickable {
|
||||||
global.marksDepthLevel = MarksDepthLevel.Subject
|
if (markList[0].grade != "0") {
|
||||||
global.subjectToShow = subject
|
global.marksDepthLevel = MarksDepthLevel.Subject
|
||||||
|
global.subjectToShow = subject
|
||||||
|
} // else { isInDemo == true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,13 +377,7 @@ fun MarksAll() {
|
|||||||
.background(Color.Black)
|
.background(Color.Black)
|
||||||
}
|
}
|
||||||
|
|
||||||
var marksString = ""
|
var marksString = markList.filter { it.grade in "0123456789" }.joinToString(separator = ",") { it.grade }
|
||||||
for (m in 0 until markList.size-1) {
|
|
||||||
if (markList[m].grade in "0123456789") {
|
|
||||||
marksString += markList[m].grade + ", "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
marksString += markList[markList.size-1].grade
|
|
||||||
|
|
||||||
if (global.marks.keys.indexOf(subject) > 0) {
|
if (global.marks.keys.indexOf(subject) > 0) {
|
||||||
Box(modifier = Modifier.height(10.dp))
|
Box(modifier = Modifier.height(10.dp))
|
||||||
@@ -463,7 +468,7 @@ fun MarksAll() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
FloatingActionButton(
|
/*FloatingActionButton(
|
||||||
onClick = { global.currentScreenElement = ScreenElement.FinalMarks },
|
onClick = { global.currentScreenElement = ScreenElement.FinalMarks },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(10.dp)
|
.padding(10.dp)
|
||||||
@@ -479,7 +484,7 @@ fun MarksAll() {
|
|||||||
contentDescription = "Final marks",
|
contentDescription = "Final marks",
|
||||||
tint = PastelYellow // You can customize the icon color
|
tint = PastelYellow // You can customize the icon color
|
||||||
)
|
)
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -551,6 +556,8 @@ fun MarksSubject() {
|
|||||||
color = Color.White,
|
color = Color.White,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
fontSize = 30.sp,
|
fontSize = 30.sp,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis, // more elegant i think
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.border(
|
.border(
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ fun MenuScreen() {
|
|||||||
Spacer(modifier = Modifier.width(menuSeparatorDimen))
|
Spacer(modifier = Modifier.width(menuSeparatorDimen))
|
||||||
|
|
||||||
MenuButton(
|
MenuButton(
|
||||||
{ global.currentScreenElement = ScreenElement.Settings },
|
{ global.currentScreen = Screen.Settings },
|
||||||
Icons.Default.Settings,
|
Icons.Default.Settings,
|
||||||
"Nastavení"
|
"Nastavení"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.odweta.solon
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun MessagesScreen() {
|
||||||
|
Column {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,6 +43,7 @@ fun NavbarScreen() {
|
|||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
if (Util.internetAvail(ctx)) {
|
if (Util.internetAvail(ctx)) {
|
||||||
|
global.refreshed = false;
|
||||||
remoteLoad(ctx)
|
remoteLoad(ctx)
|
||||||
statusFactory.show(StatusType.Loading)
|
statusFactory.show(StatusType.Loading)
|
||||||
refreshButtonContentColor.value = PastelYellow
|
refreshButtonContentColor.value = PastelYellow
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ fun setupAPI() {
|
|||||||
global.studentId = Parsing.getStudentId()
|
global.studentId = Parsing.getStudentId()
|
||||||
|
|
||||||
global.apiEndPoints.marks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/list"
|
global.apiEndPoints.marks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/list"
|
||||||
|
global.apiEndPoints.finalMarks = "${global.apiEndPoints.apiBase}/v1/students/${global.studentId}/marks/final"
|
||||||
|
|
||||||
global.isAPISetUp = true
|
global.isAPISetUp = true
|
||||||
}
|
}
|
||||||
@@ -40,6 +41,7 @@ enum class NetworkRequestType {
|
|||||||
Token,
|
Token,
|
||||||
Timetable,
|
Timetable,
|
||||||
Marks,
|
Marks,
|
||||||
|
FinalMarks,
|
||||||
UserData
|
UserData
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +73,7 @@ object NetworkRequestFactory: NetworkRequestInterface {
|
|||||||
}
|
}
|
||||||
NetworkRequestType.Timetable -> return getAPI(global.apiEndPoints.timetable)
|
NetworkRequestType.Timetable -> return getAPI(global.apiEndPoints.timetable)
|
||||||
NetworkRequestType.Marks -> return getAPI(global.apiEndPoints.marks)
|
NetworkRequestType.Marks -> return getAPI(global.apiEndPoints.marks)
|
||||||
|
NetworkRequestType.FinalMarks -> return getAPI(global.apiEndPoints.finalMarks)
|
||||||
NetworkRequestType.UserData -> return getAPI(global.apiEndPoints.userData)
|
NetworkRequestType.UserData -> return getAPI(global.apiEndPoints.userData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +85,13 @@ object NetworkRequestFactory: NetworkRequestInterface {
|
|||||||
.get()
|
.get()
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
return client.newCall(request).execute()
|
return try {
|
||||||
|
client.newCall(request).execute()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Response.Builder()
|
||||||
|
.code(500)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun post(url: String, headers: Headers, body: FormBody): Response {
|
private fun post(url: String, headers: Headers, body: FormBody): Response {
|
||||||
@@ -92,7 +101,13 @@ object NetworkRequestFactory: NetworkRequestInterface {
|
|||||||
.post(body)
|
.post(body)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
return client.newCall(request).execute()
|
return try {
|
||||||
|
client.newCall(request).execute()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Response.Builder()
|
||||||
|
.code(500)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getAPI(url: String): JSONObject {
|
private fun getAPI(url: String): JSONObject {
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class Parsing {
|
|||||||
subj.getJSONArray("teachers")
|
subj.getJSONArray("teachers")
|
||||||
.getJSONObject(0).getString("name") + " " +
|
.getJSONObject(0).getString("name") + " " +
|
||||||
subj.getJSONArray("teachers")
|
subj.getJSONArray("teachers")
|
||||||
.getJSONObject(0).getString("name")
|
.getJSONObject(0).getString("surname")
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
@@ -199,15 +199,13 @@ class Parsing {
|
|||||||
|
|
||||||
val detailHours = subj.getJSONArray("detailHours")
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
newSubject.number =
|
newSubject.number =
|
||||||
detailHours.getJSONObject(i).get("id").toString()
|
detailHours.getJSONObject(i).getString("id")
|
||||||
newSubject.start =
|
newSubject.start =
|
||||||
detailHours.getJSONObject(i).get("timeFrom")
|
detailHours.getJSONObject(i).getString("timeFrom")
|
||||||
.toString()
|
|
||||||
newSubject.start =
|
newSubject.start =
|
||||||
newSubject.start.slice(0..newSubject.start.length - 4)
|
newSubject.start.slice(0..newSubject.start.length - 4)
|
||||||
newSubject.end =
|
newSubject.end =
|
||||||
detailHours.getJSONObject(i).get("timeto")
|
detailHours.getJSONObject(i).getString("timeto")
|
||||||
.toString()
|
|
||||||
newSubject.end =
|
newSubject.end =
|
||||||
newSubject.end.slice(0..newSubject.end.length - 4)
|
newSubject.end.slice(0..newSubject.end.length - 4)
|
||||||
subjects.add(newSubject)
|
subjects.add(newSubject)
|
||||||
@@ -217,7 +215,7 @@ class Parsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val sCopy = subjects.toList()
|
val sCopy = subjects.toList()
|
||||||
for (s in 0 until sCopy.size) {
|
for (s in sCopy.indices) {
|
||||||
if ("-" in subjects[s].number) {
|
if ("-" in subjects[s].number) {
|
||||||
subjects[s].number = "1"
|
subjects[s].number = "1"
|
||||||
subjects[s].start = "08:00"
|
subjects[s].start = "08:00"
|
||||||
@@ -226,26 +224,6 @@ class Parsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// rust pseudocode
|
|
||||||
|
|
||||||
let mut res: Vec<i32> = vec![];
|
|
||||||
for i in 0..v.len()-1 {
|
|
||||||
if v[i] == v[i+1]-1 {
|
|
||||||
res.push(v[i]);
|
|
||||||
} else {
|
|
||||||
res.push(v[i]);
|
|
||||||
|
|
||||||
while res[res.len()-1]+1 != v[i+1] {
|
|
||||||
res.push(res[res.len()-1]+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.push(v[v.len()-1]);
|
|
||||||
|
|
||||||
res
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (subjects.size > 1) {
|
if (subjects.size > 1) {
|
||||||
for (i in 0..<subjects.size - 1) {
|
for (i in 0..<subjects.size - 1) {
|
||||||
if (subjects[i].number == ((subjects[i + 1].number.toInt() - 1).toString())) {
|
if (subjects[i].number == ((subjects[i + 1].number.toInt() - 1).toString())) {
|
||||||
@@ -289,9 +267,6 @@ class Parsing {
|
|||||||
)
|
)
|
||||||
n -= 1
|
n -= 1
|
||||||
}
|
}
|
||||||
val finalSubjects: MutableList<Subject> = mutableListOf()
|
|
||||||
finalSubjects.addAll(newSubjects.reversed())
|
|
||||||
finalSubjects.addAll(auxSubjects)
|
|
||||||
|
|
||||||
for ((i, s) in auxSubjects.withIndex()) {
|
for ((i, s) in auxSubjects.withIndex()) {
|
||||||
if (s.free) {
|
if (s.free) {
|
||||||
@@ -300,6 +275,10 @@ class Parsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val finalSubjects: MutableList<Subject> = mutableListOf()
|
||||||
|
finalSubjects.addAll(newSubjects.reversed())
|
||||||
|
finalSubjects.addAll(auxSubjects)
|
||||||
|
|
||||||
val day = Day()
|
val day = Day()
|
||||||
day.name = name
|
day.name = name
|
||||||
day.date = date
|
day.date = date
|
||||||
@@ -408,16 +387,6 @@ class Parsing {
|
|||||||
|
|
||||||
for (i in 0..<marksJSONArray.length()) {
|
for (i in 0..<marksJSONArray.length()) {
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
marksList.add(marksJSONArray.getJSONObject(i))
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
marksList.add(marksJSONArray.getJSONObject(i))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (subj in subjectMap.values) {
|
for (subj in subjectMap.values) {
|
||||||
@@ -438,6 +407,14 @@ class Parsing {
|
|||||||
return marks
|
return marks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun parseFinalMarks(json: JSONObject): Map<String, Int> {
|
||||||
|
return mapOf(
|
||||||
|
"AJ" to 1,
|
||||||
|
"B" to 5,
|
||||||
|
"Pr" to 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun getStudentClass(): String {
|
fun getStudentClass(): String {
|
||||||
return if (!userIsParent()) {
|
return if (!userIsParent()) {
|
||||||
global.userData
|
global.userData
|
||||||
|
|||||||
@@ -38,11 +38,16 @@ import kotlinx.coroutines.launch
|
|||||||
@Composable
|
@Composable
|
||||||
fun SettingsScreen() {
|
fun SettingsScreen() {
|
||||||
// handle the back gesture (back swipe form side or back button on bottom android navbar)
|
// handle the back gesture (back swipe form side or back button on bottom android navbar)
|
||||||
BackHandler { global.currentScreenElement = ScreenElement.Menu }
|
BackHandler {
|
||||||
|
global.currentScreenElement = ScreenElement.Menu
|
||||||
|
global.currentScreen = Screen.Main
|
||||||
|
}
|
||||||
|
|
||||||
// load the settings dat every time the settings screen is opened,
|
// load the settings dat every time the settings screen is opened,
|
||||||
// maybe i can add a flag that determines if the settings are up to date?
|
// maybe i can add a flag that determines if the settings are up to date?
|
||||||
settings = Util.fileToString(global.filePaths.settings).toSettingsData()
|
if (!global.demoMode) {
|
||||||
|
settings = Util.fileToString(global.filePaths.settings).toSettingsData()
|
||||||
|
}
|
||||||
|
|
||||||
val scrollState = rememberScrollState()
|
val scrollState = rememberScrollState()
|
||||||
|
|
||||||
@@ -57,7 +62,9 @@ fun SettingsScreen() {
|
|||||||
|
|
||||||
SettingsTableRow(settings.useAmoledMode)
|
SettingsTableRow(settings.useAmoledMode)
|
||||||
|
|
||||||
SettingsTableRow(settings.showRefreshButton)
|
if (!global.demoMode) {
|
||||||
|
SettingsTableRow(settings.showRefreshButton)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsTableRow(settings.useAnimations)
|
SettingsTableRow(settings.useAnimations)
|
||||||
}
|
}
|
||||||
@@ -87,6 +94,7 @@ fun SettingsTableRow(setting: Setting) {
|
|||||||
checked = setting.checked.value == true,
|
checked = setting.checked.value == true,
|
||||||
onCheckedChange = {
|
onCheckedChange = {
|
||||||
setting.checked.value = it
|
setting.checked.value = it
|
||||||
|
showTempScreen(Screen.Settings)
|
||||||
Util.saveStringToFile(global.filePaths.settings, settings.toString())
|
Util.saveStringToFile(global.filePaths.settings, settings.toString())
|
||||||
},
|
},
|
||||||
colors = SwitchColors(
|
colors = SwitchColors(
|
||||||
|
|||||||
@@ -89,26 +89,55 @@ fun signInButtonCallback(ctx: Context, usernameText: String, passwordText: Strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
val valid = Account.isValid(acc)
|
if (global.username == "demo" && global.password == "Demo1234") {
|
||||||
|
// start the demo
|
||||||
checked = true
|
launchDemo(ctx)
|
||||||
|
|
||||||
if (valid) {
|
|
||||||
Account.save(acc)
|
|
||||||
global.currentScreen = Screen.Splash
|
|
||||||
launchStart(ctx)
|
|
||||||
} else {
|
} else {
|
||||||
withContext(Dispatchers.Main) {
|
val valid = Account.isValid(acc)
|
||||||
Toast.makeText(
|
|
||||||
ctx,
|
checked = true
|
||||||
"Neplatné přihlašovací údaje nebo nejste připojeni k internetu, zkuste to znovu.",
|
|
||||||
Toast.LENGTH_LONG
|
if (valid) {
|
||||||
).show()
|
Account.save(acc)
|
||||||
|
global.currentScreen = Screen.Splash
|
||||||
|
launchStart(ctx)
|
||||||
|
} else {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(
|
||||||
|
ctx,
|
||||||
|
"Neplatné přihlašovací údaje nebo nejste připojeni k internetu, zkuste to znovu.",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun launchDemo(ctx: Context) {
|
||||||
|
global.demoMode = true
|
||||||
|
|
||||||
|
settings = Util.fileToString(global.filePaths.settings).toSettingsData()
|
||||||
|
settings.showRefreshButton.checked.value = false
|
||||||
|
|
||||||
|
val d = Day()
|
||||||
|
d.name = "demoday"
|
||||||
|
d.date = "1. 1."
|
||||||
|
d.subjects = listOf(Subject.empty())
|
||||||
|
global.timetable = listOf(d)
|
||||||
|
|
||||||
|
global.marks = mutableMapOf("demomarks" to mutableListOf(Mark().none()))
|
||||||
|
|
||||||
|
global.newMarks = global.marks
|
||||||
|
|
||||||
|
global.status = "demo"
|
||||||
|
|
||||||
|
global.launched = true
|
||||||
|
global.refreshed = true
|
||||||
|
global.currentScreen = Screen.Main
|
||||||
|
global.currentScreenElement = ScreenElement.Timetable
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SignInScreen() {
|
fun SignInScreen() {
|
||||||
// handle the back gesture (back swipe form side or back button on bottom android navbar)
|
// handle the back gesture (back swipe form side or back button on bottom android navbar)
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.odweta.solon
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
|
// temporary screens to artificially trigger recompositions basically at the root level
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun TempScreen() {
|
||||||
|
when (global.tempScreen) {
|
||||||
|
Screen.Main -> MainScreen()
|
||||||
|
Screen.Splash -> SplashScreen()
|
||||||
|
Screen.SignIn -> SignInScreen()
|
||||||
|
Screen.Settings -> SettingsScreen()
|
||||||
|
Screen.Temp -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showTempScreen(screen: Screen) {
|
||||||
|
global.returnToTempScreen = true
|
||||||
|
global.tempScreen = screen
|
||||||
|
global.currentScreen = Screen.Temp
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun TempScreenElement() {
|
||||||
|
when (global.tempScreenElement) {
|
||||||
|
ScreenElement.Timetable -> {}
|
||||||
|
ScreenElement.Marks -> {}
|
||||||
|
ScreenElement.NewMarks -> {}
|
||||||
|
ScreenElement.FinalMarks -> {}
|
||||||
|
ScreenElement.Menu -> {}
|
||||||
|
ScreenElement.About -> {}
|
||||||
|
ScreenElement.SignOut -> {}
|
||||||
|
ScreenElement.Temp -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showTempScreenElement(element: ScreenElement) {
|
||||||
|
global.tempScreenElement = element
|
||||||
|
global.currentScreenElement = ScreenElement.Temp
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.height
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.pager.HorizontalPager
|
import androidx.compose.foundation.pager.HorizontalPager
|
||||||
|
import androidx.compose.foundation.pager.PagerState
|
||||||
import androidx.compose.foundation.pager.rememberPagerState
|
import androidx.compose.foundation.pager.rememberPagerState
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@@ -49,6 +50,7 @@ import androidx.compose.ui.focus.focusModifier
|
|||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@@ -64,8 +66,11 @@ import com.odweta.solon.ui.theme.PastelRed
|
|||||||
import com.odweta.solon.ui.theme.PastelRedTransparent
|
import com.odweta.solon.ui.theme.PastelRedTransparent
|
||||||
import com.odweta.solon.ui.theme.PastelYellow
|
import com.odweta.solon.ui.theme.PastelYellow
|
||||||
import com.odweta.solon.ui.theme.PastelYellowTransparent
|
import com.odweta.solon.ui.theme.PastelYellowTransparent
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.LocalTime
|
import java.time.LocalTime
|
||||||
@@ -73,14 +78,63 @@ import java.time.format.DateTimeFormatter
|
|||||||
|
|
||||||
var showDetailDialog by mutableStateOf(false)
|
var showDetailDialog by mutableStateOf(false)
|
||||||
|
|
||||||
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun TimetableScreen() {
|
fun TimetableScreen() {
|
||||||
Box(
|
val pagerState = rememberPagerState(pageCount = { if (global.timetable.isNotEmpty()) global.timetable.size else 6 }) // FIXME
|
||||||
modifier = Modifier.fillMaxSize(),
|
Column {
|
||||||
contentAlignment = Alignment.BottomCenter
|
//QuickDays(pagerState)
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
contentAlignment = Alignment.BottomCenter
|
||||||
|
) {
|
||||||
|
DayPager(pagerState)
|
||||||
|
if (showDetailDialog) DetailDialog()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
|
@Composable
|
||||||
|
fun QuickDays(pagerState: PagerState) {
|
||||||
|
@Composable
|
||||||
|
fun QuickDay(day: Day, modifier: Modifier, idx: Int) {
|
||||||
|
val scope = rememberCoroutineScope()
|
||||||
|
Column(
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.Center,
|
||||||
|
modifier = modifier.padding(5.dp).background(
|
||||||
|
shape = RoundedCornerShape(global.dimens.roundedCorner),
|
||||||
|
color = PastelYellowTransparent
|
||||||
|
).clickable(onClick = {
|
||||||
|
scope.launch {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
pagerState.animateScrollToPage(idx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "${day.name[0]}${day.name[1]}",
|
||||||
|
color = Color.White,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
fontWeight = FontWeight.Bold
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(5.dp))
|
||||||
|
Text(
|
||||||
|
text = day.date,
|
||||||
|
color = Color.White,
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row(
|
||||||
|
Modifier.fillMaxWidth().padding(bottom = 15.dp).padding(horizontal = 5.dp)
|
||||||
) {
|
) {
|
||||||
DayPager()
|
for ((idx, day) in global.timetable.withIndex()) {
|
||||||
if (showDetailDialog) DetailDialog()
|
QuickDay(day, Modifier.weight(1f), idx)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,13 +280,28 @@ fun DetailDialog() {
|
|||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun DayPager() {
|
fun DayPager(pagerState: PagerState) {
|
||||||
val pagerState = rememberPagerState(pageCount = { if (global.timetable.isNotEmpty()) global.timetable.size else 6 }) // FIXME
|
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize()
|
||||||
) { pageIndex ->
|
) { pageIndex ->
|
||||||
DayScreen(global.timetable[pageIndex])
|
if (global.timetable.isNotEmpty()) {
|
||||||
|
DayScreen(global.timetable[pageIndex])
|
||||||
|
} else {
|
||||||
|
NoDayScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun NoDayScreen() {
|
||||||
|
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
|
Text(
|
||||||
|
"Zatím žádný rozvrh.",
|
||||||
|
color = Color.White,
|
||||||
|
fontSize = 30.sp,
|
||||||
|
fontStyle = FontStyle.Italic
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,6 +326,7 @@ private fun getSubjectColor(s: Subject, transparent: Boolean): Color {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isTimeBetweenT(givenTime: LocalTime, startTime: LocalTime, endTime: LocalTime): Boolean {
|
fun isTimeBetweenT(givenTime: LocalTime, startTime: LocalTime, endTime: LocalTime): Boolean {
|
||||||
// Check if the given time is between startTime and endTime
|
// Check if the given time is between startTime and endTime
|
||||||
return givenTime.isAfter(startTime) && givenTime.isBefore(endTime)
|
return givenTime.isAfter(startTime) && givenTime.isBefore(endTime)
|
||||||
@@ -422,7 +492,7 @@ private fun DayScreen(day: Day) {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.padding(start = 20.dp),
|
.padding(start = 10.dp), // same as on the right
|
||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
horizontalAlignment = Alignment.Start
|
horizontalAlignment = Alignment.Start
|
||||||
) {
|
) {
|
||||||
@@ -440,8 +510,9 @@ private fun DayScreen(day: Day) {
|
|||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = " supl ",
|
text = " supl ",
|
||||||
color = Color.Black,
|
color = Color.White,
|
||||||
modifier = Modifier.background(color = Color.White)
|
fontStyle = FontStyle.Italic,
|
||||||
|
modifier = Modifier.background(color = PastelRedTransparent)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -486,8 +557,7 @@ private fun DayScreen(day: Day) {
|
|||||||
) {
|
) {
|
||||||
if (settings.useSvobodaMode.checked.value == true) {
|
if (settings.useSvobodaMode.checked.value == true) {
|
||||||
if (
|
if (
|
||||||
subject.teacher == "Jindřich Svoboda" &&
|
subject.teacher == "Jindřich Svoboda"
|
||||||
global.studentClass == "5. G"
|
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(R.drawable.spock),
|
painter = painterResource(R.drawable.spock),
|
||||||
@@ -506,25 +576,22 @@ private fun DayScreen(day: Day) {
|
|||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
horizontalAlignment = Alignment.End
|
horizontalAlignment = Alignment.End
|
||||||
) {
|
) {
|
||||||
// show only for non prepended free lectures
|
// show only for non free lectures
|
||||||
if ((subject.free && subject.start != "00:00" && subject.end != "00:00") || !subject.free) {
|
if (!subject.free) {
|
||||||
Text(
|
Text(
|
||||||
text = "${subject.start}–${subject.end}",
|
text = "${subject.start}–${subject.end}",
|
||||||
color = Color.White,
|
color = Color.White,
|
||||||
fontSize = 21.sp
|
fontSize = 23.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!subject.free) {
|
if (!subject.free) {
|
||||||
Box (
|
Text(
|
||||||
contentAlignment = Alignment.BottomEnd
|
text = subject.teacher,
|
||||||
) {
|
color = Color.White,
|
||||||
Text(
|
fontSize = 14.sp,
|
||||||
text = subject.teacher,
|
lineHeight = 1.sp // to achieve uniform padding
|
||||||
color = Color.White,
|
)
|
||||||
fontSize = 12.sp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -533,10 +600,10 @@ private fun DayScreen(day: Day) {
|
|||||||
Box(modifier = Modifier
|
Box(modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.zIndex(99f)
|
.zIndex(99f)
|
||||||
.clickable {
|
/*.clickable {
|
||||||
global.selectedLecture = lectureId
|
global.selectedLecture = lectureId
|
||||||
showDetailDialog = true
|
showDetailDialog = true
|
||||||
})
|
}*/)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(global.lectureNotes[global.selectedLecture] != null &&
|
(global.lectureNotes[global.selectedLecture] != null &&
|
||||||
|
|||||||
Reference in New Issue
Block a user