diff --git a/README.md b/README.md
index 3c8b502..9aba262 100755
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@

# Zorientujte se rychleji v této odlehčené verzi Školy OnLine
-# Odkaz na stažení aplikace pro Android [zde](https://gitlab.com/Odweta/solon/-/raw/master/release/solon.apk?ref_type=heads&inline=false) (verze 1.0.8, funguje nejlépe na displejích s hdpi hustotou pixelů)
+# Odkaz na stažení aplikace pro Android [zde](https://gitlab.com/Odweta/solon/-/raw/master/release/solon.apk?ref_type=heads&inline=false) (verze 1.0.9, funguje nejlépe na displejích s hdpi hustotou pixelů)
diff --git a/mobile/.idea/compiler.xml b/mobile/.idea/compiler.xml
index b589d56..b86273d 100644
--- a/mobile/.idea/compiler.xml
+++ b/mobile/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/mobile/.idea/gradle.xml b/mobile/.idea/gradle.xml
index 0897082..7b3006b 100644
--- a/mobile/.idea/gradle.xml
+++ b/mobile/.idea/gradle.xml
@@ -4,6 +4,7 @@
+
diff --git a/mobile/.idea/misc.xml b/mobile/.idea/misc.xml
index e837843..02a7102 100644
--- a/mobile/.idea/misc.xml
+++ b/mobile/.idea/misc.xml
@@ -1,7 +1,7 @@
-
+
\ No newline at end of file
diff --git a/mobile/.idea/runConfigurations.xml b/mobile/.idea/runConfigurations.xml
new file mode 100644
index 0000000..16660f1
--- /dev/null
+++ b/mobile/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/app/build.gradle.kts b/mobile/app/build.gradle.kts
index 6b0d671..8054883 100644
--- a/mobile/app/build.gradle.kts
+++ b/mobile/app/build.gradle.kts
@@ -12,7 +12,7 @@ android {
minSdk = 28
targetSdk = 34
versionCode = 1
- versionName = "1.0.8"
+ versionName = "1.0.9"
}
buildTypes {
diff --git a/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt b/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt
index 829f7bd..cc1b6b6 100644
--- a/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt
+++ b/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt
@@ -21,6 +21,8 @@ import android.widget.Space
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
+import androidx.core.view.marginLeft
+import androidx.core.view.setMargins
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
@@ -251,6 +253,7 @@ class DayFragment : Fragment() {
handler.removeCallbacksAndMessages(null)
}
+ @SuppressLint("UseCompatLoadingForDrawables")
private fun createDayView(day: Day, rootLayout: LinearLayout, resources: Resources) {
val customFont = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
@@ -435,10 +438,25 @@ class DayFragment : Fragment() {
namePlaceLL.addView(subjectPlaceTextView)
}
- namePlaceLL.setPadding(30, 15, 0, 15)
+ namePlaceLL.setPadding(30, 15, 20, 15)
subjectLayout.addView(namePlaceLL)
+ if (subj.teacher == "Jindřich Svoboda") {
+ val img = ImageView(requireContext())
+ img.setImageDrawable(resources.getDrawable(R.drawable.spock))
+ val frameLayout2 = FrameLayout(requireContext())
+ val layoutParams2 = LinearLayout.LayoutParams(
+ 100,
+ 120,
+ )
+ frameLayout2.foregroundGravity = Gravity.CENTER
+ frameLayout2.layoutParams = layoutParams2
+
+ frameLayout2.addView(img)
+ subjectLayout.addView(frameLayout2)
+ }
+
val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
diff --git a/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt b/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt
index 756fee1..973a30d 100644
--- a/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt
+++ b/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt
@@ -125,7 +125,7 @@ class MarksFragment : Fragment() {
LinearLayout.LayoutParams.WRAP_CONTENT
)
params.setMargins(20, 0, 20, 0)
- params.height = 210
+ params.height = 160
markRoot.layoutParams = params
markRoot.gravity = Gravity.CENTER_VERTICAL
@@ -159,8 +159,9 @@ class MarksFragment : Fragment() {
val subjectTextView = TextView(requireContext())
subjectTextView.text = marks[0].subject.uppercase()
- subjectTextView.setPadding(20, 20, 20, 20)
- subjectTextView.setAutoSizeTextTypeUniformWithConfiguration(65, 85, 1, 0)
+ //subjectTextView.setPadding(20, 20, 20, 20)
+ //subjectTextView.setAutoSizeTextTypeUniformWithConfiguration(65, 85, 1, 0)
+ subjectTextView.textSize = resources.getDimension(R.dimen.text_size_subject_number) / resources.displayMetrics.scaledDensity
subjectTextView.setTextColor(
ContextCompat.getColor(
requireContext(),
@@ -172,7 +173,7 @@ class MarksFragment : Fragment() {
val fl2 = FrameLayout(requireContext())
fl2.layoutParams = LinearLayout.LayoutParams(
- 210,
+ 160,
FrameLayout.LayoutParams.MATCH_PARENT,
)
fl2.addView(subjectTextView)
@@ -187,8 +188,9 @@ class MarksFragment : Fragment() {
"-"
}
avgTextView.text = text
- avgTextView.setAutoSizeTextTypeUniformWithConfiguration(65, 85, 1, 0)
- avgTextView.setPadding(20, 20, 20, 20)
+ //avgTextView.setPadding(20, 20, 20, 20)
+ //avgTextView.setAutoSizeTextTypeUniformWithConfiguration(65, 85, 1, 0)
+ avgTextView.textSize = resources.getDimension(R.dimen.text_size_subject_number) / resources.displayMetrics.scaledDensity
avgTextView.gravity = Gravity.CENTER // Center text vertically
avgTextView.setTypeface(customFont, Typeface.NORMAL)
avgTextView.setTextColor(
@@ -200,7 +202,7 @@ class MarksFragment : Fragment() {
val frameLayout = FrameLayout(requireContext())
frameLayout.layoutParams = LinearLayout.LayoutParams(
- 210,
+ 160,
FrameLayout.LayoutParams.MATCH_PARENT,
)
frameLayout.addView(avgTextView)
@@ -249,7 +251,8 @@ class MarksFragment : Fragment() {
}
marksTextView.text = markString
marksTextView.setPadding(20, 20, 20, 20)
- marksTextView.setAutoSizeTextTypeUniformWithConfiguration(45, 65, 1, 0)
+ //marksTextView.setAutoSizeTextTypeUniformWithConfiguration(45, 65, 1, 0)
+ marksTextView.textSize = resources.getDimension(R.dimen.text_size_mark) / resources.displayMetrics.scaledDensity
marksTextView.setTextColor(
ContextCompat.getColor(
requireContext(),
diff --git a/mobile/app/src/main/java/com/odweta/solon/MarksOneSubjectFragment.kt b/mobile/app/src/main/java/com/odweta/solon/MarksOneSubjectFragment.kt
index c7a9261..6ba3d2b 100644
--- a/mobile/app/src/main/java/com/odweta/solon/MarksOneSubjectFragment.kt
+++ b/mobile/app/src/main/java/com/odweta/solon/MarksOneSubjectFragment.kt
@@ -124,7 +124,8 @@ class MarksOneSubjectFragment : DialogFragment() {
// e.g. average in that subject, hours per week maybe idk
val subjectDetailsLL = LinearLayout(requireContext())
subjectDetailsLL.orientation = LinearLayout.HORIZONTAL
- subjectDetailsLL.setPadding(20, 20, 20, 20)
+ subjectDetailsLL.gravity = Gravity.CENTER_VERTICAL
+ subjectDetailsLL.setPadding(40, 40, 40, 40)
subjectDetailsLL.background = bg
val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
@@ -141,9 +142,7 @@ class MarksOneSubjectFragment : DialogFragment() {
val wholeNameTV = TextView(requireContext())
// index by the abbrev and get the name (if null just fallback to the abbrev)
wholeNameTV.text = Vars.subjectNameMap[marks[0].subject] ?: marks[0].subject
- wholeNameTV.textSize = 28f
- wholeNameTV.gravity = Gravity.CENTER
- wholeNameTV.setPadding(20, 30, 10, 30)
+ wholeNameTV.gravity = Gravity.CENTER_VERTICAL
wholeNameTV.setTypeface(customFont, Typeface.BOLD)
wholeNameTV.setTextColor(
ContextCompat.getColor(
@@ -162,9 +161,13 @@ class MarksOneSubjectFragment : DialogFragment() {
avgTV.textAlignment = View.TEXT_ALIGNMENT_TEXT_END
avgTV.layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT
+ LinearLayout.LayoutParams.WRAP_CONTENT
)
- avgTV.setPadding(30, 30, 30, 30)
+ if (wholeNameTV.text.length < 15) {
+ wholeNameTV.textSize = 28f
+ } else {
+ wholeNameTV.textSize = 24f
+ }
avgTV.setTextColor(
ContextCompat.getColor(
requireContext(),
diff --git a/mobile/app/src/main/java/com/odweta/solon/Util.kt b/mobile/app/src/main/java/com/odweta/solon/Util.kt
index eaf6e5e..8ee5ffc 100644
--- a/mobile/app/src/main/java/com/odweta/solon/Util.kt
+++ b/mobile/app/src/main/java/com/odweta/solon/Util.kt
@@ -145,7 +145,8 @@ class Util {
var sum = 0f
var len = 0
- for (mark in marks) {
+ val marksCopy = marks.toList()
+ for (mark in marksCopy) {
len += 1
if (mark.grade !in "0123456789") {
marks.remove(mark)
diff --git a/mobile/app/src/main/res/drawable/spock.png b/mobile/app/src/main/res/drawable/spock.png
new file mode 100644
index 0000000..ce10f58
Binary files /dev/null and b/mobile/app/src/main/res/drawable/spock.png differ
diff --git a/mobile/app/src/main/res/values/dimens.xml b/mobile/app/src/main/res/values/dimens.xml
index 85eae8b..fc2d3cf 100644
--- a/mobile/app/src/main/res/values/dimens.xml
+++ b/mobile/app/src/main/res/values/dimens.xml
@@ -10,6 +10,7 @@
15sp
28sp
26sp
+ 26sp
15sp
15sp
\ No newline at end of file
diff --git a/mobile/build.gradle.kts b/mobile/build.gradle.kts
index 898d03c..9c5e872 100644
--- a/mobile/build.gradle.kts
+++ b/mobile/build.gradle.kts
@@ -1,5 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
- id("com.android.application") version "8.6.0" apply false
+ id("com.android.application") version "8.7.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
}
\ No newline at end of file
diff --git a/mobile/gradle/wrapper/gradle-wrapper.properties b/mobile/gradle/wrapper/gradle-wrapper.properties
index 0308a70..f01bfee 100644
--- a/mobile/gradle/wrapper/gradle-wrapper.properties
+++ b/mobile/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sun Jan 07 18:04:36 GMT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists