Compare commits

..

No commits in common. "feature/material3" and "develop" have entirely different histories.

263 changed files with 2208 additions and 9267 deletions

View File

@ -20,9 +20,8 @@ android {
buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap
buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\"" buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\""
manifestPlaceholders = [ manifestPlaceholders = [
buildTimestamp: String.valueOf(System.currentTimeMillis()) buildTimestamp: String.valueOf(System.currentTimeMillis())
] ]
multiDexEnabled = true multiDexEnabled = true
@ -37,8 +36,6 @@ android {
arguments { arguments {
arg("room.schemaLocation", "$projectDir/schemas") arg("room.schemaLocation", "$projectDir/schemas")
} }
correctErrorTypes true
} }
} }
@ -46,12 +43,10 @@ android {
debug { debug {
getIsDefault().set(true) getIsDefault().set(true)
minifyEnabled = false minifyEnabled = false
applicationIdSuffix ".debug"
manifestPlaceholders = [ manifestPlaceholders = [
buildTimestamp: 0 buildTimestamp: 0
] ]
} }
release { release {
minifyEnabled = true minifyEnabled = true
shrinkResources = true shrinkResources = true
@ -59,35 +54,28 @@ android {
proguardFiles fileTree('proguard').asList().toArray() proguardFiles fileTree('proguard').asList().toArray()
} }
} }
flavorDimensions "platform"
flavorDimensions += "platform"
productFlavors { productFlavors {
unofficial { unofficial {
getIsDefault().set(true) getIsDefault().set(true)
versionName "${release.versionName}-${gitInfo.versionSuffix}" versionName "${release.versionName}-${gitInfo.versionSuffix}"
} }
official {} official {}
play {} play {}
} }
variantFilter { variant -> variantFilter { variant ->
def flavors = variant.flavors*.name def flavors = variant.flavors*.name
setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main")) setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main"))
} }
sourceSets { sourceSets {
unofficial { unofficial {
java.srcDirs = ["src/main/java", "src/play-not/java"] java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml") manifest.srcFile("src/play-not/AndroidManifest.xml")
} }
official { official {
java.srcDirs = ["src/main/java", "src/play-not/java"] java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml") manifest.srcFile("src/play-not/AndroidManifest.xml")
} }
play { play {
java.srcDirs = ["src/main/java", "src/play/java"] java.srcDirs = ["src/main/java", "src/play/java"]
} }
@ -96,47 +84,37 @@ android {
defaultConfig { defaultConfig {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
buildFeatures { buildFeatures {
dataBinding = true dataBinding = true
viewBinding = true viewBinding = true
buildConfig = true
} }
compileOptions { compileOptions {
coreLibraryDesugaringEnabled = true coreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
packagingOptions { packagingOptions {
resources { resources {
excludes += ['META-INF/library-core_release.kotlin_module'] excludes += ['META-INF/library-core_release.kotlin_module']
} }
} }
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path "src/main/cpp/CMakeLists.txt" path "src/main/cpp/CMakeLists.txt"
version "3.10.2" version "3.10.2"
} }
} }
lint { lint {
checkReleaseBuilds false checkReleaseBuilds false
} }
namespace 'pl.szczodrzynski.edziennik'
} }
tasks.whenTaskAdded { task -> tasks.whenTaskAdded { task ->
if (!task.name.endsWith("Release") && !task.name.endsWith("ReleaseWithR8")) if (!task.name.endsWith("Release") && !task.name.endsWith("ReleaseWithR8"))
return return
def renameTaskName = "rename${task.name.capitalize()}" def renameTaskName = "rename${task.name.capitalize()}"
def flavor = "" def flavor = ""
@ -147,20 +125,16 @@ tasks.whenTaskAdded { task ->
if (task.name.startsWith("minify")) if (task.name.startsWith("minify"))
flavor = task.name.substring("minify".length(), task.name.indexOf("Release")).uncapitalize() flavor = task.name.substring("minify".length(), task.name.indexOf("Release")).uncapitalize()
def taskName = "package${flavor.capitalize()}Release"
if (flavor != "") { if (flavor != "") {
tasks.register(renameTaskName, Copy) { tasks.create(renameTaskName, Copy) {
dependsOn(taskName)
from file("${projectDir}/${flavor}/release/"), from file("${projectDir}/${flavor}/release/"),
file("${layout.buildDirectory}/outputs/mapping/${flavor}Release/"), file("${buildDir}/outputs/mapping/${flavor}Release/"),
file("${layout.buildDirectory}/outputs/apk/${flavor}/release/"), file("${buildDir}/outputs/apk/${flavor}/release/"),
file("${layout.buildDirectory}/outputs/bundle/${flavor}Release/") file("${buildDir}/outputs/bundle/${flavor}Release/")
include "*.aab", "*.apk", "mapping.txt", "output-metadata.json" include "*.aab", "*.apk", "mapping.txt", "output-metadata.json"
destinationDir file("${projectDir}/release/") destinationDir file("${projectDir}/release/")
rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1' rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1'
} }
task.finalizedBy(renameTaskName) task.finalizedBy(renameTaskName)
} }
} }
@ -168,35 +142,32 @@ tasks.whenTaskAdded { task ->
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/navlib-debug.aar')
implementation files('libs/navlib-font-debug.aar')
// Language cores // Language cores
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.multidex:multidex:2.0.1"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4" coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
// Android Jetpack // Android Jetpack
implementation "androidx.appcompat:appcompat:1.7.0" implementation "androidx.appcompat:appcompat:1.5.1"
implementation "androidx.cardview:cardview:1.0.0" implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:2.1.4" implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "androidx.core:core-ktx:1.13.1" implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.2" implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
implementation "androidx.navigation:navigation-fragment-ktx:2.7.7" implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
implementation "androidx.recyclerview:recyclerview:1.3.2" implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.room:room-runtime:2.6.1" implementation "androidx.room:room-runtime:2.4.3"
implementation "androidx.room:room-ktx:2.6.1" implementation "androidx.room:room-ktx:2.4.3"
implementation "androidx.work:work-runtime-ktx:2.9.0" implementation "androidx.work:work-runtime-ktx:2.7.1"
kapt "androidx.room:room-compiler:2.6.1" kapt "androidx.room:room-compiler:2.4.3"
// Google design libs // Google design libs
implementation "com.google.android.material:material:1.12.0" implementation "com.google.android.material:material:1.6.1"
implementation "com.google.android.flexbox:flexbox:3.0.0" implementation "com.google.android.flexbox:flexbox:3.0.0"
// Play Services/Firebase // Play Services/Firebase
implementation "com.google.android.gms:play-services-wearable:18.2.0" implementation "com.google.android.gms:play-services-wearable:17.1.0"
implementation("com.google.firebase:firebase-core") { version { strictly "19.0.2" } } implementation("com.google.firebase:firebase-core") { version { strictly "19.0.2" } }
implementation "com.google.firebase:firebase-crashlytics:19.0.1" implementation "com.google.firebase:firebase-crashlytics:18.2.13"
implementation("com.google.firebase:firebase-messaging") { version { strictly "20.1.3" } } implementation("com.google.firebase:firebase-messaging") { version { strictly "20.1.3" } }
// OkHttp, Retrofit, Gson, Jsoup // OkHttp, Retrofit, Gson, Jsoup
@ -204,13 +175,12 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:2.9.0" implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0" implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.retrofit2:converter-scalars:2.9.0" implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
implementation 'com.google.code.gson:gson:2.11.0' implementation 'com.google.code.gson:gson:2.8.8'
implementation 'org.jsoup:jsoup:1.14.3' implementation 'org.jsoup:jsoup:1.14.3'
implementation "pl.droidsonroids:jspoon:1.3.2" implementation "pl.droidsonroids:jspoon:1.3.2"
implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2" implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2"
// Szkolny.eu libraries/forks // Szkolny.eu libraries/forks
implementation project(":navlib")
implementation "eu.szkolny:android-snowfall:1ca9ea2da3" implementation "eu.szkolny:android-snowfall:1ca9ea2da3"
implementation "eu.szkolny:agendacalendarview:1.0.4" implementation "eu.szkolny:agendacalendarview:1.0.4"
implementation "eu.szkolny:cafebar:5bf0c618de" implementation "eu.szkolny:cafebar:5bf0c618de"
@ -218,24 +188,22 @@ dependencies {
implementation "eu.szkolny:material-about-library:1d5ebaf47c" implementation "eu.szkolny:material-about-library:1d5ebaf47c"
implementation "eu.szkolny:mhttp:af4b62e6e9" implementation "eu.szkolny:mhttp:af4b62e6e9"
implementation "eu.szkolny:nachos:0e5dfcaceb" implementation "eu.szkolny:nachos:0e5dfcaceb"
implementation "eu.szkolny.selective-dao:annotation:6a337f9" implementation "eu.szkolny.selective-dao:annotation:27f8f3f194"
officialImplementation "eu.szkolny:ssl-provider:1.0.0" officialImplementation "eu.szkolny:ssl-provider:1.0.0"
unofficialImplementation "eu.szkolny:ssl-provider:1.0.0" unofficialImplementation "eu.szkolny:ssl-provider:1.0.0"
implementation "pl.szczodrzynski:navlib:0.8.0"
implementation "pl.szczodrzynski:numberslidingpicker:2921225f76" implementation "pl.szczodrzynski:numberslidingpicker:2921225f76"
implementation "pl.szczodrzynski:recyclertablayout:700f980584" implementation "pl.szczodrzynski:recyclertablayout:700f980584"
implementation "pl.szczodrzynski:tachyon:551943a6b5" implementation "pl.szczodrzynski:tachyon:551943a6b5"
kapt "eu.szkolny.selective-dao:codegen:6a337f9" kapt "eu.szkolny.selective-dao:codegen:27f8f3f194"
// Iconics & related // Iconics & related
implementation "com.mikepenz:iconics-core:5.3.2" implementation "com.mikepenz:iconics-core:5.3.2"
implementation "com.mikepenz:iconics-views:5.3.2" implementation "com.mikepenz:iconics-views:5.3.2"
implementation "com.mikepenz:materialdrawer:9.0.1"
implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar" implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar"
implementation 'com.mikepenz:google-material-typeface:4.0.0.2-kotlin@aar'
implementation "eu.szkolny:szkolny-font:77e33acc2a" implementation "eu.szkolny:szkolny-font:77e33acc2a"
// Other dependencies // Other dependencies
debugApi "com.mikepenz:materialize:1.2.1" // required for all R.color.md_* colors
implementation "cat.ereza:customactivityoncrash:2.3.0" implementation "cat.ereza:customactivityoncrash:2.3.0"
implementation "com.android.volley:volley:1.2.1" implementation "com.android.volley:volley:1.2.1"
implementation "com.daimajia.swipelayout:library:1.2.0@aar" implementation "com.daimajia.swipelayout:library:1.2.0@aar"
@ -258,10 +226,6 @@ dependencies {
implementation("com.heinrichreimersoftware:material-intro") { version { strictly "1.5.8" } } implementation("com.heinrichreimersoftware:material-intro") { version { strictly "1.5.8" } }
implementation("pl.droidsonroids.gif:android-gif-drawable") { version { strictly "1.2.15" } } implementation("pl.droidsonroids.gif:android-gif-drawable") { version { strictly "1.2.15" } }
// NavLib dependencies // Debug-only dependencies
// TODO: try to move these dependencies to NavLib build.gradle file debugImplementation "com.github.amitshekhariitbhu.Android-Debug-Database:debug-db:v1.0.6"
implementation "com.mikepenz:materialize:1.2.1"
implementation "com.mikepenz:itemanimators:1.1.0"
testImplementation 'junit:junit:4.13.2'
} }

View File

@ -5,7 +5,7 @@
buildscript { buildscript {
repositories { repositories {
google() google()
mavenCentral() jcenter()
} }
dependencies { dependencies {
classpath "org.eclipse.jgit:org.eclipse.jgit:5.5.+" classpath "org.eclipse.jgit:org.eclipse.jgit:5.5.+"

View File

@ -36,37 +36,6 @@
"status": 2 "status": 2
} }
} }
},
{
"client_info": {
"mobilesdk_app_id": "1:640759989760:android:4aa71407b25cdc8d",
"android_client_info": {
"package_name": "pl.szczodrzynski.edziennik.debug"
}
},
"oauth_client": [
{
"client_id": "640759989760-6f8q00u864lnuh3gh36e8g4cer9lv8pv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAvq9HMPxulz9ntdAHZ0eZuPf2YQs4nDSU"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
} }
], ],
"configuration_version": "1" "configuration_version": "1"

View File

@ -19,10 +19,7 @@
# If you keep the line number information, uncomment this to # If you keep the line number information, uncomment this to
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
-keepattributes Signature
-keep class android.support.v7.widget.** { *; } -keep class android.support.v7.widget.** { *; }
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class pl.szczodrzynski.edziennik.utils.models.** { *; } -keep class pl.szczodrzynski.edziennik.utils.models.** { *; }
-keep class pl.szczodrzynski.edziennik.data.db.enums.* { *; } -keep class pl.szczodrzynski.edziennik.data.db.enums.* { *; }
@ -58,19 +55,8 @@
-keep class com.google.android.material.tabs.** {*;} -keep class com.google.android.material.tabs.** {*;}
# Exclude AgendaCalendarView
# Preserve generic type information for EventRenderer and its subclasses
-keepclassmembers class * extends com.github.tibolte.agendacalendarview.render.EventRenderer {
<fields>;
<methods>;
}
# Keep the EventRenderer class itself and all its subclasses
-keep class com.github.tibolte.agendacalendarview.render.EventRenderer
-keep class * extends com.github.tibolte.agendacalendarview.render.EventRenderer
# ServiceLoader support # ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
# Most of volatile fields are updated with AFU and should not be mangled # Most of volatile fields are updated with AFU and should not be mangled
@ -84,36 +70,9 @@
-keep class pl.szczodrzynski.edziennik.data.api.szkolny.interceptor.Signing { public final byte[] pleaseStopRightNow(java.lang.String, long); } -keep class pl.szczodrzynski.edziennik.data.api.szkolny.interceptor.Signing { public final byte[] pleaseStopRightNow(java.lang.String, long); }
-keepclassmembers class pl.szczodrzynski.edziennik.ui.login.qr.* { *; }
-keepclassmembers class pl.szczodrzynski.edziennik.data.api.szkolny.request.** { *; } -keepclassmembers class pl.szczodrzynski.edziennik.data.api.szkolny.request.** { *; }
-keepclassmembers class pl.szczodrzynski.edziennik.data.api.szkolny.response.** { *; } -keepclassmembers class pl.szczodrzynski.edziennik.data.api.szkolny.response.** { *; }
-keepclassmembernames class pl.szczodrzynski.edziennik.ui.login.LoginInfo$Platform { *; } -keepclassmembernames class pl.szczodrzynski.edziennik.ui.login.LoginInfo$Platform { *; }
-keepclassmembernames class pl.szczodrzynski.fslogin.realm.RealmData { *; } -keepclassmembernames class pl.szczodrzynski.fslogin.realm.RealmData { *; }
-keepclassmembernames class pl.szczodrzynski.fslogin.realm.RealmData$Type { *; } -keepclassmembernames class pl.szczodrzynski.fslogin.realm.RealmData$Type { *; }
# Exclude Retrofit2
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keepattributes AnnotationDefault
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn javax.annotation.**
-dontwarn kotlin.Unit
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
-keep,allowobfuscation,allowshrinking class retrofit2.Response

View File

@ -124,11 +124,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"gradeId" "gradeId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -197,11 +197,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"teacherId" "teacherId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -278,11 +278,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"teacherAbsenceId" "teacherAbsenceId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -321,11 +321,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"teacherAbsenceTypeId" "teacherAbsenceTypeId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -366,11 +366,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"subjectId" "subjectId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -441,11 +441,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"noticeId" "noticeId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -502,11 +502,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"teamId" "teamId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -619,11 +619,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"attendanceId" "attendanceId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -770,11 +770,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"eventId" "eventId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -843,11 +843,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"eventType" "eventType"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -882,10 +882,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"loginStoreId" "loginStoreId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1046,10 +1046,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId" "profileId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1084,11 +1084,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"luckyNumberDate" "luckyNumberDate"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1159,11 +1159,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"announcementId" "announcementId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -1238,12 +1238,12 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"categoryId", "categoryId",
"type" "type"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1308,10 +1308,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": true,
"columnNames": [ "columnNames": [
"messageId" "messageId"
] ],
"autoGenerate": true
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1400,11 +1400,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"messageId" "messageId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -1456,12 +1456,12 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"messageRecipientId", "messageRecipientId",
"messageId" "messageId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1484,10 +1484,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": true,
"columnNames": [ "columnNames": [
"id" "id"
] ],
"autoGenerate": true
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1528,11 +1528,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"endpointId" "endpointId"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1567,11 +1567,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"lessonRangeNumber" "lessonRangeNumber"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1648,10 +1648,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": true,
"columnNames": [ "columnNames": [
"id" "id"
] ],
"autoGenerate": true
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1680,11 +1680,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"id" "id"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1713,11 +1713,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"id" "id"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1770,11 +1770,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"id" "id"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -1923,11 +1923,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"id" "id"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -1979,11 +1979,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"key" "key"
] ],
"autoGenerate": false
}, },
"indices": [], "indices": [],
"foreignKeys": [] "foreignKeys": []
@ -2024,11 +2024,11 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"profileId", "profileId",
"lessonId" "lessonId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -2127,10 +2127,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": true,
"columnNames": [ "columnNames": [
"id" "id"
] ],
"autoGenerate": true
}, },
"indices": [ "indices": [
{ {
@ -2228,10 +2228,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": false,
"columnNames": [ "columnNames": [
"noteId" "noteId"
] ],
"autoGenerate": false
}, },
"indices": [ "indices": [
{ {
@ -2290,10 +2290,10 @@
} }
], ],
"primaryKey": { "primaryKey": {
"autoGenerate": true,
"columnNames": [ "columnNames": [
"metadataId" "metadataId"
] ],
"autoGenerate": true
}, },
"indices": [ "indices": [
{ {

File diff suppressed because it is too large Load Diff

View File

@ -137,7 +137,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_grades_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_grades_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -291,7 +290,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_teacherAbsence_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_teacherAbsence_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -454,7 +452,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_notices_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_notices_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -632,7 +629,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_attendances_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_attendances_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -785,7 +781,6 @@
"eventDate", "eventDate",
"eventTime" "eventTime"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventDate_eventTime` ON `${TABLE_NAME}` (`profileId`, `eventDate`, `eventTime`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventDate_eventTime` ON `${TABLE_NAME}` (`profileId`, `eventDate`, `eventTime`)"
}, },
{ {
@ -795,7 +790,6 @@
"profileId", "profileId",
"eventType" "eventType"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventType` ON `${TABLE_NAME}` (`profileId`, `eventType`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventType` ON `${TABLE_NAME}` (`profileId`, `eventType`)"
} }
], ],
@ -1172,7 +1166,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_announcements_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_announcements_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -1414,7 +1407,6 @@
"profileId", "profileId",
"messageType" "messageType"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_messages_profileId_messageType` ON `${TABLE_NAME}` (`profileId`, `messageType`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_profileId_messageType` ON `${TABLE_NAME}` (`profileId`, `messageType`)"
} }
], ],
@ -1926,7 +1918,6 @@
"type", "type",
"date" "date"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_date` ON `${TABLE_NAME}` (`profileId`, `type`, `date`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_date` ON `${TABLE_NAME}` (`profileId`, `type`, `date`)"
}, },
{ {
@ -1937,7 +1928,6 @@
"type", "type",
"oldDate" "oldDate"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_oldDate` ON `${TABLE_NAME}` (`profileId`, `type`, `oldDate`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_oldDate` ON `${TABLE_NAME}` (`profileId`, `type`, `oldDate`)"
} }
], ],
@ -2025,7 +2015,6 @@
"columnNames": [ "columnNames": [
"profileId" "profileId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_librusLessons_profileId` ON `${TABLE_NAME}` (`profileId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_librusLessons_profileId` ON `${TABLE_NAME}` (`profileId`)"
} }
], ],
@ -2128,7 +2117,6 @@
"profileId", "profileId",
"date" "date"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_date` ON `${TABLE_NAME}` (`profileId`, `date`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_date` ON `${TABLE_NAME}` (`profileId`, `date`)"
}, },
{ {
@ -2138,7 +2126,6 @@
"profileId", "profileId",
"weekDay" "weekDay"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_weekDay` ON `${TABLE_NAME}` (`profileId`, `weekDay`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_weekDay` ON `${TABLE_NAME}` (`profileId`, `weekDay`)"
} }
], ],
@ -2230,7 +2217,6 @@
"noteOwnerType", "noteOwnerType",
"noteOwnerId" "noteOwnerId"
], ],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_notes_profileId_noteOwnerType_noteOwnerId` ON `${TABLE_NAME}` (`profileId`, `noteOwnerType`, `noteOwnerId`)" "createSql": "CREATE INDEX IF NOT EXISTS `index_notes_profileId_noteOwnerType_noteOwnerId` ON `${TABLE_NAME}` (`profileId`, `noteOwnerType`, `noteOwnerId`)"
} }
], ],
@ -2292,7 +2278,6 @@
"thingType", "thingType",
"thingId" "thingId"
], ],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_metadata_profileId_thingType_thingId` ON `${TABLE_NAME}` (`profileId`, `thingType`, `thingId`)" "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_metadata_profileId_thingType_thingId` ON `${TABLE_NAME}` (`profileId`, `thingType`, `thingId`)"
} }
], ],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) Kuba Szczodrzyński 2020-5-11.
-->
<resources>
<color name="ic_launcher_background">#FF7D54</color>
</resources>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools"
package="pl.szczodrzynski.edziennik">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
@ -9,13 +10,11 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- PowerPermission uses minSdk 21, it's safe to override as it is used only in >= 23 --> <!-- PowerPermission uses minSdk 21, it's safe to override as it is used only in >= 23 -->
<uses-sdk tools:overrideLibrary="com.qifan.powerpermission.coroutines, com.qifan.powerpermission.core, com.mikepenz:materialdrawer, com.mikepenz.iconics.typeface.library.navlibfont" /> <uses-sdk tools:overrideLibrary="com.qifan.powerpermission.coroutines, com.qifan.powerpermission.core" />
<application <application
android:name=".App" android:name=".App"
@ -41,6 +40,7 @@
|___/ --> |___/ -->
<activity android:name=".MainActivity" <activity android:name=".MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop" android:launchMode="singleTop"
android:exported="true" android:exported="true"
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
@ -84,7 +84,7 @@
android:resource="@xml/widget_timetable_info" /> android:resource="@xml/widget_timetable_info" />
</receiver> </receiver>
<service android:name=".ui.widgets.timetable.WidgetTimetableService" <service android:name=".ui.widgets.timetable.WidgetTimetableService"
android:permission="android.permission.BIND_REMOTEVIEWS" android:foregroundServiceType="dataSync"/> android:permission="android.permission.BIND_REMOTEVIEWS" />
<activity android:name=".ui.widgets.LessonDialogActivity" <activity android:name=".ui.widgets.LessonDialogActivity"
android:label="" android:label=""
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
@ -105,7 +105,7 @@
android:resource="@xml/widget_notifications_info" /> android:resource="@xml/widget_notifications_info" />
</receiver> </receiver>
<service android:name=".ui.widgets.notifications.WidgetNotificationsService" <service android:name=".ui.widgets.notifications.WidgetNotificationsService"
android:permission="android.permission.BIND_REMOTEVIEWS" android:foregroundServiceType="dataSync"/> android:permission="android.permission.BIND_REMOTEVIEWS" />
<!-- LUCKY NUMBER --> <!-- LUCKY NUMBER -->
<receiver android:name=".ui.widgets.luckynumber.WidgetLuckyNumberProvider" <receiver android:name=".ui.widgets.luckynumber.WidgetLuckyNumberProvider"
android:label="@string/widget_lucky_number_title" android:label="@string/widget_lucky_number_title"
@ -133,6 +133,7 @@
android:theme="@style/DeadTheme" /> android:theme="@style/DeadTheme" />
<activity android:name=".ui.intro.ChangelogIntroActivity" <activity android:name=".ui.intro.ChangelogIntroActivity"
android:configChanges="orientation|keyboardHidden" android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:exported="false" android:exported="false"
android:theme="@style/Theme.Intro" /> android:theme="@style/Theme.Intro" />
<activity android:name=".ui.login.LoginActivity" <activity android:name=".ui.login.LoginActivity"
@ -145,6 +146,7 @@
android:theme="@style/AppTheme.Black" /> android:theme="@style/AppTheme.Black" />
<activity android:name=".ui.feedback.FeedbackActivity" <activity android:name=".ui.feedback.FeedbackActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name"
android:exported="false" android:exported="false"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity android:name=".ui.settings.SettingsLicenseActivity" <activity android:name=".ui.settings.SettingsLicenseActivity"
@ -200,15 +202,15 @@
____) | __/ | \ V /| | (_| __/\__ \ ____) | __/ | \ V /| | (_| __/\__ \
|_____/ \___|_| \_/ |_|\___\___||___/ |_____/ \___|_| \_/ |_|\___\___||___/
--> -->
<service android:name=".data.api.ApiService" android:foregroundServiceType="dataSync"/> <service android:name=".data.api.ApiService" />
<service android:name=".data.firebase.MyFirebaseService" <service android:name=".data.firebase.MyFirebaseService"
android:exported="false" android:foregroundServiceType="dataSync"> android:exported="false">
<intent-filter android:priority="10000000"> <intent-filter android:priority="10000000">
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter> </intent-filter>
</service> </service>
<service android:name=".sync.UpdateDownloaderService" android:foregroundServiceType="dataSync"/> <service android:name=".sync.UpdateDownloaderService" />
<!-- <!--
_____ _ _ _____ _ _

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

View File

@ -124,8 +124,7 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
private val job = Job() private val job = Job()
override val coroutineContext: CoroutineContext override val coroutineContext: CoroutineContext
get() = job + Dispatchers.Main get() = job + Dispatchers.Main
override fun getWorkManagerConfiguration() = Configuration.Builder()
override val workManagerConfiguration: Configuration = Configuration.Builder()
.setMinimumLoggingLevel(Log.VERBOSE) .setMinimumLoggingLevel(Log.VERBOSE)
.build() .build()

View File

@ -1,6 +1,5 @@
package pl.szczodrzynski.edziennik package pl.szczodrzynski.edziennik
import android.annotation.SuppressLint
import android.app.ActivityManager import android.app.ActivityManager
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
@ -16,11 +15,10 @@ import android.view.Gravity
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat import androidx.core.graphics.ColorUtils
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.navigation.NavOptions import androidx.navigation.NavOptions
import com.danimahardhika.cafebar.CafeBar import com.danimahardhika.cafebar.CafeBar
import com.danimahardhika.cafebar.CafeBarTheme
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.jetradarmobile.snowfall.SnowfallView import com.jetradarmobile.snowfall.SnowfallView
import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.IconicsDrawable
@ -41,6 +39,7 @@ import pl.szczodrzynski.edziennik.data.api.events.*
import pl.szczodrzynski.edziennik.data.api.models.ApiError import pl.szczodrzynski.edziennik.data.api.models.ApiError
import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update
import pl.szczodrzynski.edziennik.data.db.entity.Message import pl.szczodrzynski.edziennik.data.db.entity.Message
import pl.szczodrzynski.edziennik.data.db.entity.Metadata.*
import pl.szczodrzynski.edziennik.data.db.entity.Profile import pl.szczodrzynski.edziennik.data.db.entity.Profile
import pl.szczodrzynski.edziennik.data.db.enums.FeatureType import pl.szczodrzynski.edziennik.data.db.enums.FeatureType
import pl.szczodrzynski.edziennik.databinding.ActivitySzkolnyBinding import pl.szczodrzynski.edziennik.databinding.ActivitySzkolnyBinding
@ -67,16 +66,19 @@ import pl.szczodrzynski.edziennik.ui.messages.list.MessagesFragment
import pl.szczodrzynski.edziennik.ui.timetable.TimetableFragment import pl.szczodrzynski.edziennik.ui.timetable.TimetableFragment
import pl.szczodrzynski.edziennik.utils.* import pl.szczodrzynski.edziennik.utils.*
import pl.szczodrzynski.edziennik.utils.Utils.d import pl.szczodrzynski.edziennik.utils.Utils.d
import pl.szczodrzynski.edziennik.utils.Utils.dpToPx
import pl.szczodrzynski.edziennik.utils.managers.AvailabilityManager.Error.Type import pl.szczodrzynski.edziennik.utils.managers.AvailabilityManager.Error.Type
import pl.szczodrzynski.edziennik.utils.managers.UserActionManager import pl.szczodrzynski.edziennik.utils.managers.UserActionManager
import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.models.Date
import pl.szczodrzynski.navlib.* import pl.szczodrzynski.navlib.*
import pl.szczodrzynski.navlib.SystemBarsUtil.Companion.COLOR_HALF_TRANSPARENT
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
import pl.szczodrzynski.navlib.drawer.NavDrawer import pl.szczodrzynski.navlib.drawer.NavDrawer
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
import java.io.IOException import java.io.IOException
import java.util.*
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.math.roundToInt import kotlin.math.roundToInt
@ -146,10 +148,10 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar)
val versionBadge = app.buildManager.versionBadge val versionBadge = app.buildManager.versionBadge
navView.nightlyText.isVisible = versionBadge != null b.nightlyText.isVisible = versionBadge != null
navView.nightlyText.text = versionBadge b.nightlyText.text = versionBadge
if (versionBadge != null) { if (versionBadge != null) {
navView.nightlyText.background.setTintColor(0xa0ff0000.toInt()) b.nightlyText.background.setTintColor(0xa0ff0000.toInt())
} }
navLoading = true navLoading = true
@ -157,11 +159,51 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
b.navView.apply { b.navView.apply {
drawer.init(this@MainActivity) drawer.init(this@MainActivity)
SystemBarsUtil(this@MainActivity).run {
//paddingByKeyboard = b.navView
appFullscreen = false
statusBarColor = getColorFromAttr(context, android.R.attr.colorBackground)
statusBarDarker = false
statusBarFallbackLight = COLOR_HALF_TRANSPARENT
statusBarFallbackGradient = COLOR_HALF_TRANSPARENT
navigationBarTransparent = false
b.navView.configSystemBarsUtil(this)
// fix for setting status bar color to window color, outside of navlib
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = statusBarColor
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& ColorUtils.calculateLuminance(statusBarColor) > 0.6
) {
@Suppress("deprecation")
window.decorView.systemUiVisibility =
window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
// TODO fix navlib navbar detection, orientation change issues, status bar color setting if not fullscreen
commit()
}
toolbar.apply {
subtitleFormat = R.string.toolbar_subtitle
subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread
}
bottomBar.apply { bottomBar.apply {
fabEnable = false fabEnable = false
fabExtendable = true fabExtendable = true
fabExtended = false fabExtended = false
fabGravity = Gravity.RIGHT fabGravity = Gravity.CENTER
if (Themes.isDark) {
setBackgroundColor(blendColors(
getColorFromAttr(context, R.attr.colorSurface),
getColorFromRes(R.color.colorSurface_4dp)
))
elevation = dpToPx(4).toFloat()
}
} }
bottomSheet.apply { bottomSheet.apply {
@ -316,7 +358,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
if (app.config.appRateSnackbarTime != 0L && app.config.appRateSnackbarTime <= System.currentTimeMillis()) { if (app.config.appRateSnackbarTime != 0L && app.config.appRateSnackbarTime <= System.currentTimeMillis()) {
navView.coordinator.postDelayed({ navView.coordinator.postDelayed({
CafeBar.builder(this) CafeBar.builder(this)
.theme(CafeBarTheme.Custom(getColorFromAttr(this, R.attr.colorSurfaceInverse)))
.content(R.string.rate_snackbar_text) .content(R.string.rate_snackbar_text)
.icon(IconicsDrawable(this).apply { .icon(IconicsDrawable(this).apply {
icon = CommunityMaterial.Icon3.cmd_star_outline icon = CommunityMaterial.Icon3.cmd_star_outline
@ -519,6 +560,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
swipeRefreshLayout.isRefreshing = true swipeRefreshLayout.isRefreshing = true
if (event.profileId == App.profileId) { if (event.profileId == App.profileId) {
navView.toolbar.apply { navView.toolbar.apply {
subtitleFormat = null
subtitleFormatWithUnread = null
subtitle = getString(R.string.toolbar_subtitle_syncing) subtitle = getString(R.string.toolbar_subtitle_syncing)
} }
} }
@ -536,6 +579,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
fun onApiTaskProgressEvent(event: ApiTaskProgressEvent) { fun onApiTaskProgressEvent(event: ApiTaskProgressEvent) {
if (event.profileId == App.profileId) { if (event.profileId == App.profileId) {
navView.toolbar.apply { navView.toolbar.apply {
subtitleFormat = null
subtitleFormatWithUnread = null
subtitle = if (event.progress < 0f) subtitle = if (event.progress < 0f)
event.progressText ?: "" event.progressText ?: ""
else else
@ -554,6 +599,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
EventBus.getDefault().removeStickyEvent(event) EventBus.getDefault().removeStickyEvent(event)
if (event.profileId == App.profileId) { if (event.profileId == App.profileId) {
navView.toolbar.apply { navView.toolbar.apply {
subtitleFormat = R.string.toolbar_subtitle
subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread
subtitle = "Gotowe" subtitle = "Gotowe"
} }
} }
@ -574,6 +621,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
ErrorDetailsDialog(this, listOf(event.error)).show() ErrorDetailsDialog(this, listOf(event.error)).show()
} }
navView.toolbar.apply { navView.toolbar.apply {
subtitleFormat = R.string.toolbar_subtitle
subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread
subtitle = "Gotowe" subtitle = "Gotowe"
} }
mainSnackbar.dismiss() mainSnackbar.dismiss()
@ -780,13 +829,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
d(TAG, "Activity resumed") d(TAG, "Activity resumed")
val filter = IntentFilter() val filter = IntentFilter()
filter.addAction(Intent.ACTION_MAIN) filter.addAction(Intent.ACTION_MAIN)
registerReceiver(intentReceiver, filter)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
registerReceiver(intentReceiver, filter, RECEIVER_NOT_EXPORTED)
else
@Suppress("UnspecifiedRegisterReceiverFlag")
registerReceiver(intentReceiver, filter)
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
super.onResume() super.onResume()
} }
@ -813,7 +856,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
handleIntent(intent?.extras) handleIntent(intent?.extras)
} }
@Deprecated("Deprecated in Java")
@Suppress("deprecation") @Suppress("deprecation")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
@ -933,19 +975,16 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
bottomSheet.removeAllContextual() bottomSheet.removeAllContextual()
bottomSheet.toggleGroupEnabled = false bottomSheet.toggleGroupEnabled = false
drawer.close() drawer.close()
if (drawer.getSelection() != navTarget.id) if (drawer.getSelection() != navTarget.id)
drawer.setSelection(navTarget.id, fireOnClick = false) drawer.setSelection(navTarget.id, fireOnClick = false)
navView.toolbar.setTitle(navTarget.titleRes ?: navTarget.nameRes)
navView.bottomBar.fabEnable = false navView.bottomBar.fabEnable = false
navView.bottomBar.fabExtended = false navView.bottomBar.fabExtended = false
navView.bottomBar.setFabOnClickListener(null) navView.bottomBar.setFabOnClickListener(null)
navView.toolbar.setTitle(navTarget.titleRes ?: navTarget.nameRes)
d("NavDebug", "Navigating from ${this.navTarget.name} to ${navTarget.name}") d("NavDebug", "Navigating from ${this.navTarget.name} to ${navTarget.name}")
val fragment = navTarget.fragmentClass?.getDeclaredConstructor()?.newInstance() ?: return val fragment = navTarget.fragmentClass?.newInstance() ?: return
fragment.arguments = arguments fragment.arguments = arguments
val transaction = fragmentManager.beginTransaction() val transaction = fragmentManager.beginTransaction()
@ -1012,18 +1051,20 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
transaction.commitAllowingStateLoss() transaction.commitAllowingStateLoss()
// TASK DESCRIPTION // TASK DESCRIPTION
val bm = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val bm = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
@Suppress("deprecation") @Suppress("deprecation")
val taskDesc = ActivityManager.TaskDescription( val taskDesc = ActivityManager.TaskDescription(
if (navTarget == NavTarget.HOME) if (navTarget == NavTarget.HOME)
getString(R.string.app_name) getString(R.string.app_name)
else else
getString(R.string.app_task_format, getString(navTarget.nameRes)), getString(R.string.app_task_format, getString(navTarget.nameRes)),
bm, bm,
getColorFromAttr(this, R.attr.colorSurface) getColorFromAttr(this, R.attr.colorSurface)
) )
setTaskDescription(taskDesc) setTaskDescription(taskDesc)
}
return return
} }
@ -1053,7 +1094,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
fun navigateUp(skipBeforeNavigate: Boolean = false) { fun navigateUp(skipBeforeNavigate: Boolean = false) {
if (!popBackStack(skipBeforeNavigate)) { if (!popBackStack(skipBeforeNavigate)) {
super.onBackPressedDispatcher.onBackPressed() super.onBackPressed()
} }
} }
@ -1064,6 +1105,9 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
fun gainAttention() { fun gainAttention() {
if (app.config.ui.bottomSheetOpened) if (app.config.ui.bottomSheetOpened)
return return
b.navView.postDelayed({
navView.gainAttentionOnBottomBar()
}, 2000)
} }
fun gainAttentionFAB() { fun gainAttentionFAB() {
@ -1181,8 +1225,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
drawer.addProfileSettings(*drawerProfiles.toTypedArray()) drawer.addProfileSettings(*drawerProfiles.toTypedArray())
} }
@SuppressLint("MissingSuperCall")
@Deprecated("Deprecated in Java")
override fun onBackPressed() { override fun onBackPressed() {
if (App.config.ui.openDrawerOnBackPressed) { if (App.config.ui.openDrawerOnBackPressed) {
if (drawer.isOpen) if (drawer.isOpen)

View File

@ -15,7 +15,6 @@ class ConfigUI(base: Config) {
var appBackground by base.config<String?>("appBg", null) var appBackground by base.config<String?>("appBg", null)
var headerBackground by base.config<String?>("headerBg", null) var headerBackground by base.config<String?>("headerBg", null)
var lockLayout by base.config<Boolean>(false)
var miniMenuVisible by base.config<Boolean>(false) var miniMenuVisible by base.config<Boolean>(false)
var miniMenuButtons by base.config<Set<NavTarget>> { var miniMenuButtons by base.config<Set<NavTarget>> {
setOf( setOf(

View File

@ -144,7 +144,7 @@ class ConfigDelegate<T>(
java.lang.Float::class.java -> value.toFloatOrNull() java.lang.Float::class.java -> value.toFloatOrNull()
// enums, maps & collections // enums, maps & collections
else -> when { else -> when {
Enum::class.java.isAssignableFrom(type) -> value.toIntOrNull()?.toEnum(type) as Enum Enum::class.java.isAssignableFrom(type) -> value.toIntOrNull()?.toEnum(type) as Enum<*>
Collection::class.java.isAssignableFrom(type) -> { Collection::class.java.isAssignableFrom(type) -> {
val array = value.toJsonArray() val array = value.toJsonArray()
val genericType = getGenericType() val genericType = getGenericType()

View File

@ -39,7 +39,6 @@ class LibrusRecaptchaHelper(
private var timedOut = false private var timedOut = false
inner class WebViewClient : android.webkit.WebViewClient() { inner class WebViewClient : android.webkit.WebViewClient() {
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
timeout?.cancel() timeout?.cancel()
if (!timedOut) { if (!timedOut) {

View File

@ -26,8 +26,7 @@ class PodlasieApiGrades(val data: DataPodlasie, val rows: List<JsonObject>) {
val weight = grade.getFloat("Weight") ?: 0f val weight = grade.getFloat("Weight") ?: 0f
val includeToAverage = grade.getInt("IncludeToAverage") != 0 val includeToAverage = grade.getInt("IncludeToAverage") != 0
val color = grade.getString("Color")?.let { Color.parseColor(it) } ?: -1 val color = grade.getString("Color")?.let { Color.parseColor(it) } ?: -1
val category = grade.getString("Category") val category = grade.getString("Category") ?: ""
val code = grade.getString("Code")
val comment = grade.getString("Comment") ?: "" val comment = grade.getString("Comment") ?: ""
val semester = grade.getString("TermShortcut")?.length ?: data.currentSemester val semester = grade.getString("TermShortcut")?.length ?: data.currentSemester
@ -41,12 +40,6 @@ class PodlasieApiGrades(val data: DataPodlasie, val rows: List<JsonObject>) {
val addedDate = grade.getString("ReceivedDate")?.let { Date.fromY_m_d(it).inMillis } val addedDate = grade.getString("ReceivedDate")?.let { Date.fromY_m_d(it).inMillis }
?: System.currentTimeMillis() ?: System.currentTimeMillis()
val categoryText: String = when {
code != null && category != null -> "$code - $category"
code != null -> code
else -> category ?: ""
}
val gradeObject = Grade( val gradeObject = Grade(
profileId = data.profileId, profileId = data.profileId,
id = id, id = id,
@ -55,7 +48,7 @@ class PodlasieApiGrades(val data: DataPodlasie, val rows: List<JsonObject>) {
value = value, value = value,
weight = if (includeToAverage) weight else 0f, weight = if (includeToAverage) weight else 0f,
color = color, color = color,
category = categoryText, category = category,
description = null, description = null,
comment = comment, comment = comment,
semester = semester, semester = semester,

View File

@ -424,7 +424,6 @@ open class VulcanHebe(open val data: DataVulcan, open val lastSync: Long?) {
HebeFilterType.BY_MESSAGEBOX -> { HebeFilterType.BY_MESSAGEBOX -> {
query["box"] = messageBox ?: data.messageBoxKey ?: "" query["box"] = messageBox ?: data.messageBoxKey ?: ""
} }
else -> {}
} }
if (dateFrom != null) if (dateFrom != null)

View File

@ -4,6 +4,7 @@
package pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.hebe package pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.hebe
import pl.szczodrzynski.edziennik.*
import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_GRADES import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_GRADES
import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan
import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_GRADES import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_GRADES
@ -38,7 +39,6 @@ class VulcanHebeGrades(
val column = grade.getJsonObject("Column") val column = grade.getJsonObject("Column")
val category = column.getJsonObject("Category") val category = column.getJsonObject("Category")
val categoryText = category.getString("Name") val categoryText = category.getString("Name")
val code = column.getString("Code").takeValue()
val teacherId = getTeacherId(grade, "Creator") ?: -1 val teacherId = getTeacherId(grade, "Creator") ?: -1
val subjectId = getSubjectId(column, "Subject") ?: -1 val subjectId = getSubjectId(column, "Subject") ?: -1
@ -91,12 +91,6 @@ class VulcanHebeGrades(
else else
columnColor columnColor
val categoryFormattedText: String = when {
code != null && category != null -> "$code - $categoryText"
code != null -> code
else -> categoryText ?: ""
}
val gradeObject = Grade( val gradeObject = Grade(
profileId = profileId, profileId = profileId,
id = id, id = id,
@ -105,7 +99,7 @@ class VulcanHebeGrades(
value = value ?: 0.0f, value = value ?: 0.0f,
weight = weight, weight = weight,
color = color, color = color,
category = categoryFormattedText, category = categoryText,
description = finalDescription, description = finalDescription,
comment = null, comment = null,
semester = getSemester(column), semester = getSemester(column),

View File

@ -188,7 +188,7 @@ abstract class AppDb : RoomDatabase() {
Migration97(), Migration97(),
Migration98(), Migration98(),
Migration99(), Migration99(),
Migration100() Migration100(),
).allowMainThreadQueries().build() ).allowMainThreadQueries().build()
} }
} }

View File

@ -83,13 +83,13 @@ fun AlertDialog.overlayBackgroundColor(color: Int, alpha: Int) {
val backgroundInsets = MaterialDialogs.getDialogBackgroundInsets( val backgroundInsets = MaterialDialogs.getDialogBackgroundInsets(
context, context,
R.attr.alertDialogStyle, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_Material3, R.style.MaterialAlertDialog_MaterialComponents,
) )
val background = MaterialShapeDrawable( val background = MaterialShapeDrawable(
context, context,
null, null,
R.attr.alertDialogStyle, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_Material3 R.style.MaterialAlertDialog_MaterialComponents
) )
with(background) { with(background) {
initializeElevationOverlay(context) initializeElevationOverlay(context)

View File

@ -21,8 +21,8 @@ import java.io.StringWriter
fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) { fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) {
observe(lifecycleOwner, object : Observer<T> { observe(lifecycleOwner, object : Observer<T> {
override fun onChanged(value: T) { override fun onChanged(t: T?) {
observer.onChanged(value) observer.onChanged(t)
removeObserver(this) removeObserver(this)
} }
}) })

View File

@ -23,24 +23,20 @@ object WorkerUtils {
inline fun scheduleNext(app: App, rescheduleIfFailedFound: Boolean = true, crossinline onReschedule: () -> Unit) { inline fun scheduleNext(app: App, rescheduleIfFailedFound: Boolean = true, crossinline onReschedule: () -> Unit) {
AsyncTask.execute { AsyncTask.execute {
val workManager = WorkManager.getInstance(app) as WorkManagerImpl val workManager = WorkManager.getInstance(app) as WorkManagerImpl
val scheduledWork = workManager.workDatabase.workSpecDao().getScheduledWork() as MutableList; val scheduledWork = workManager.workDatabase.workSpecDao().scheduledWork
scheduledWork.forEach { scheduledWork.forEach {
Utils.d("WorkerUtils", "Work: ${it.id} at ${it.calculateNextRunTime().formatDate()}. State = ${it.state} (finished = ${it.state.isFinished})") Utils.d("WorkerUtils", "Work: ${it.id} at ${(it.periodStartTime + it.initialDelay).formatDate()}. State = ${it.state} (finished = ${it.state.isFinished})")
} }
// remove finished work and other than SyncWorker // remove finished work and other than SyncWorker
scheduledWork.removeAll { it.workerClassName != SyncWorker::class.java.canonicalName || it.isPeriodic || it.state.isFinished } scheduledWork.removeAll { it.workerClassName != SyncWorker::class.java.canonicalName || it.isPeriodic || it.state.isFinished }
Utils.d("WorkerUtils", "Found ${scheduledWork.size} unfinished work") Utils.d("WorkerUtils", "Found ${scheduledWork.size} unfinished work")
// remove all enqueued work that had to (but didn't) run at some point in the past (at least 1min ago) // remove all enqueued work that had to (but didn't) run at some point in the past (at least 1min ago)
val failedWork = scheduledWork.filter { it.state == WorkInfo.State.ENQUEUED && it.calculateNextRunTime() < System.currentTimeMillis() - 1 * MINUTE * 1000 } val failedWork = scheduledWork.filter { it.state == WorkInfo.State.ENQUEUED && it.periodStartTime + it.initialDelay < System.currentTimeMillis() - 1 * MINUTE * 1000 }
Utils.d("WorkerUtils", "${failedWork.size} work requests failed to start (out of ${scheduledWork.size} requests)") Utils.d("WorkerUtils", "${failedWork.size} work requests failed to start (out of ${scheduledWork.size} requests)")
if (rescheduleIfFailedFound) { if (rescheduleIfFailedFound) {
if (failedWork.isNotEmpty()) { if (failedWork.isNotEmpty()) {
Utils.d("WorkerUtils", "App Manager detected!") Utils.d("WorkerUtils", "App Manager detected!")
EventBus.getDefault().postSticky(AppManagerDetectedEvent(failedWork.map { it.calculateNextRunTime() })) EventBus.getDefault().postSticky(AppManagerDetectedEvent(failedWork.map { it.periodStartTime + it.initialDelay }))
} }
if (scheduledWork.size - failedWork.size < 1) { if (scheduledWork.size - failedWork.size < 1) {
Utils.d("WorkerUtils", "No pending work found, scheduling next:") Utils.d("WorkerUtils", "No pending work found, scheduling next:")

View File

@ -10,8 +10,8 @@ import android.widget.FrameLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.github.tibolte.agendacalendarview.render.EventRenderer import com.github.tibolte.agendacalendarview.render.EventRenderer
import com.google.android.material.color.MaterialColors
import com.mikepenz.iconics.view.IconicsTextView import com.mikepenz.iconics.view.IconicsTextView
import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.databinding.AgendaWrappedEventBinding import pl.szczodrzynski.edziennik.databinding.AgendaWrappedEventBinding
import pl.szczodrzynski.edziennik.databinding.AgendaWrappedEventCompactBinding import pl.szczodrzynski.edziennik.databinding.AgendaWrappedEventCompactBinding
@ -47,24 +47,31 @@ class AgendaEventRenderer(
) { ) {
val event = aEvent.event val event = aEvent.event
val harmonizedColor = MaterialColors.harmonizeWithPrimary(card.context, event.eventColor) val textColor = Colors.legibleTextColor(event.eventColor)
val textColor = Colors.legibleTextColor(harmonizedColor)
val timeText = if (event.time == null) val timeText = if (event.time == null)
card.context.getString(R.string.agenda_event_all_day) card.context.getString(R.string.agenda_event_all_day)
else else
event.time!!.stringHM event.time!!.stringHM
val agendaSubjectImportant = App.profile.config.ui.agendaSubjectImportant
val eventSubtitle = listOfNotNull( val eventSubtitle = listOfNotNull(
timeText, timeText,
event.subjectLongName, event.subjectLongName.takeIf { !agendaSubjectImportant },
event.typeName.takeIf { agendaSubjectImportant },
event.teacherName, event.teacherName,
event.teamName event.teamName
).join(", ") ).join(", ")
card.foreground.setTintColor(harmonizedColor) card.foreground.setTintColor(event.eventColor)
card.background.setTintColor(harmonizedColor) card.background.setTintColor(event.eventColor)
manager.setEventTopic(title, event, doneIconColor = textColor) manager.setEventTopic(
title = title,
event = event,
doneIconColor = textColor,
showType = !agendaSubjectImportant,
showSubject = agendaSubjectImportant,
)
title.setTextColor(textColor) title.setTextColor(textColor)
subtitle?.text = eventSubtitle subtitle?.text = eventSubtitle
subtitle?.setTextColor(textColor) subtitle?.setTextColor(textColor)

View File

@ -17,6 +17,7 @@ import pl.szczodrzynski.edziennik.data.db.full.LessonFull
import pl.szczodrzynski.edziennik.databinding.TimetableLessonBinding import pl.szczodrzynski.edziennik.databinding.TimetableLessonBinding
import pl.szczodrzynski.edziennik.ext.* import pl.szczodrzynski.edziennik.ext.*
import pl.szczodrzynski.edziennik.utils.managers.NoteManager import pl.szczodrzynski.edziennik.utils.managers.NoteManager
import pl.szczodrzynski.navlib.getColorFromAttr
class LessonChangesAdapter( class LessonChangesAdapter(
val context: Context, val context: Context,
@ -63,9 +64,7 @@ class LessonChangesAdapter(
lesson.teacherName ?: "?" lesson.teacherName ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
if (lesson.teacherName == null) lesson.oldTeacherName?.let { add(it.asStrikethroughSpannable()) }
lesson.oldTeacherName?.let { add(it) }
else lesson.oldTeacherName?.let { add(it.asStrikethroughSpannable()) }
lesson.teacherName?.let { add(it) } lesson.teacherName?.let { add(it) }
}.concat(arrowRight) }.concat(arrowRight)
@ -74,9 +73,7 @@ class LessonChangesAdapter(
lesson.teamName ?: "?" lesson.teamName ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
if (lesson.teamName == null) lesson.oldTeamName?.let { add(it.asStrikethroughSpannable()) }
lesson.oldTeamName?.let { add(it) }
else lesson.oldTeamName?.let { add(it.asStrikethroughSpannable()) }
lesson.teamName?.let { add(it) } lesson.teamName?.let { add(it) }
}.concat(arrowRight) }.concat(arrowRight)
@ -85,9 +82,7 @@ class LessonChangesAdapter(
lesson.classroom ?: "?" lesson.classroom ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
if (lesson.classroom == null) lesson.oldClassroom?.let { add(it.asStrikethroughSpannable()) }
lesson.oldClassroom?.let { add(it) }
else lesson.oldClassroom?.let { add(it.asStrikethroughSpannable()) }
lesson.classroom?.let { add(it) } lesson.classroom?.let { add(it) }
}.concat(arrowRight) }.concat(arrowRight)
@ -114,11 +109,40 @@ class LessonChangesAdapter(
Lesson.TYPE_CANCELLED -> { Lesson.TYPE_CANCELLED -> {
b.annotationVisible = true b.annotationVisible = true
b.annotation.setText(R.string.timetable_lesson_cancelled) b.annotation.setText(R.string.timetable_lesson_cancelled)
b.annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_cancelled_color),
PorterDuff.Mode.SRC_ATOP
)
//lb.subjectName.typeface = Typeface.DEFAULT //lb.subjectName.typeface = Typeface.DEFAULT
} }
Lesson.TYPE_CHANGE -> { Lesson.TYPE_CHANGE -> {
b.annotationVisible = true b.annotationVisible = true
b.annotation.setText(R.string.timetable_lesson_change) when {
lesson.subjectId != lesson.oldSubjectId && lesson.teacherId != lesson.oldTeacherId
&& lesson.oldSubjectName != null && lesson.oldTeacherName != null ->
b.annotation.setText(
R.string.timetable_lesson_change_format,
"${lesson.oldSubjectName ?: "?"}, ${lesson.oldTeacherName ?: "?"}"
)
lesson.subjectId != lesson.oldSubjectId && lesson.oldSubjectName != null ->
b.annotation.setText(
R.string.timetable_lesson_change_format,
lesson.oldSubjectName ?: "?"
)
lesson.teacherId != lesson.oldTeacherId && lesson.oldTeacherName != null ->
b.annotation.setText(
R.string.timetable_lesson_change_format,
lesson.oldTeacherName ?: "?"
)
else -> b.annotation.setText(R.string.timetable_lesson_change)
}
b.annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_change_color),
PorterDuff.Mode.SRC_ATOP
)
} }
Lesson.TYPE_SHIFTED_SOURCE -> { Lesson.TYPE_SHIFTED_SOURCE -> {
b.annotationVisible = true b.annotationVisible = true
@ -138,6 +162,8 @@ class LessonChangesAdapter(
else -> b.annotation.setText(R.string.timetable_lesson_shifted) else -> b.annotation.setText(R.string.timetable_lesson_shifted)
} }
b.annotation.background.setTintColor(R.attr.timetable_lesson_shifted_source_color.resolveAttr(context))
} }
Lesson.TYPE_SHIFTED_TARGET -> { Lesson.TYPE_SHIFTED_TARGET -> {
b.annotationVisible = true b.annotationVisible = true
@ -157,6 +183,11 @@ class LessonChangesAdapter(
else -> b.annotation.setText(R.string.timetable_lesson_shifted_from) else -> b.annotation.setText(R.string.timetable_lesson_shifted_from)
} }
b.annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_shifted_target_color),
PorterDuff.Mode.SRC_ATOP
)
} }
} }
} }

View File

@ -7,7 +7,6 @@ package pl.szczodrzynski.edziennik.ui.agenda.lessonchanges
import android.view.View import android.view.View
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.github.tibolte.agendacalendarview.render.EventRenderer import com.github.tibolte.agendacalendarview.render.EventRenderer
import com.google.android.material.color.MaterialColors
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.databinding.AgendaCounterItemBinding import pl.szczodrzynski.edziennik.databinding.AgendaCounterItemBinding
import pl.szczodrzynski.edziennik.databinding.AgendaWrappedCounterBinding import pl.szczodrzynski.edziennik.databinding.AgendaWrappedCounterBinding
@ -19,11 +18,10 @@ class LessonChangesEventRenderer : EventRenderer<LessonChangesEvent>() {
override fun render(view: View, event: LessonChangesEvent) { override fun render(view: View, event: LessonChangesEvent) {
val b = AgendaWrappedCounterBinding.bind(view).item val b = AgendaWrappedCounterBinding.bind(view).item
val harmonizedColor = MaterialColors.harmonizeWithPrimary(view.context, event.color) val textColor = Colors.legibleTextColor(event.color)
val textColor = Colors.legibleTextColor(harmonizedColor)
b.card.foreground.setTintColor(harmonizedColor) b.card.foreground.setTintColor(event.color)
b.card.background.setTintColor(harmonizedColor) b.card.background.setTintColor(event.color)
b.name.setText(R.string.agenda_lesson_changes) b.name.setText(R.string.agenda_lesson_changes)
b.name.setTextColor(textColor) b.name.setTextColor(textColor)
b.count.text = event.count.toString() b.count.text = event.count.toString()
@ -37,10 +35,10 @@ class LessonChangesEventRenderer : EventRenderer<LessonChangesEvent>() {
} }
fun render(b: AgendaCounterItemBinding, event: LessonChangesEvent) { fun render(b: AgendaCounterItemBinding, event: LessonChangesEvent) {
val harmonizedColor = MaterialColors.harmonizeWithPrimary(b.root.context, event.color) val textColor = Colors.legibleTextColor(event.color)
val textColor = Colors.legibleTextColor(harmonizedColor)
b.card.foreground.setTintColor(harmonizedColor) b.card.foreground.setTintColor(event.color)
b.card.background.setTintColor(harmonizedColor) b.card.background.setTintColor(event.color)
b.name.setText(R.string.agenda_lesson_changes) b.name.setText(R.string.agenda_lesson_changes)
b.name.setTextColor(textColor) b.name.setTextColor(textColor)
b.count.text = event.count.toString() b.count.text = event.count.toString()

View File

@ -7,7 +7,6 @@ package pl.szczodrzynski.edziennik.ui.agenda.teacherabsence
import android.view.View import android.view.View
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.github.tibolte.agendacalendarview.render.EventRenderer import com.github.tibolte.agendacalendarview.render.EventRenderer
import com.google.android.material.color.MaterialColors
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.databinding.AgendaCounterItemBinding import pl.szczodrzynski.edziennik.databinding.AgendaCounterItemBinding
import pl.szczodrzynski.edziennik.databinding.AgendaWrappedCounterBinding import pl.szczodrzynski.edziennik.databinding.AgendaWrappedCounterBinding
@ -18,11 +17,10 @@ class TeacherAbsenceEventRenderer : EventRenderer<TeacherAbsenceEvent>() {
override fun render(view: View, event: TeacherAbsenceEvent) { override fun render(view: View, event: TeacherAbsenceEvent) {
val b = AgendaWrappedCounterBinding.bind(view).item val b = AgendaWrappedCounterBinding.bind(view).item
val harmonizedColor = MaterialColors.harmonizeWithPrimary(view.context, event.color) val textColor = Colors.legibleTextColor(event.color)
val textColor = Colors.legibleTextColor(harmonizedColor)
b.card.foreground.setTintColor(harmonizedColor) b.card.foreground.setTintColor(event.color)
b.card.background.setTintColor(harmonizedColor) b.card.background.setTintColor(event.color)
b.name.setText(R.string.agenda_teacher_absence) b.name.setText(R.string.agenda_teacher_absence)
b.name.setTextColor(textColor) b.name.setTextColor(textColor)
b.count.text = event.count.toString() b.count.text = event.count.toString()
@ -33,11 +31,10 @@ class TeacherAbsenceEventRenderer : EventRenderer<TeacherAbsenceEvent>() {
} }
fun render(b: AgendaCounterItemBinding, event: TeacherAbsenceEvent) { fun render(b: AgendaCounterItemBinding, event: TeacherAbsenceEvent) {
val harmonizedColor = MaterialColors.harmonizeWithPrimary(b.root.context, event.color) val textColor = Colors.legibleTextColor(event.color)
val textColor = Colors.legibleTextColor(harmonizedColor)
b.card.foreground.setTintColor(harmonizedColor) b.card.foreground.setTintColor(event.color)
b.card.background.setTintColor(harmonizedColor) b.card.background.setTintColor(event.color)
b.name.setText(R.string.agenda_teacher_absence) b.name.setText(R.string.agenda_teacher_absence)
b.name.setTextColor(textColor) b.name.setTextColor(textColor)
b.count.text = event.count.toString() b.count.text = event.count.toString()

View File

@ -66,7 +66,7 @@ class AttendanceBar : View {
} }
@SuppressLint("DrawAllocation", "CanvasSize") @SuppressLint("DrawAllocation", "CanvasSize")
override fun onDraw(canvas: Canvas) { override fun onDraw(canvas: Canvas?) {
canvas ?: return canvas ?: return
val sum = attendancesList.sumOf { it.count } val sum = attendancesList.sumOf { it.count }

View File

@ -0,0 +1,186 @@
package pl.szczodrzynski.edziennik.ui.behaviour;
import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.PopupMenu;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import pl.szczodrzynski.edziennik.App;
import pl.szczodrzynski.edziennik.MainActivity;
import pl.szczodrzynski.edziennik.R;
import pl.szczodrzynski.edziennik.data.db.entity.Notice;
import pl.szczodrzynski.edziennik.data.db.enums.MetadataType;
import pl.szczodrzynski.edziennik.data.db.full.NoticeFull;
import pl.szczodrzynski.edziennik.databinding.FragmentBehaviourBinding;
import pl.szczodrzynski.edziennik.utils.Themes;
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem;
public class BehaviourFragment extends Fragment {
private App app = null;
private MainActivity activity = null;
private FragmentBehaviourBinding b = null;
private int displayMode = MODE_YEAR;
private static final int MODE_YEAR = 0;
private static final int MODE_SEMESTER_1 = 1;
private static final int MODE_SEMESTER_2 = 2;
private List<NoticeFull> noticeList = null;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
activity = (MainActivity) getActivity();
if (getActivity() == null || getContext() == null)
return null;
app = (App) activity.getApplication();
getContext().getTheme().applyStyle(Themes.INSTANCE.getAppTheme(), true);
// activity, context and profile is valid
b = DataBindingUtil.inflate(inflater, R.layout.fragment_behaviour, container, false);
b.refreshLayout.setParent(activity.getSwipeRefreshLayout());
return b.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
if (app == null || activity == null || b == null || !isAdded())
return;
activity.getBottomSheet().prependItems(
new BottomSheetPrimaryItem(true)
.withTitle(R.string.menu_mark_as_read)
.withIcon(CommunityMaterial.Icon.cmd_eye_check_outline)
.withOnClickListener(v3 -> {
activity.getBottomSheet().close();
AsyncTask.execute(() -> App.Companion.getDb().metadataDao().setAllSeen(App.Companion.getProfileId(), MetadataType.NOTICE, true));
Toast.makeText(activity, R.string.main_menu_mark_as_read_success, Toast.LENGTH_SHORT).show();
})
);
/*b.refreshLayout.setOnRefreshListener(() -> {
activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_BEHAVIOUR, b.refreshLayout);
});*/
b.noticesSummaryTitle.setOnClickListener((v -> {
PopupMenu popupMenu = new PopupMenu(activity, b.noticesSummaryTitle, Gravity.END);
popupMenu.getMenu().add(0, 0, 0, R.string.summary_mode_year);
popupMenu.getMenu().add(0, 1, 1, R.string.summary_mode_semester_1);
popupMenu.getMenu().add(0, 2, 2, R.string.summary_mode_semester_2);
popupMenu.setOnMenuItemClickListener((item -> {
displayMode = item.getItemId();
updateList();
return true;
}));
popupMenu.show();
}));
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
b.noticesView.setHasFixedSize(true);
b.noticesView.setLayoutManager(linearLayoutManager);
b.noticesView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
if (recyclerView.canScrollVertically(-1)) {
b.refreshLayout.setEnabled(false);
}
if (!recyclerView.canScrollVertically(-1) && newState == SCROLL_STATE_IDLE) {
b.refreshLayout.setEnabled(true);
}
}
});
app.getDb().noticeDao().getAll(App.Companion.getProfileId()).observe(getViewLifecycleOwner(), notices -> {
if (app == null || activity == null || b == null || !isAdded())
return;
if (notices == null) {
b.noticesView.setVisibility(View.GONE);
b.noticesNoData.setVisibility(View.VISIBLE);
return;
}
noticeList = notices;
updateList();
});
}
private void updateList() {
int praisesCount = 0;
int warningsCount = 0;
int otherCount = 0;
List<NoticeFull> filteredList = new ArrayList<>();
for (NoticeFull notice: noticeList) {
if (displayMode != MODE_YEAR && notice.getSemester() != displayMode)
continue;
filteredList.add(notice);
switch (notice.getType()) {
case Notice.TYPE_POSITIVE:
praisesCount++;
break;
case Notice.TYPE_NEGATIVE:
warningsCount++;
break;
case Notice.TYPE_NEUTRAL:
otherCount++;
break;
}
}
if (filteredList.size() > 0) {
NoticesAdapter adapter;
b.noticesView.setVisibility(View.VISIBLE);
b.noticesNoData.setVisibility(View.GONE);
if ((adapter = (NoticesAdapter) b.noticesView.getAdapter()) != null) {
adapter.setNoticeList(filteredList);
adapter.notifyDataSetChanged();
}
else {
adapter = new NoticesAdapter(getContext(), filteredList);
b.noticesView.setAdapter(adapter);
}
}
else {
b.noticesView.setVisibility(View.GONE);
b.noticesNoData.setVisibility(View.VISIBLE);
}
if (displayMode == MODE_YEAR) {
b.noticesSummaryTitle.setText(getString(R.string.notices_summary_title_year));
}
else {
b.noticesSummaryTitle.setText(getString(R.string.notices_summary_title_semester_format, displayMode));
}
b.noticesPraisesCount.setText(String.format(Locale.getDefault(), "%d", praisesCount));
b.noticesWarningsCount.setText(String.format(Locale.getDefault(), "%d", warningsCount));
b.noticesOtherCount.setText(String.format(Locale.getDefault(), "%d", otherCount));
if (warningsCount >= 3) {
b.noticesWarningsCount.setTextColor(Color.RED);
}
else {
b.noticesWarningsCount.setTextColor(Themes.INSTANCE.getPrimaryTextColor(activity));
}
}
}

View File

@ -1,146 +0,0 @@
package pl.szczodrzynski.edziennik.ui.behaviour
import android.graphics.Color
import android.os.AsyncTask
import android.os.Bundle
import android.view.*
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.App.Companion.profileId
import pl.szczodrzynski.edziennik.MainActivity
import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.db.entity.Notice
import pl.szczodrzynski.edziennik.data.db.enums.MetadataType
import pl.szczodrzynski.edziennik.data.db.full.NoticeFull
import pl.szczodrzynski.edziennik.databinding.FragmentBehaviourBinding
import pl.szczodrzynski.edziennik.utils.Themes.getPrimaryTextColor
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem
import java.util.*
class BehaviourFragment : Fragment() {
private lateinit var app: App
private lateinit var activity: MainActivity
private lateinit var b: FragmentBehaviourBinding
private var displayMode = MODE_YEAR
private var noticeList: List<NoticeFull>? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
activity = (getActivity() as MainActivity?) ?: return null
context ?: return null
app = activity.application as App
b = DataBindingUtil.inflate(inflater, R.layout.fragment_behaviour, container, false)
b.refreshLayout.setParent(activity.swipeRefreshLayout)
return b.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
if (app == null || activity == null || b == null || !isAdded) return
activity.bottomSheet.prependItems(
BottomSheetPrimaryItem(true)
.withTitle(R.string.menu_mark_as_read)
.withIcon(CommunityMaterial.Icon.cmd_eye_check_outline)
.withOnClickListener { v3: View? ->
activity.bottomSheet.close()
AsyncTask.execute {
App.db.metadataDao().setAllSeen(profileId, MetadataType.NOTICE, true)
}
Toast.makeText(
activity,
R.string.main_menu_mark_as_read_success,
Toast.LENGTH_SHORT
).show()
}
)
b.toggleGroup.check(when (displayMode) {
0 -> R.id.allYear
1 -> R.id.semester1
2 -> R.id.semester2
else -> R.id.allYear
})
b.toggleGroup.addOnButtonCheckedListener { _, checkedId, isChecked ->
if (!isChecked)
return@addOnButtonCheckedListener
displayMode = when (checkedId) {
R.id.allYear -> 0
R.id.semester1 -> 1
R.id.semester2 -> 2
else -> 0
}
updateList()
}
/*b.refreshLayout.setOnRefreshListener(() -> {
activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_BEHAVIOUR, b.refreshLayout);
});*/
val linearLayoutManager = LinearLayoutManager(context)
b.noticesView.setHasFixedSize(true)
b.noticesView.layoutManager = linearLayoutManager
b.noticesView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
if (recyclerView.canScrollVertically(-1)) {
b.refreshLayout.isEnabled = false
}
if (!recyclerView.canScrollVertically(-1) && newState == RecyclerView.SCROLL_STATE_IDLE) {
b.refreshLayout.isEnabled = true
}
}
})
App.db.noticeDao().getAll(profileId).observe(viewLifecycleOwner) { notices: List<NoticeFull>? ->
if (app == null || activity == null || b == null || !isAdded) return@observe
if (notices == null) {
b.noticesView.visibility = View.GONE
b.noticesNoData.visibility = View.VISIBLE
return@observe
}
noticeList = notices
updateList()
}
}
private fun updateList() {
var praisesCount = 0
var warningsCount = 0
var otherCount = 0
val filteredList: MutableList<NoticeFull> = ArrayList()
for (notice in noticeList!!) {
if (displayMode != MODE_YEAR && notice.semester != displayMode) continue
filteredList.add(notice)
when (notice.type) {
Notice.TYPE_POSITIVE -> praisesCount++
Notice.TYPE_NEGATIVE -> warningsCount++
Notice.TYPE_NEUTRAL -> otherCount++
}
}
if (filteredList.size > 0) {
val adapter = NoticesAdapter(requireContext(), filteredList)
b.noticesView.visibility = View.VISIBLE
b.noticesNoData.visibility = View.GONE
b.noticesView.adapter = adapter
adapter.noticeList = filteredList
adapter.notifyDataSetChanged()
} else {
b.noticesView.visibility = View.GONE
b.noticesNoData.visibility = View.VISIBLE
}
b.noticesPraisesCount.text = String.format(Locale.getDefault(), "%d", praisesCount)
b.noticesWarningsCount.text = String.format(Locale.getDefault(), "%d", warningsCount)
b.noticesOtherCount.text = String.format(Locale.getDefault(), "%d", otherCount)
if (warningsCount >= 3) {
b.noticesWarningsCount.setTextColor(Color.RED)
} else {
b.noticesWarningsCount.setTextColor(getPrimaryTextColor(activity))
}
}
companion object {
private const val MODE_YEAR = 0
private const val MODE_SEMESTER_1 = 1
private const val MODE_SEMESTER_2 = 2
}
}

View File

@ -11,10 +11,8 @@ import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.cardview.widget.CardView import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.color.MaterialColors
import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.utils.colorInt
import com.mikepenz.iconics.utils.colorRes import com.mikepenz.iconics.utils.colorRes
import com.mikepenz.iconics.utils.sizeDp import com.mikepenz.iconics.utils.sizeDp
import eu.szkolny.font.SzkolnyFont import eu.szkolny.font.SzkolnyFont
@ -22,11 +20,9 @@ import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.db.entity.Notice import pl.szczodrzynski.edziennik.data.db.entity.Notice
import pl.szczodrzynski.edziennik.data.db.full.NoticeFull import pl.szczodrzynski.edziennik.data.db.full.NoticeFull
import pl.szczodrzynski.edziennik.ext.resolveColor
import pl.szczodrzynski.edziennik.utils.BetterLink import pl.szczodrzynski.edziennik.utils.BetterLink
import pl.szczodrzynski.edziennik.utils.Utils.bs import pl.szczodrzynski.edziennik.utils.Utils.bs
import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.models.Date
import pl.szczodrzynski.navlib.getColorFromAttr
class NoticesAdapter//getting the context and product list with constructor class NoticesAdapter//getting the context and product list with constructor
(private val context: Context, var noticeList: List<NoticeFull>) : RecyclerView.Adapter<NoticesAdapter.ViewHolder>() { (private val context: Context, var noticeList: List<NoticeFull>) : RecyclerView.Adapter<NoticesAdapter.ViewHolder>() {
@ -45,19 +41,9 @@ class NoticesAdapter//getting the context and product list with constructor
if (app.data.uiConfig.enableNoticePoints && false) { if (app.data.uiConfig.enableNoticePoints && false) {
holder.noticesItemReason.text = bs(null, notice.category, "\n") + notice.text holder.noticesItemReason.text = bs(null, notice.category, "\n") + notice.text
if (notice.teacherName != null || notice.points != null) { holder.noticesItemTeacherName.text = app.getString(R.string.notices_points_format, notice.teacherName, if (notice.points ?: 0f > 0) "+" + notice.points else notice.points)
holder.noticesItemTeacherName.visibility = View.VISIBLE } else {
holder.noticesItemTeacherName.text = app.getString(
R.string.notices_points_format,
notice.teacherName,
if (notice.points ?: 0f > 0) "+" + notice.points else notice.points
)
}} else {
holder.noticesItemReason.text = notice.text holder.noticesItemReason.text = notice.text
if (notice.teacherName != null) {
holder.noticesItemTeacherName.visibility = View.VISIBLE
holder.noticesItemTeacherName.text = notice.teacherName
}
holder.noticesItemTeacherName.text = notice.teacherName holder.noticesItemTeacherName.text = notice.teacherName
} }
holder.noticesItemAddedDate.text = Date.fromMillis(notice.addedDate).formattedString holder.noticesItemAddedDate.text = Date.fromMillis(notice.addedDate).formattedString
@ -65,21 +51,21 @@ class NoticesAdapter//getting the context and product list with constructor
if (notice.type == Notice.TYPE_POSITIVE) { if (notice.type == Notice.TYPE_POSITIVE) {
holder.noticesItemType.setImageDrawable( holder.noticesItemType.setImageDrawable(
IconicsDrawable(context, CommunityMaterial.Icon3.cmd_plus_circle_outline).apply { IconicsDrawable(context, CommunityMaterial.Icon3.cmd_plus_circle_outline).apply {
colorInt = MaterialColors.harmonizeWithPrimary(context, R.color.md_green_600.resolveColor(context)) colorRes = R.color.md_green_600
sizeDp = 36 sizeDp = 36
} }
) )
} else if (notice.type == Notice.TYPE_NEGATIVE) { } else if (notice.type == Notice.TYPE_NEGATIVE) {
holder.noticesItemType.setImageDrawable( holder.noticesItemType.setImageDrawable(
IconicsDrawable(context, CommunityMaterial.Icon.cmd_alert_decagram_outline).apply { IconicsDrawable(context, CommunityMaterial.Icon.cmd_alert_decagram_outline).apply {
colorInt = MaterialColors.harmonizeWithPrimary(context, R.color.md_red_600.resolveColor(context)) colorRes = R.color.md_red_600
sizeDp = 36 sizeDp = 36
} }
) )
} else { } else {
holder.noticesItemType.setImageDrawable( holder.noticesItemType.setImageDrawable(
IconicsDrawable(context, SzkolnyFont.Icon.szf_message_processing_outline).apply { IconicsDrawable(context, SzkolnyFont.Icon.szf_message_processing_outline).apply {
colorInt = MaterialColors.harmonizeWithPrimary(context, R.color.md_blue_500.resolveColor(context)) colorRes = R.color.md_blue_500
sizeDp = 36 sizeDp = 36
} }
) )

View File

@ -129,7 +129,7 @@ class LabProfileFragment : LazyFragment(), CoroutineScope {
is String -> input is String -> input
is Long -> input.toLong() is Long -> input.toLong()
is Double -> input.toDouble() is Double -> input.toDouble()
is Enum<*> -> input.toInt().toEnum(objVal::class.java) as Enum is Enum<*> -> input.toInt().toEnum(objVal::class.java)
else -> input else -> input
} }
field.set(parent, newVal) field.set(parent, newVal)

View File

@ -46,7 +46,7 @@ class ProfileConfigDialog(
activity, activity,
null, null,
R.attr.alertDialogStyle, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_Material3 R.style.MaterialAlertDialog_MaterialComponents
) )
val surface = MaterialColors.getColor(activity, R.attr.colorSurface, TAG) val surface = MaterialColors.getColor(activity, R.attr.colorSurface, TAG)
shape.setCornerSize(18.dp.toFloat()) shape.setCornerSize(18.dp.toFloat())

View File

@ -14,7 +14,6 @@ import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.google.android.material.color.MaterialColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import kotlinx.coroutines.* import kotlinx.coroutines.*
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
@ -112,7 +111,7 @@ class EventDetailsDialog(
manager.setLegendText(b.legend, event, showNotes) manager.setLegendText(b.legend, event, showNotes)
b.typeColor.background?.setTintColor(MaterialColors.harmonizeWithPrimary(b.root.context, event.eventColor)) b.typeColor.background?.setTintColor(event.eventColor)
val agendaSubjectImportant = event.subjectLongName != null val agendaSubjectImportant = event.subjectLongName != null
&& App.config[event.profileId].ui.agendaSubjectImportant && App.config[event.profileId].ui.agendaSubjectImportant

View File

@ -10,7 +10,6 @@ import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE import androidx.appcompat.app.AlertDialog.BUTTON_POSITIVE
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.color.MaterialColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.jaredrummler.android.colorpicker.ColorPickerDialog import com.jaredrummler.android.colorpicker.ColorPickerDialog
import com.jaredrummler.android.colorpicker.ColorPickerDialogListener import com.jaredrummler.android.colorpicker.ColorPickerDialogListener
@ -352,7 +351,7 @@ class EventManualDialog(
selectDefault(defaultType) selectDefault(defaultType)
onTypeSelected = { onTypeSelected = {
b.typeColor.background.setTintColor(MaterialColors.harmonizeWithPrimary(b.root.context, it.color)) b.typeColor.background.setTintColor(it.color)
customColor = null customColor = null
} }
} }

View File

@ -9,7 +9,6 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.color.MaterialColors
import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.db.full.EventFull import pl.szczodrzynski.edziennik.data.db.full.EventFull
@ -113,7 +112,7 @@ class EventViewHolder(
b.attachmentIcon.isVisible = item.hasAttachments b.attachmentIcon.isVisible = item.hasAttachments
b.typeColor.background?.setTintColor(MaterialColors.harmonizeWithPrimary(b.root.context, item.eventColor)) b.typeColor.background?.setTintColor(item.eventColor)
b.typeColor.isVisible = adapter.showTypeColor b.typeColor.isVisible = adapter.showTypeColor
b.editButton.isVisible = !adapter.simpleMode b.editButton.isVisible = !adapter.simpleMode

View File

@ -39,7 +39,7 @@ class GradeDetailsDialog(
override suspend fun onShow() { override suspend fun onShow() {
val manager = app.gradesManager val manager = app.gradesManager
val gradeColor = manager.getGradeColor(b.root.context, grade) val gradeColor = manager.getGradeColor(grade)
b.grade = grade b.grade = grade
b.weightText = manager.getWeightString(app, grade) b.weightText = manager.getWeightString(app, grade)
b.commentVisible = false b.commentVisible = false

View File

@ -15,7 +15,6 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.appcompat.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
import androidx.core.graphics.ColorUtils import androidx.core.graphics.ColorUtils
import com.google.android.material.color.MaterialColors
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.db.entity.Grade import pl.szczodrzynski.edziennik.data.db.entity.Grade
import pl.szczodrzynski.edziennik.data.db.entity.Grade.Companion.TYPE_SEMESTER1_FINAL import pl.szczodrzynski.edziennik.data.db.entity.Grade.Companion.TYPE_SEMESTER1_FINAL
@ -48,7 +47,7 @@ class GradeView : AppCompatTextView {
val gradeName = grade.name val gradeName = grade.name
val gradeColor = manager.getGradeColor(context, grade) val gradeColor = manager.getGradeColor(grade)
text = when { text = when {
periodGradesTextual -> when (grade.type) { periodGradesTextual -> when (grade.type) {

View File

@ -136,7 +136,6 @@ class HomeFragment : Fragment(), CoroutineScope {
Toast.makeText(activity, R.string.main_menu_mark_as_read_success, Toast.LENGTH_SHORT).show() Toast.makeText(activity, R.string.main_menu_mark_as_read_success, Toast.LENGTH_SHORT).show()
}) })
) )
b.configureCards.onClick { b.configureCards.onClick {
HomeConfigDialog(activity, reloadOnDismiss = true).show() HomeConfigDialog(activity, reloadOnDismiss = true).show()
} }
@ -169,78 +168,56 @@ class HomeFragment : Fragment(), CoroutineScope {
else -> null else -> null
} as HomeCard? } as HomeCard?
} }
//if (App.devMode) //if (App.devMode)
// items += HomeDebugCard(100, app, activity, this, app.profile) // items += HomeDebugCard(100, app, activity, this, app.profile)
if (app.profile.archived) if (app.profile.archived)
items.add(0, HomeArchiveCard(101, app, activity, this, app.profile)) items.add(0, HomeArchiveCard(101, app, activity, this, app.profile))
val status = app.availabilityManager.check(app.profile, cacheOnly = true)?.status val status = app.availabilityManager.check(app.profile, cacheOnly = true)?.status
val lockLayout = app.config.ui.lockLayout
val update = app.config.update val update = app.config.update
if (update != null && update.versionCode > BuildConfig.VERSION_CODE || status?.userMessage != null) { if (update != null && update.versionCode > BuildConfig.VERSION_CODE || status?.userMessage != null) {
items.add(0, HomeAvailabilityCard(102, app, activity, this, app.profile)) items.add(0, HomeAvailabilityCard(102, app, activity, this, app.profile))
} }
val adapter = HomeCardAdapter(items) val adapter = HomeCardAdapter(items)
b.list.adapter = adapter val itemTouchHelper = ItemTouchHelper(CardItemTouchHelperCallback(adapter, b.refreshLayout))
b.list.layoutManager = LinearLayoutManager(activity)
val itemTouchHelper =
ItemTouchHelper(CardItemTouchHelperCallback(adapter, b.refreshLayout))
adapter.itemTouchHelper = itemTouchHelper adapter.itemTouchHelper = itemTouchHelper
b.list.layoutManager = LinearLayoutManager(activity)
if (!lockLayout) { b.list.adapter = adapter
b.list.setAccessibilityDelegateCompat(object : b.list.setAccessibilityDelegateCompat(object : RecyclerViewAccessibilityDelegate(b.list) {
RecyclerViewAccessibilityDelegate(b.list) { override fun getItemDelegate(): AccessibilityDelegateCompat {
override fun getItemDelegate(): AccessibilityDelegateCompat { return object : ItemDelegate(this) {
return object : ItemDelegate(this) { override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfoCompat) {
override fun onInitializeAccessibilityNodeInfo( super.onInitializeAccessibilityNodeInfo(host, info)
host: View, val position: Int = b.list.getChildLayoutPosition(host)
info: AccessibilityNodeInfoCompat if (position != 0) {
) { info.addAction(AccessibilityActionCompat(
super.onInitializeAccessibilityNodeInfo(host, info) R.id.move_card_up_action,
val position: Int = b.list.getChildLayoutPosition(host) host.resources.getString(R.string.card_action_move_up)
if (position != 0) { ))
info.addAction(
AccessibilityActionCompat(
R.id.move_card_up_action,
host.resources.getString(R.string.card_action_move_up)
)
)
}
if (position != adapter.itemCount - 1) {
info.addAction(
AccessibilityActionCompat(
R.id.move_card_down_action,
host.resources.getString(R.string.card_action_move_down)
)
)
}
} }
if (position != adapter.itemCount - 1) {
override fun performAccessibilityAction( info.addAction(AccessibilityActionCompat(
host: View, R.id.move_card_down_action,
action: Int, host.resources.getString(R.string.card_action_move_down)
args: Bundle? ))
): Boolean {
val fromPosition: Int = b.list.getChildLayoutPosition(host)
if (action == R.id.move_card_down_action) {
swapCards(fromPosition, fromPosition + 1, adapter)
return true
} else if (action == R.id.move_card_up_action) {
swapCards(fromPosition, fromPosition - 1, adapter)
return true
}
return super.performAccessibilityAction(host, action, args)
} }
} }
}
})
itemTouchHelper.attachToRecyclerView(b.list) override fun performAccessibilityAction(host: View, action: Int, args: Bundle?): Boolean {
} val fromPosition: Int = b.list.getChildLayoutPosition(host)
if (action == R.id.move_card_down_action) {
swapCards(fromPosition, fromPosition + 1, adapter)
return true
} else if (action == R.id.move_card_up_action) {
swapCards(fromPosition, fromPosition - 1, adapter)
return true
}
return super.performAccessibilityAction(host, action, args)
}
}
}
})
itemTouchHelper.attachToRecyclerView(b.list)
} }
} }

View File

@ -63,7 +63,7 @@ class HomeLuckyNumberCard(
R.string.home_lucky_number_details_click_to_set R.string.home_lucky_number_details_click_to_set
else else
R.string.home_lucky_number_details R.string.home_lucky_number_details
b.subText.setText(subTextRes, profile.studentNumber) b.subText.setText(subTextRes, profile.name, profile.studentNumber)
app.db.luckyNumberDao().getNearestFuture(profile.id, today).observe(fragment, Observer { luckyNumber -> app.db.luckyNumberDao().getNearestFuture(profile.id, today).observe(fragment, Observer { luckyNumber ->
val isYours = luckyNumber?.number == profile.studentNumber val isYours = luckyNumber?.number == profile.studentNumber
@ -94,7 +94,7 @@ class HomeLuckyNumberCard(
!isYours -> R.drawable.emoji_smiling !isYours -> R.drawable.emoji_smiling
else -> R.drawable.emoji_no_face else -> R.drawable.emoji_no_face
} }
b.image.setIconResource(drawableRes) b.image.setImageResource(drawableRes)
}) })
holder.root.onClick { holder.root.onClick {
@ -104,7 +104,7 @@ class HomeLuckyNumberCard(
R.string.home_lucky_number_details_click_to_set R.string.home_lucky_number_details_click_to_set
else else
R.string.home_lucky_number_details R.string.home_lucky_number_details
b.subText.setText(newSubTextRes, profile.studentNumber) b.subText.setText(newSubTextRes, profile.name, profile.studentNumber)
}) })
} }
}} }}

View File

@ -93,18 +93,24 @@ class HomeTimetableCard(
b.settings.setImageDrawable( b.settings.setImageDrawable(
IconicsDrawable(activity, CommunityMaterial.Icon.cmd_cog_outline).apply { IconicsDrawable(activity, CommunityMaterial.Icon.cmd_cog_outline).apply {
colorAttr(activity, R.attr.colorOnPrimaryContainer) colorAttr(activity, R.attr.colorIcon)
sizeDp = 24 sizeDp = 24
} }
) )
b.bellSync.icon = IconicsDrawable(activity, SzkolnyFont.Icon.szf_alarm_bell_outline).apply { b.bellSync.setImageDrawable(
sizeDp = 24 IconicsDrawable(activity, SzkolnyFont.Icon.szf_alarm_bell_outline).apply {
} colorAttr(activity, R.attr.colorIcon)
sizeDp = 24
}
)
b.showCounter.icon = IconicsDrawable(activity, CommunityMaterial.Icon2.cmd_fullscreen).apply { b.showCounter.setImageDrawable(
sizeDp = 24 IconicsDrawable(activity, CommunityMaterial.Icon2.cmd_fullscreen).apply {
} colorAttr(activity, R.attr.colorIcon)
sizeDp = 24
}
)
b.bellSync.setOnClickListener { b.bellSync.setOnClickListener {
BellSyncTimeChooseDialog( BellSyncTimeChooseDialog(
@ -261,11 +267,9 @@ class HomeTimetableCard(
R.string.home_timetable_lesson_not_started R.string.home_timetable_lesson_not_started
b.lessonBig.setText(lessonRes, firstLesson.subjectSpannable) b.lessonBig.setText(lessonRes, firstLesson.subjectSpannable)
firstLesson?.displayClassroom?.let { firstLesson?.displayClassroom?.let {
b.classroomHeading.visibility = View.VISIBLE
b.classroom.visibility = View.VISIBLE b.classroom.visibility = View.VISIBLE
b.classroom.text = it b.classroom.text = it
} ?: run { } ?: run {
b.classroomHeading.visibility = View.GONE
b.classroom.visibility = View.GONE b.classroom.visibility = View.GONE
} }
@ -307,11 +311,9 @@ class HomeTimetableCard(
b.counter.visibility = View.VISIBLE b.counter.visibility = View.VISIBLE
b.counter.text = firstLesson?.displayStartTime?.stringHM b.counter.text = firstLesson?.displayStartTime?.stringHM
firstLesson?.displayClassroom?.let { firstLesson?.displayClassroom?.let {
b.classroomHeading.visibility = View.VISIBLE
b.classroom.visibility = View.VISIBLE b.classroom.visibility = View.VISIBLE
b.classroom.text = it b.classroom.text = it
} ?: run { } ?: run {
b.classroomHeading.visibility = View.GONE
b.classroom.visibility = View.GONE b.classroom.visibility = View.GONE
} }
@ -332,7 +334,7 @@ class HomeTimetableCard(
for (lesson in nextLessons) { for (lesson in nextLessons) {
text += listOf( text += listOf(
adjustTimeWidth(lesson.displayStartTime?.stringHM), lesson.displayStartTime?.stringHM,
lesson.subjectSpannable lesson.subjectSpannable
).concat(" ") ).concat(" ")
} }
@ -341,12 +343,6 @@ class HomeTimetableCard(
b.nextLessons.text = text.concat("\n") b.nextLessons.text = text.concat("\n")
}} }}
private fun adjustTimeWidth(time: String?) = when {
time == null -> ""
time.length == 4 -> " $time "
else -> "$time "
}
private val LessonFull?.subjectSpannable: CharSequence private val LessonFull?.subjectSpannable: CharSequence
get() = if (this == null) "?" else when { get() = if (this == null) "?" else when {
hasReplacingNotes() -> getNoteSubstituteText(showNotes = true) ?: "?" hasReplacingNotes() -> getNoteSubstituteText(showNotes = true) ?: "?"
@ -401,7 +397,7 @@ class HomeTimetableCard(
if (diff >= 60 * MINUTE) if (diff >= 60 * MINUTE)
b.counter.text = counterStart.stringHM b.counter.text = counterStart.stringHM
else else
b.counter.text = activity.timeTill(diff.toInt(), " ", countInSeconds) b.counter.text = activity.timeTill(diff.toInt(), "\n", countInSeconds)
} }
else { else {
// the lesson is right now // the lesson is right now
@ -410,7 +406,7 @@ class HomeTimetableCard(
val lessonLength = counterEnd - counterStart val lessonLength = counterEnd - counterStart
val timePassed = now - counterStart val timePassed = now - counterStart
val timeLeft = counterEnd - now val timeLeft = counterEnd - now
b.counter.text = activity.timeLeft(timeLeft.toInt(), " ", countInSeconds) b.counter.text = activity.timeLeft(timeLeft.toInt(), "\n", countInSeconds)
b.progress.max = lessonLength.toInt() b.progress.max = lessonLength.toInt()
b.progress.progress = timePassed.toInt() b.progress.progress = timePassed.toInt()
} }

View File

@ -46,7 +46,6 @@ class LoginActivity : AppCompatActivity(), CoroutineScope {
fun getRootView() = b.root fun getRootView() = b.root
@Deprecated("Deprecated in Java")
override fun onBackPressed() { override fun onBackPressed() {
val destination = nav.currentDestination ?: run { val destination = nav.currentDestination ?: run {
nav.navigateUp() nav.navigateUp()
@ -87,7 +86,7 @@ class LoginActivity : AppCompatActivity(), CoroutineScope {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setTheme(R.style.AppTheme_Dark) setTheme(R.style.AppTheme_Light)
navOptionsBuilder = NavOptions.Builder() navOptionsBuilder = NavOptions.Builder()
.setEnterAnim(R.anim.slide_in_right) .setEnterAnim(R.anim.slide_in_right)

View File

@ -228,7 +228,7 @@ class LoginFormFragment : Fragment(), CoroutineScope {
val qrDecoderClass = credential.qrDecoderClass ?: return val qrDecoderClass = credential.qrDecoderClass ?: return
app.permissionManager.requestCameraPermission(activity, R.string.permissions_qr_scanner) { app.permissionManager.requestCameraPermission(activity, R.string.permissions_qr_scanner) {
QrScannerDialog(activity, onCodeScanned = { code -> QrScannerDialog(activity, onCodeScanned = { code ->
val decoder = qrDecoderClass.getDeclaredConstructor().newInstance() val decoder = qrDecoderClass.newInstance()
val values = decoder.decode(code) val values = decoder.decode(code)
if (values == null) { if (values == null) {
Toast.makeText(activity, R.string.login_qr_decoding_error, Toast.LENGTH_SHORT).show() Toast.makeText(activity, R.string.login_qr_decoding_error, Toast.LENGTH_SHORT).show()

View File

@ -4,7 +4,6 @@
package pl.szczodrzynski.edziennik.ui.messages.list package pl.szczodrzynski.edziennik.ui.messages.list
import android.graphics.Typeface
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -22,7 +21,6 @@ import pl.szczodrzynski.edziennik.ui.grades.viewholder.BindableViewHolder
import pl.szczodrzynski.edziennik.ui.messages.MessagesUtils import pl.szczodrzynski.edziennik.ui.messages.MessagesUtils
import pl.szczodrzynski.edziennik.utils.managers.NoteManager import pl.szczodrzynski.edziennik.utils.managers.NoteManager
import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.models.Date
import pl.szczodrzynski.navlib.getColorFromAttr
class MessageViewHolder( class MessageViewHolder(
inflater: LayoutInflater, inflater: LayoutInflater,
@ -46,19 +44,15 @@ class MessageViewHolder(
b.messageBody.text = item.bodyHtml?.take(200) b.messageBody.text = item.bodyHtml?.take(200)
val isRead = item.isSent || item.isDraft || item.seen val isRead = item.isSent || item.isDraft || item.seen
val typeface = if (isRead) adapter.typefaceNormal else adapter.typefaceBold val typeface = if (isRead) adapter.typefaceNormal else adapter.typefaceBold
val textColor = if (isRead) getColorFromAttr(b.root.context, R.attr.colorOnSurfaceVariant) else getColorFromAttr(b.root.context, R.attr.colorOnSurface) val style = if (isRead) R.style.NavView_TextView_Small else R.style.NavView_TextView_Normal
// set text styles // set text styles
b.messageSender.setTextAppearance(activity, style)
b.messageSender.typeface = typeface b.messageSender.typeface = typeface
b.messageSender.setTextColor(textColor) b.messageSubject.setTextAppearance(activity, style)
b.messageSubject.typeface = typeface b.messageSubject.typeface = typeface
b.messageSubject.setTextColor(textColor) b.messageDate.setTextAppearance(activity, style)
b.messageDate.typeface = typeface b.messageDate.typeface = typeface
b.messageDate.setTextColor(textColor)
if (adapter.onStarClick == null) { if (adapter.onStarClick == null) {
b.messageStar.isVisible = false b.messageStar.isVisible = false

View File

@ -14,7 +14,6 @@ import androidx.fragment.app.Fragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.iconics.utils.sizeDp import com.mikepenz.iconics.utils.sizeDp
import kotlinx.coroutines.* import kotlinx.coroutines.*
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
@ -96,6 +95,27 @@ class MessageFragment : Fragment(), CoroutineScope {
it.maxLines = if (it.maxLines == 30) 2 else 30 it.maxLines = if (it.maxLines == 30) 2 else 30
} }
val replyDrawable = IconicsDrawable(activity, CommunityMaterial.Icon3.cmd_reply_outline).apply {
sizeDp = 24
colorAttr(activity, android.R.attr.textColorPrimary)
}
val forwardDrawable = IconicsDrawable(activity, CommunityMaterial.Icon.cmd_arrow_right).apply {
sizeDp = 24
colorAttr(activity, android.R.attr.textColorPrimary)
}
val deleteDrawable = IconicsDrawable(activity, CommunityMaterial.Icon.cmd_delete_outline).apply {
sizeDp = 24
colorAttr(activity, android.R.attr.textColorPrimary)
}
val downloadDrawable = IconicsDrawable(activity, CommunityMaterial.Icon.cmd_download_outline).apply {
sizeDp = 24
colorAttr(activity, android.R.attr.textColorPrimary)
}
b.replyButton.setCompoundDrawables(null, replyDrawable, null, null)
b.forwardButton.setCompoundDrawables(null, forwardDrawable, null, null)
b.deleteButton.setCompoundDrawables(null, deleteDrawable, null, null)
b.downloadButton.setCompoundDrawables(null, downloadDrawable, null, null)
b.messageStar.onClick { b.messageStar.onClick {
launch { launch {
manager.starMessage(message, !message.isStarred) manager.starMessage(message, !message.isStarred)
@ -198,6 +218,20 @@ class MessageFragment : Fragment(), CoroutineScope {
b.replyButton.isVisible = message.isReceived || message.isDeleted b.replyButton.isVisible = message.isReceived || message.isDeleted
b.deleteButton.isVisible = message.isReceived b.deleteButton.isVisible = message.isReceived
if (message.isReceived || message.isDeleted) {
activity.navView.apply {
bottomBar.apply {
fabEnable = true
fabExtendedText = getString(R.string.messages_reply)
fabIcon = CommunityMaterial.Icon3.cmd_reply_outline
}
setFabOnClickListener {
b.replyButton.performClick()
}
}
activity.gainAttentionFAB()
}
val messageRecipients = StringBuilder("<ul>") val messageRecipients = StringBuilder("<ul>")
message.recipients?.forEach { recipient -> message.recipients?.forEach { recipient ->

View File

@ -26,8 +26,15 @@ fun MaterialButton.setupNotesButton(
) { ) {
if (!isVisible) if (!isVisible)
return return
icon = IconicsDrawable(activity, CommunityMaterial.Icon3.cmd_playlist_edit)
setText(R.string.notes_button) setText(R.string.notes_button)
iconPadding = 8.dp
iconSize = 24.dp
updateLayoutParams<LinearLayout.LayoutParams> {
gravity = Gravity.CENTER_HORIZONTAL
}
updatePadding(left = 12.dp)
onClick { onClick {
NoteListDialog( NoteListDialog(

View File

@ -5,7 +5,6 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.utils.colorInt
import com.mikepenz.iconics.utils.colorRes import com.mikepenz.iconics.utils.colorRes
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -16,7 +15,6 @@ import pl.szczodrzynski.edziennik.data.db.entity.Notification
import pl.szczodrzynski.edziennik.databinding.NotificationsListItemBinding import pl.szczodrzynski.edziennik.databinding.NotificationsListItemBinding
import pl.szczodrzynski.edziennik.ext.* import pl.szczodrzynski.edziennik.ext.*
import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.models.Date
import pl.szczodrzynski.navlib.getColorFromAttr
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
class NotificationsAdapter( class NotificationsAdapter(
@ -50,7 +48,7 @@ class NotificationsAdapter(
val colorSecondary = android.R.attr.textColorSecondary.resolveAttr(activity) val colorSecondary = android.R.attr.textColorSecondary.resolveAttr(activity)
b.notificationIcon.background = IconicsDrawable(app, item.type.icon).apply { b.notificationIcon.background = IconicsDrawable(app, item.type.icon).apply {
colorInt = getColorFromAttr(b.root.context, R.attr.colorPrimary) colorRes = R.color.colorPrimary
} }
b.title.text = item.text b.title.text = item.text

View File

@ -32,9 +32,9 @@ class SettingsLicenseActivity : MaterialAboutActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTheme( setTheme(
if (Themes.isDark) if (Themes.isDark)
R.style.Theme_Material3_Dark R.style.Theme_MaterialComponents
else else
R.style.Theme_Material3_Light R.style.Theme_MaterialComponents_Light
) )
foregroundColor = if (Themes.isDark) foregroundColor = if (Themes.isDark)
R.color.primaryTextDark.resolveColor(this) R.color.primaryTextDark.resolveColor(this)

View File

@ -17,7 +17,6 @@ import pl.szczodrzynski.edziennik.data.db.entity.Profile
import pl.szczodrzynski.edziennik.ext.after import pl.szczodrzynski.edziennik.ext.after
import pl.szczodrzynski.edziennik.utils.Colors import pl.szczodrzynski.edziennik.utils.Colors
import pl.szczodrzynski.edziennik.utils.Themes import pl.szczodrzynski.edziennik.utils.Themes
import pl.szczodrzynski.edziennik.utils.Utils
class SettingsUtil( class SettingsUtil(
val activity: MainActivity, val activity: MainActivity,

View File

@ -20,8 +20,6 @@ import pl.szczodrzynski.edziennik.BuildConfig
import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update
import pl.szczodrzynski.edziennik.ext.after import pl.szczodrzynski.edziennik.ext.after
import pl.szczodrzynski.edziennik.ext.resolveAttr
import pl.szczodrzynski.edziennik.sync.UpdateWorker
import pl.szczodrzynski.edziennik.ui.dialogs.ChangelogDialog import pl.szczodrzynski.edziennik.ui.dialogs.ChangelogDialog
import pl.szczodrzynski.edziennik.ui.settings.SettingsCard import pl.szczodrzynski.edziennik.ui.settings.SettingsCard
import pl.szczodrzynski.edziennik.ui.settings.SettingsLicenseActivity import pl.szczodrzynski.edziennik.ui.settings.SettingsLicenseActivity
@ -41,13 +39,13 @@ class SettingsAboutCard(util: SettingsUtil) : SettingsCard(util), CoroutineScope
MediaPlayer.create(activity, R.raw.ogarnij_sie) MediaPlayer.create(activity, R.raw.ogarnij_sie)
} }
override fun buildCard(): MaterialAboutCard = override fun buildCard() = util.createCard(
util.createCard( null,
null, items = ::getItems,
items = ::getItems, itemsMore = ::getItemsMore,
itemsMore = ::getItemsMore, backgroundColor = 0xff1976d2.toInt(),
backgroundColor = R.attr.colorPrimaryContainer.resolveAttr(activity) theme = R.style.AppTheme_Dark
) )
private val versionDetailsItem by lazy { private val versionDetailsItem by lazy {
util.createActionItem( util.createActionItem(

View File

@ -74,16 +74,6 @@ class SettingsThemeCard(util: SettingsUtil) : SettingsCard(util) {
) { _, it -> ) { _, it ->
configGlobal.ui.miniMenuVisible = it configGlobal.ui.miniMenuVisible = it
activity.navView.drawer.miniDrawerVisiblePortrait = it activity.navView.drawer.miniDrawerVisiblePortrait = it
},
util.createPropertyItem(
text = R.string.settings_ui_lock_layout_text,
subText = R.string.settings_ui_lock_layout_subtext,
icon = CommunityMaterial.Icon.cmd_axis_lock,
value = configGlobal.ui.lockLayout
) { _, it ->
configGlobal.ui.lockLayout = it
activity.recreate()
} }
) )

View File

@ -388,9 +388,7 @@ class GenerateBlockTimetableDialog(
try { try {
val uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values) ?: return@withContext null val uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values) ?: return@withContext null
resolver.openOutputStream(uri).use { resolver.openOutputStream(uri).use {
if (it != null) { bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
}
} }
uri uri
} catch (e: Exception) { } catch (e: Exception) {

View File

@ -49,6 +49,7 @@ class LessonDetailsDialog(
DialogLessonDetailsBinding.inflate(layoutInflater) DialogLessonDetailsBinding.inflate(layoutInflater)
override fun getPositiveButtonText() = R.string.close override fun getPositiveButtonText() = R.string.close
override fun getNeutralButtonText() = R.string.add
private lateinit var adapter: EventListAdapter private lateinit var adapter: EventListAdapter
private val manager private val manager
@ -56,7 +57,7 @@ class LessonDetailsDialog(
private val attendanceManager private val attendanceManager
get() = app.attendanceManager get() = app.attendanceManager
fun openAddEventDialog(): Boolean { override suspend fun onNeutralClick(): Boolean {
EventManualDialog( EventManualDialog(
activity, activity,
lesson.profileId, lesson.profileId,
@ -226,8 +227,6 @@ class LessonDetailsDialog(
addItemDecoration(SimpleDividerItemDecoration(context)) addItemDecoration(SimpleDividerItemDecoration(context))
} }
} }
@Suppress("NotifyDataSetChanged")
adapter.notifyDataSetChanged() adapter.notifyDataSetChanged()
if (events != null && events.isNotEmpty()) { if (events != null && events.isNotEmpty()) {
@ -253,7 +252,6 @@ class LessonDetailsDialog(
) )
} }
b.addEventButton.onClick { openAddEventDialog() }
b.notesButton.isVisible = showNotes b.notesButton.isVisible = showNotes
b.notesButton.setupNotesButton( b.notesButton.setupNotesButton(
activity = activity, activity = activity,
@ -261,7 +259,6 @@ class LessonDetailsDialog(
onShowListener = onShowListener, onShowListener = onShowListener,
onDismissListener = onDismissListener, onDismissListener = onDismissListener,
) )
b.legend.isVisible = showNotes b.legend.isVisible = showNotes
if (showNotes) if (showNotes)
NoteManager.setLegendText(lesson, b.legend) NoteManager.setLegendText(lesson, b.legend)

View File

@ -334,24 +334,27 @@ class TimetableDayFragment : LazyFragment(), CoroutineScope {
lesson.teacherName ?: "?" lesson.teacherName ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
lesson.oldTeacherName?.let { add(it.asStrikethroughSpannable()) }
lesson.teacherName?.let { add(it) } lesson.teacherName?.let { add(it) }
}.concat() }.concat(arrowRight)
// team // team
val teamInfo = if (lesson.teamId != null && lesson.teamId == lesson.oldTeamId) val teamInfo = if (lesson.teamId != null && lesson.teamId == lesson.oldTeamId)
lesson.teamName ?: "?" lesson.teamName ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
lesson.oldTeamName?.let { add(it.asStrikethroughSpannable()) }
lesson.teamName?.let { add(it) } lesson.teamName?.let { add(it) }
}.concat() }.concat(arrowRight)
// classroom // classroom
val classroomInfo = if (lesson.classroom != null && lesson.classroom == lesson.oldClassroom) val classroomInfo = if (lesson.classroom != null && lesson.classroom == lesson.oldClassroom)
lesson.classroom ?: "?" lesson.classroom ?: "?"
else else
mutableListOf<CharSequence>().apply { mutableListOf<CharSequence>().apply {
lesson.oldClassroom?.let { add(it.asStrikethroughSpannable()) }
lesson.classroom?.let { add(it) } lesson.classroom?.let { add(it) }
}.concat() }.concat(arrowRight)
lb.annotationVisible = manager.getAnnotation(activity, lesson, lb.annotation) lb.annotationVisible = manager.getAnnotation(activity, lesson, lb.annotation)
@ -379,8 +382,8 @@ class TimetableDayFragment : LazyFragment(), CoroutineScope {
if (subjectTextPrimary != null) if (subjectTextPrimary != null)
lb.lessonNumberText.setTextColor(subjectTextPrimary.toInt()) lb.lessonNumberText.setTextColor(subjectTextPrimary.toInt())
lb.subjectName.text = lessonText?.let { lb.subjectName.text = lessonText?.let {
if (lesson.type == Lesson.TYPE_SHIFTED_SOURCE) if (lesson.type == Lesson.TYPE_CANCELLED || lesson.type == Lesson.TYPE_SHIFTED_SOURCE)
it.asStrikethroughSpannable().asColoredSpannable(colorSecondary) it.asStrikethroughSpannable().asColoredSpannable(subjectTextSecondary.toInt())
else if (subjectTextPrimary != null) else if (subjectTextPrimary != null)
it.asColoredSpannable(subjectTextPrimary.toInt()) it.asColoredSpannable(subjectTextPrimary.toInt())
else else
@ -409,7 +412,12 @@ class TimetableDayFragment : LazyFragment(), CoroutineScope {
} }
//lb.subjectName.typeface = Typeface.create("sans-serif-light", Typeface.BOLD) //lb.subjectName.typeface = Typeface.create("sans-serif-light", Typeface.BOLD)
lb.annotationVisible = manager.getAnnotation(activity, lesson, lb.annotation) val lessonNumberMargin =
if (lb.annotationVisible) (-8).dp
else 0
lb.lessonNumberText.updateLayoutParams<LinearLayout.LayoutParams> {
updateMargins(top = lessonNumberMargin, bottom = lessonNumberMargin)
}
// The day view needs the event time ranges in the start minute/end minute format, // The day view needs the event time ranges in the start minute/end minute format,
// so calculate those here // so calculate those here

View File

@ -4,13 +4,11 @@
package pl.szczodrzynski.edziennik.ui.timetable package pl.szczodrzynski.edziennik.ui.timetable
import android.annotation.SuppressLint
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.os.AsyncTask import android.os.AsyncTask
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -92,16 +90,8 @@ class TimetableFragment : Fragment(), CoroutineScope {
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_SCROLL_TO_DATE))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_RELOAD_PAGES))
activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_SCROLL_TO_DATE ),
Context.RECEIVER_NOT_EXPORTED)
activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_RELOAD_PAGES),
Context.RECEIVER_NOT_EXPORTED)
} else @Suppress("UnspecifiedRegisterReceiverFlag") {
activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_SCROLL_TO_DATE))
activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION_RELOAD_PAGES))
}
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
@ -187,8 +177,8 @@ class TimetableFragment : Fragment(), CoroutineScope {
val selectedDate = arguments?.getString("timetableDate", "")?.let { if (it.isBlank()) null else Date.fromY_m_d(it) } val selectedDate = arguments?.getString("timetableDate", "")?.let { if (it.isBlank()) null else Date.fromY_m_d(it) }
b.tabLayout.setupWithViewPager(b.viewPager) b.tabLayout.setUpWithViewPager(b.viewPager)
b.viewPager.setCurrentItem(items.indexOfFirst { it.value == selectedDate?.value ?: today }, false) b.tabLayout.setCurrentItem(items.indexOfFirst { it.value == selectedDate?.value ?: today }, false)
activity.navView.bottomSheet.prependItems( activity.navView.bottomSheet.prependItems(
BottomSheetPrimaryItem(true) BottomSheetPrimaryItem(true)
@ -221,7 +211,7 @@ class TimetableFragment : Fragment(), CoroutineScope {
val dateSelected = Date.fromMillisUtc(millis) val dateSelected = Date.fromMillisUtc(millis)
val index = items.indexOfFirst { it == dateSelected } val index = items.indexOfFirst { it == dateSelected }
if (index != -1) if (index != -1)
b.viewPager.setCurrentItem(index, true) b.tabLayout.setCurrentItem(index, true)
} }
} }
.show(activity.supportFragmentManager, TAG) .show(activity.supportFragmentManager, TAG)
@ -264,7 +254,7 @@ class TimetableFragment : Fragment(), CoroutineScope {
activity.navView.bottomBar.fabExtendedText = getString(R.string.timetable_today) activity.navView.bottomBar.fabExtendedText = getString(R.string.timetable_today)
activity.navView.bottomBar.fabIcon = SzkolnyFont.Icon.szf_calendar_today_outline activity.navView.bottomBar.fabIcon = SzkolnyFont.Icon.szf_calendar_today_outline
activity.navView.setFabOnClickListener(View.OnClickListener { activity.navView.setFabOnClickListener(View.OnClickListener {
b.viewPager.setCurrentItem(items.indexOfFirst { it.value == today }, true) b.tabLayout.setCurrentItem(items.indexOfFirst { it.value == today }, true)
}) })
}} }}

View File

@ -5,7 +5,6 @@
package pl.szczodrzynski.edziennik.utils.managers package pl.szczodrzynski.edziennik.utils.managers
import android.content.Context import android.content.Context
import com.google.android.material.color.MaterialColors
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@ -132,7 +131,7 @@ class GradesManager(val app: App) : CoroutineScope {
return grade.weight return grade.weight
} }
fun getGradeColor(context: Context, grade: Grade): Int { fun getGradeColor(grade: Grade): Int {
val type = grade.type val type = grade.type
val defColor = colorMode == COLOR_MODE_DEFAULT val defColor = colorMode == COLOR_MODE_DEFAULT
val valueMax = grade.valueMax ?: 0f val valueMax = grade.valueMax ?: 0f
@ -180,7 +179,7 @@ class GradesManager(val app: App) : CoroutineScope {
} }
else -> grade.color and 0xffffff else -> grade.color and 0xffffff
} }
return MaterialColors.harmonizeWithPrimary(context, color or 0xff000000.toInt()) return color or 0xff000000.toInt()
} }
/** /**

View File

@ -43,11 +43,40 @@ class TimetableManager(val app: App) : CoroutineScope {
Lesson.TYPE_CANCELLED -> { Lesson.TYPE_CANCELLED -> {
annotationVisible = true annotationVisible = true
annotation.setText(R.string.timetable_lesson_cancelled) annotation.setText(R.string.timetable_lesson_cancelled)
annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_cancelled_color),
PorterDuff.Mode.SRC_ATOP
)
//lb.subjectName.typeface = Typeface.DEFAULT //lb.subjectName.typeface = Typeface.DEFAULT
} }
Lesson.TYPE_CHANGE -> { Lesson.TYPE_CHANGE -> {
annotationVisible = true annotationVisible = true
annotation.setText(R.string.timetable_lesson_change) when {
lesson.subjectId != lesson.oldSubjectId && lesson.teacherId != lesson.oldTeacherId
&& lesson.oldSubjectName != null && lesson.oldTeacherName != null ->
annotation.setText(
R.string.timetable_lesson_change_format,
"${lesson.oldSubjectName ?: "?"}, ${lesson.oldTeacherName ?: "?"}"
)
lesson.subjectId != lesson.oldSubjectId && lesson.oldSubjectName != null ->
annotation.setText(
R.string.timetable_lesson_change_format,
lesson.oldSubjectName ?: "?"
)
lesson.teacherId != lesson.oldTeacherId && lesson.oldTeacherName != null ->
annotation.setText(
R.string.timetable_lesson_change_format,
lesson.oldTeacherName ?: "?"
)
else -> annotation.setText(R.string.timetable_lesson_change)
}
annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_change_color),
PorterDuff.Mode.SRC_ATOP
)
} }
Lesson.TYPE_SHIFTED_SOURCE -> { Lesson.TYPE_SHIFTED_SOURCE -> {
annotationVisible = true annotationVisible = true
@ -67,6 +96,8 @@ class TimetableManager(val app: App) : CoroutineScope {
else -> annotation.setText(R.string.timetable_lesson_shifted) else -> annotation.setText(R.string.timetable_lesson_shifted)
} }
annotation.background.setTintColor(R.attr.timetable_lesson_shifted_source_color.resolveAttr(context))
} }
Lesson.TYPE_SHIFTED_TARGET -> { Lesson.TYPE_SHIFTED_TARGET -> {
annotationVisible = true annotationVisible = true
@ -86,6 +117,11 @@ class TimetableManager(val app: App) : CoroutineScope {
else -> annotation.setText(R.string.timetable_lesson_shifted_from) else -> annotation.setText(R.string.timetable_lesson_shifted_from)
} }
annotation.background.colorFilter = PorterDuffColorFilter(
getColorFromAttr(context, R.attr.timetable_lesson_shifted_target_color),
PorterDuff.Mode.SRC_ATOP
)
} }
} }
return annotationVisible return annotationVisible

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="?colorSurfaceContainerHigh"/>
</selector>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="?colorPrimary"
android:alpha="0.01" />
</selector>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="?colorOnBackground"/>
</selector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"> android:shape="oval">
<solid android:color="#ffffff" /> <solid android:color="@color/colorPrimary" />
</shape> </shape>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke android:color="#000000" android:width="4dp" />
<solid android:color="#ffffff" />
</shape>

View File

@ -10,6 +10,6 @@
android:width="1dp" android:width="1dp"
android:height="1dp" /> android:height="1dp" />
<solid android:color="?colorOutlineVariant" /> <solid android:color="@color/dividerColor" />
</shape> </shape>

View File

@ -1,10 +1,28 @@
<!--
~ Copyright (c) Kuba Szczodrzyński 2019-11-24.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp" android:width="128dp"
android:height="64dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="128"
android:viewportHeight="48" android:viewportHeight="128">
android:tint="?colorOnSurfaceVariant">
<path <path
android:fillColor="?colorOnSurfaceVariant" android:pathData="M63.79,8.64C1.48,8.64 0,78.5 0,92.33c0,13.83 28.56,25.03 63.79,25.03c35.24,0 63.79,-11.21 63.79,-25.03C127.58,78.5 126.11,8.64 63.79,8.64z"
android:pathData="M24,34.85Q27.45,34.85 30.25,32.95Q33.05,31.05 34.2,27.9H13.8Q15,31.05 17.775,32.95Q20.55,34.85 24,34.85ZM15,21.75 L17.4,19.4 19.7,21.75 21.9,19.6 17.35,15.15 12.9,19.6ZM28.35,21.75 L30.65,19.4 33.05,21.75 35.2,19.6 30.7,15.15 26.2,19.6ZM24,45.05Q19.7,45.05 15.825,43.425Q11.95,41.8 9.075,38.925Q6.2,36.05 4.575,32.2Q2.95,28.35 2.95,24Q2.95,19.7 4.575,15.825Q6.2,11.95 9.075,9.075Q11.95,6.2 15.8,4.55Q19.65,2.9 24,2.9Q28.3,2.9 32.175,4.55Q36.05,6.2 38.925,9.075Q41.8,11.95 43.45,15.8Q45.1,19.65 45.1,24Q45.1,28.35 43.45,32.2Q41.8,36.05 38.925,38.925Q36.05,41.8 32.2,43.425Q28.35,45.05 24,45.05ZM24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24ZM24,40.5Q30.9,40.5 35.7,35.7Q40.5,30.9 40.5,24Q40.5,17.1 35.7,12.3Q30.9,7.5 24,7.5Q17.1,7.5 12.3,12.3Q7.5,17.1 7.5,24Q7.5,30.9 12.3,35.7Q17.1,40.5 24,40.5Z"/> android:fillColor="#FCC21B"/>
<path
android:pathData="M63.91,104.82c-3.43,0 -6.87,-0.43 -10.25,-1.31c-1.6,-0.42 -2.56,-2.06 -2.15,-3.66c0.42,-1.6 2.06,-2.56 3.66,-2.14c11.65,3.04 24.21,-0.21 32.78,-8.48c1.19,-1.15 3.09,-1.12 4.24,0.08c1.15,1.19 1.12,3.09 -0.08,4.24C84.54,100.85 74.32,104.82 63.91,104.82z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M55.53,67.26c-0.01,0.01 -0.02,0.02 -0.02,0.02C55.51,67.27 55.52,67.26 55.53,67.26z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M98.21,41.34c-13.36,0 -15.15,2.03 -21.4,3.36C70.56,46.02 64,46.02 64,46.02s-6.56,0 -12.81,-1.33c-6.25,-1.33 -8.05,-3.36 -21.4,-3.36c-13.36,0 -29.37,2.89 -29.37,2.89v8.51c0,0 3.59,0.47 3.91,3.75c0.16,1.33 -3.12,28.35 23.51,28.35c18.9,0 26.87,-11.33 29.45,-20.54c1.17,-4.37 2.19,-9.37 6.72,-9.37c4.53,0 5.55,5 6.72,9.37c2.58,9.22 10.54,20.54 29.45,20.54c26.63,0 23.35,-27.03 23.51,-28.35c0.31,-3.28 3.91,-3.75 3.91,-3.75v-8.51C127.58,44.23 111.57,41.34 98.21,41.34z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M95.94,45.05c-6.62,0.23 -11.65,1.31 -11.65,1.31c-9.84,2.06 -10.55,8.14 -9.93,12.97c0.8,6.07 3.29,13.75 10.04,18.49c0.53,0.38 1.76,0.79 2.35,-0.77c0,0 -0.02,0.11 0,0c2.22,-10.48 5.52,-20.14 10.78,-29.89l0,0C98.14,45.37 96.71,45.02 95.94,45.05z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M31.06,45.02c-4.27,-0.09 -9.11,0.19 -13.65,1.34c-5.1,1.28 -7.07,3.85 -7.6,9.39c-0.53,5.43 -1.13,19.27 8.73,24.46c0.57,0.3 1.83,0.5 2.44,-0.91l0,0C24,66.21 25.61,60.13 32.54,47.22l0,0C33.11,45.49 31.83,45.03 31.06,45.02z"
android:fillColor="#FFFFFF"/>
</vector> </vector>

View File

@ -1,10 +1,19 @@
<!--
~ Copyright (c) Kuba Szczodrzyński 2019-11-24.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp" android:width="128dp"
android:height="64dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="128"
android:viewportHeight="48" android:viewportHeight="128">
android:tint="?colorOnSurfaceVariant">
<path <path
android:fillColor="?colorOnSurfaceVariant" android:pathData="M64,9.56c-62.41,0 -63.88,69.96 -63.88,83.8c0,13.86 28.59,25.08 63.88,25.08c35.28,0 63.88,-11.22 63.88,-25.08C127.88,79.52 126.4,9.56 64,9.56z"
android:pathData="M17.9,28.95Q16.75,28.95 15.925,28.1Q15.1,27.25 15.1,26.15Q15.1,25 15.95,24.175Q16.8,23.35 17.9,23.35Q19.05,23.35 19.875,24.2Q20.7,25.05 20.7,26.15Q20.7,27.3 19.85,28.125Q19,28.95 17.9,28.95ZM30.15,28.95Q29,28.95 28.175,28.1Q27.35,27.25 27.35,26.15Q27.35,25 28.2,24.175Q29.05,23.35 30.15,23.35Q31.3,23.35 32.15,24.2Q33,25.05 33,26.15Q33,27.3 32.125,28.125Q31.25,28.95 30.15,28.95ZM24.05,40.5Q30.9,40.5 35.725,35.7Q40.55,30.9 40.55,24.05Q40.55,22.75 40.35,21.55Q40.15,20.35 39.85,19.35Q38.85,19.65 37.75,19.725Q36.65,19.8 35.4,19.8Q30.6,19.8 26.425,17.875Q22.25,15.95 19.25,12.3Q17.6,16.2 14.55,19.15Q11.5,22.1 7.55,23.7Q7.55,23.75 7.55,23.9Q7.55,24.05 7.55,24.05Q7.55,30.9 12.375,35.7Q17.2,40.5 24.05,40.5ZM24.05,45.05Q19.75,45.05 15.875,43.4Q12,41.75 9.125,38.9Q6.25,36.05 4.6,32.175Q2.95,28.3 2.95,24Q2.95,19.7 4.6,15.825Q6.25,11.95 9.125,9.1Q12,6.25 15.875,4.575Q19.75,2.9 24.05,2.9Q28.35,2.9 32.2,4.575Q36.05,6.25 38.925,9.1Q41.8,11.95 43.45,15.825Q45.1,19.7 45.1,24Q45.1,28.3 43.45,32.175Q41.8,36.05 38.95,38.9Q36.1,41.75 32.2,43.4Q28.3,45.05 24.05,45.05ZM19.3,7.7Q23.7,12.9 27.425,14.825Q31.15,16.75 35.7,16.75Q36.9,16.75 37.65,16.7Q38.4,16.65 39.25,16.4Q37.05,12.25 33.125,9.65Q29.2,7.05 24,7.05Q22.6,7.05 21.35,7.275Q20.1,7.5 19.3,7.7ZM7.4,20.35Q9.9,19.4 13.05,16.125Q16.2,12.85 17.5,8.2Q13.05,10.25 10.775,13.35Q8.5,16.45 7.4,20.35ZM19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7Q19.3,7.7 19.3,7.7ZM17.5,8.2Q17.5,8.2 17.5,8.2Q17.5,8.2 17.5,8.2Q17.5,8.2 17.5,8.2Q17.5,8.2 17.5,8.2Z"/> android:fillColor="#FCC21B"/>
<path
android:pathData="M42.21,65.3c-4.49,0.04 -8.17,-4.27 -8.22,-9.62c-0.05,-5.37 3.55,-9.75 8.04,-9.79c4.48,-0.04 8.17,4.27 8.22,9.64C50.3,60.88 46.7,65.25 42.21,65.3z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M86.32,65.3c4.48,-0.01 8.11,-4.36 8.1,-9.71c-0.01,-5.37 -3.66,-9.7 -8.14,-9.69c-4.49,0.01 -8.13,4.36 -8.12,9.73C78.18,60.98 81.83,65.31 86.32,65.3z"
android:fillColor="#2F2F2F"/>
</vector> </vector>

View File

@ -1,10 +1,22 @@
<!--
~ Copyright (c) Kuba Szczodrzyński 2019-11-24.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="128dp"
android:height="24dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="128"
android:viewportHeight="48" android:viewportHeight="128">
android:tint="?colorOnPrimary">
<path <path
android:fillColor="?colorOnPrimary" android:pathData="M64,9.62c-62.41,0 -63.88,69.96 -63.88,83.8c0,13.86 28.59,25.08 63.88,25.08c35.28,0 63.88,-11.22 63.88,-25.08C127.88,79.58 126.4,9.62 64,9.62z"
android:pathData="M30.95,21.6Q32.15,21.6 33.025,20.725Q33.9,19.85 33.9,18.65Q33.9,17.45 33.025,16.575Q32.15,15.7 30.95,15.7Q29.75,15.7 28.9,16.55Q28.05,17.4 28.05,18.65Q28.05,19.85 28.9,20.725Q29.75,21.6 30.95,21.6ZM17.05,21.6Q18.3,21.6 19.125,20.75Q19.95,19.9 19.95,18.7Q19.95,17.45 19.1,16.575Q18.25,15.7 17.05,15.7Q15.9,15.7 15,16.575Q14.1,17.45 14.1,18.65Q14.1,19.85 14.975,20.725Q15.85,21.6 17.05,21.6ZM24,27.15Q20.7,27.15 18,29Q15.3,30.85 14,33.9H17.25Q18.25,32.1 20.125,31.075Q22,30.05 24.05,30.05Q26.1,30.05 27.95,31.1Q29.8,32.15 30.85,33.9H34Q32.75,30.8 30.05,28.975Q27.35,27.15 24,27.15ZM24,45.05Q19.7,45.05 15.825,43.425Q11.95,41.8 9.075,38.925Q6.2,36.05 4.575,32.2Q2.95,28.35 2.95,24Q2.95,19.7 4.575,15.825Q6.2,11.95 9.075,9.075Q11.95,6.2 15.8,4.55Q19.65,2.9 24,2.9Q28.3,2.9 32.175,4.55Q36.05,6.2 38.925,9.075Q41.8,11.95 43.45,15.8Q45.1,19.65 45.1,24Q45.1,28.35 43.45,32.2Q41.8,36.05 38.925,38.925Q36.05,41.8 32.2,43.425Q28.35,45.05 24,45.05ZM24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24Q24,24 24,24ZM24,40.5Q30.9,40.5 35.7,35.7Q40.5,30.9 40.5,24Q40.5,17.1 35.7,12.3Q30.9,7.5 24,7.5Q17.1,7.5 12.3,12.3Q7.5,17.1 7.5,24Q7.5,30.9 12.3,35.7Q17.1,40.5 24,40.5Z"/> android:fillColor="#FCC21B"/>
<path
android:pathData="M41.99,65.5c-4.49,0.04 -8.17,-4.27 -8.22,-9.62c-0.05,-5.37 3.55,-9.75 8.04,-9.79c4.48,-0.04 8.17,4.27 8.22,9.64C50.08,61.09 46.47,65.46 41.99,65.5z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M86.1,65.5c4.48,-0.01 8.11,-4.36 8.1,-9.71c-0.01,-5.37 -3.66,-9.7 -8.14,-9.69c-4.49,0.01 -8.13,4.36 -8.12,9.73C77.95,61.18 81.61,65.51 86.1,65.5z"
android:fillColor="#2F2F2F"/>
<path
android:pathData="M43.08,97.67c1.99,1.34 4.5,0.46 6.71,0c6.18,-1.28 11.6,-1.33 14.2,-1.33s8.03,0.05 14.2,1.33c2.21,0.46 4.72,1.34 6.71,0c2.52,-1.71 0.66,-7.83 -3.31,-11.97c-2.4,-2.5 -8.13,-7.35 -17.61,-7.35c-9.48,0 -15.2,4.85 -17.61,7.35C42.42,89.85 40.56,95.97 43.08,97.67z"
android:fillColor="#ED6C30"/>
</vector> </vector>

View File

@ -1,10 +1,19 @@
<!--
~ Copyright (c) Kuba Szczodrzyński 2020-8-25.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp" android:width="128dp"
android:height="64dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="64"
android:viewportHeight="48" android:viewportHeight="64">
android:tint="?colorOnSecondaryContainer">
<path <path
android:fillColor="?colorOnSecondaryContainer" android:pathData="M54,19H10v33c0,2.209 1.791,4 4,4h36c2.209,0 4,-1.791 4,-4V19z"
android:pathData="M4.95,40.5V16.5Q4.2,16.25 3.575,15.325Q2.95,14.4 2.95,12.75V7.55Q2.95,5.7 4.3,4.325Q5.65,2.95 7.5,2.95H40.5Q42.35,2.95 43.725,4.325Q45.1,5.7 45.1,7.55V12.75Q45.1,14.4 44.45,15.325Q43.8,16.25 43.1,16.5V40.5Q43.1,42.35 41.725,43.75Q40.35,45.15 38.5,45.15H9.5Q7.65,45.15 6.3,43.75Q4.95,42.35 4.95,40.5ZM9.5,17.35V40.6Q9.5,40.6 9.5,40.6Q9.5,40.6 9.5,40.6H38.5Q38.5,40.6 38.5,40.6Q38.5,40.6 38.5,40.6V17.35ZM40.5,12.75Q40.5,12.75 40.5,12.75Q40.5,12.75 40.5,12.75V7.55Q40.5,7.55 40.5,7.55Q40.5,7.55 40.5,7.55H7.5Q7.5,7.55 7.5,7.55Q7.5,7.55 7.5,7.55V12.75Q7.5,12.75 7.5,12.75Q7.5,12.75 7.5,12.75ZM17.4,27.15H30.65V23.75H17.4ZM9.5,40.6Q9.5,40.6 9.5,40.6Q9.5,40.6 9.5,40.6V17.35V40.6Q9.5,40.6 9.5,40.6Q9.5,40.6 9.5,40.6Z"/> android:fillColor="#ffb86b"/>
<path
android:pathData="m54,22h-44c-1.657,0 -3,-1.343 -3,-3v-5c0,-1.657 1.343,-3 3,-3h44c1.657,0 3,1.343 3,3v5c0,1.657 -1.343,3 -3,3z"
android:fillColor="#ffa54a"/>
<path
android:pathData="m37,32h-10c-1.65,0 -3,-1.35 -3,-3s1.35,-3 3,-3h10c1.65,0 3,1.35 3,3s-1.35,3 -3,3z"
android:fillColor="#69707e"/>
</vector> </vector>

View File

@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?colorOnBackground">
<path
android:fillColor="?colorOnBackground"
android:pathData="M7.2,21.3Q6.15,21.3 5.45,20.6Q4.75,19.9 4.75,18.85V5.9H3.75V3.75H8.95V2.675H15.1V3.75H20.3V5.9H19.3V18.85Q19.3,19.875 18.587,20.587Q17.875,21.3 16.85,21.3ZM17.15,5.9H6.9V18.85Q6.9,18.975 6.988,19.062Q7.075,19.15 7.2,19.15H16.85Q16.95,19.15 17.05,19.05Q17.15,18.95 17.15,18.85ZM8.875,17.125H11.025V7.925H8.875ZM13.025,17.125H15.175V7.925H13.025ZM6.9,5.9V18.85Q6.9,18.975 6.9,19.062Q6.9,19.15 6.9,19.15Q6.9,19.15 6.9,19.062Q6.9,18.975 6.9,18.85Z"/>
</vector>

View File

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="48"
android:viewportHeight="48"
android:tint="?colorOnPrimary"
android:autoMirrored="true">
<path
android:fillColor="?colorOnPrimary"
android:pathData="M15.85,27.3Q15,27.3 14.55,26.8Q14.1,26.3 14.1,25.6Q14.1,24.8 14.55,24.325Q15,23.85 15.85,23.85H32.2Q33,23.85 33.45,24.325Q33.9,24.8 33.9,25.55Q33.9,26.3 33.45,26.8Q33,27.3 32.2,27.3ZM15.85,36.1Q15,36.1 14.55,35.65Q14.1,35.2 14.1,34.4Q14.1,33.65 14.55,33.175Q15,32.7 15.85,32.7H26.15Q26.95,32.7 27.4,33.2Q27.85,33.7 27.85,34.4Q27.85,35.2 27.4,35.65Q26.95,36.1 26.15,36.1ZM9.5,45.1Q7.65,45.1 6.3,43.725Q4.95,42.35 4.95,40.55V10.5Q4.95,8.6 6.3,7.25Q7.65,5.9 9.5,5.9H12.45V4.8Q12.45,4.1 13.075,3.475Q13.7,2.85 14.5,2.85Q15.35,2.85 15.875,3.475Q16.4,4.1 16.4,4.8V5.9H31.6V4.8Q31.6,4.1 32.2,3.475Q32.8,2.85 33.6,2.85Q34.45,2.85 35,3.475Q35.55,4.1 35.55,4.8V5.9H38.5Q40.4,5.9 41.75,7.25Q43.1,8.6 43.1,10.5V40.55Q43.1,42.35 41.75,43.725Q40.4,45.1 38.5,45.1ZM9.5,40.55H38.5Q38.5,40.55 38.5,40.55Q38.5,40.55 38.5,40.55V19.6H9.5V40.55Q9.5,40.55 9.5,40.55Q9.5,40.55 9.5,40.55ZM9.5,16.75H38.5V10.5Q38.5,10.5 38.5,10.5Q38.5,10.5 38.5,10.5H9.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5ZM9.5,16.75V10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5V16.75Z"/>
</vector>

View File

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?colorOnBackground"
android:autoMirrored="true">
<path
android:fillColor="?colorOnBackground"
android:pathData="M2.75,19.2V15.05Q2.75,12.9 4.25,11.4Q5.75,9.9 7.9,9.9H17.15L13.55,6.3L15.05,4.8L21.25,11L15.05,17.2L13.55,15.7L17.15,12.05H7.9Q6.65,12.05 5.775,12.925Q4.9,13.8 4.9,15.05V19.2Z"/>
</vector>

View File

@ -1,10 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="64dp"
android:height="24dp" android:height="64dp"
android:viewportWidth="48" android:viewportWidth="48"
android:viewportHeight="48" android:viewportHeight="48">
android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="@android:color/white" android:pathData="M44,24c0,11.045 -8.955,20 -20,20S4,35.045 4,24S12.955,4 24,4S44,12.955 44,24z"
android:pathData="M17.9,34.55H26.45Q27.9,34.55 29,33.45Q30.1,32.35 30.1,30.9V25.75Q30.1,24.3 29,23.2Q27.9,22.1 26.45,22.1H21.55V17.1H30.1V13.45H17.9V25.75H26.45Q26.45,25.75 26.45,25.75Q26.45,25.75 26.45,25.75V30.9Q26.45,30.9 26.45,30.9Q26.45,30.9 26.45,30.9H17.9ZM9,42.65Q7.55,42.65 6.45,41.55Q5.35,40.45 5.35,39V9Q5.35,7.55 6.45,6.45Q7.55,5.35 9,5.35H39Q40.45,5.35 41.55,6.45Q42.65,7.55 42.65,9V39Q42.65,40.45 41.55,41.55Q40.45,42.65 39,42.65ZM9,39H39Q39,39 39,39Q39,39 39,39V9Q39,9 39,9Q39,9 39,9H9Q9,9 9,9Q9,9 9,9V39Q9,39 9,39Q9,39 9,39ZM9,9Q9,9 9,9Q9,9 9,9V39Q9,39 9,39Q9,39 9,39Q9,39 9,39Q9,39 9,39V9Q9,9 9,9Q9,9 9,9Z"/> android:fillColor="#F44336"/>
<path
android:pathData="M24,11l3.898,7.898l8.703,1.301l-6.301,6.102l1.5,8.699L24,30.898L16.199,35l1.5,-8.699l-6.301,-6.102l8.703,-1.301L24,11z"
android:fillColor="#FFCA28"/>
</vector> </vector>

View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>

View File

@ -1,10 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp" android:width="128dp"
android:height="64dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="128"
android:viewportHeight="48" android:viewportHeight="128">
android:tint="?colorOnSurfaceVariant">
<path <path
android:fillColor="?colorOnSurfaceVariant" android:pathData="m103.24,15.168 l-7.883,7.871c-8.746,-7.063 -19.719,-11.039 -31.355,-11.039 -27.57,0 -50,22.43 -50,50s22.43,50 50,50c17.758,0 34.348,-9.367 43.301,-24.449 1.41,-2.375 0.625,-5.441 -1.75,-6.852 -2.367,-1.41 -5.438,-0.629 -6.852,1.746 -7.156,12.062 -20.453,19.555 -34.699,19.555 -22.055,0 -40,-17.945 -40,-40s17.945,-40 40,-40c8.934,0 17.371,2.938 24.223,8.16l-9.063,9.047c-2.48,2.5 -0.719,6.762 2.801,6.762h24.039c2.199,0 4,-1.801 4,-4v-24c0,-3.52 -4.262,-5.301 -6.762,-2.801z"
android:pathData="M22.4,26.8V13.6H25.85V26.8ZM24.05,34.25Q23.25,34.25 22.7,33.7Q22.15,33.15 22.15,32.35Q22.15,31.6 22.7,31.05Q23.25,30.5 24.05,30.5Q24.8,30.5 25.35,31.05Q25.9,31.6 25.9,32.35Q25.9,33.15 25.35,33.7Q24.8,34.25 24.05,34.25ZM29.95,7.4H41.65V10.8H36.65L37,11.2Q40.25,14.15 41.575,17.45Q42.9,20.75 42.9,23.8Q42.9,29.8 39.225,34.4Q35.55,39 29.85,40.55V35.85Q33.7,34.65 36,31.325Q38.3,28 38.3,23.8Q38.3,21.25 37.45,19.1Q36.6,16.95 34.65,15.2L33.4,14.1V19.1H29.95ZM18,40.6H6.3V37.2H11.3L10.95,36.8Q7.9,33.65 6.5,30.475Q5.1,27.3 5.1,24.2Q5.1,18.25 8.725,13.65Q12.35,9.05 18.1,7.5V12.15Q14.25,13.4 11.975,16.725Q9.7,20.05 9.7,24.2Q9.7,26.7 10.45,28.8Q11.2,30.9 13.3,32.8L14.55,33.9V28.9H18Z"/> android:fillColor="#ffcf48"/>
<path
android:pathData="m68,85c0,2.762 -2.238,5 -5,5s-5,-2.238 -5,-5 2.238,-5 5,-5 5,2.238 5,5zM70,41c0,-3.867 -3.133,-7 -7,-7s-7,3.133 -7,7c0,0.047 0.016,0.094 0.016,0.141h-0.016l2.438,28.59c0.203,2.414 2.188,4.269 4.563,4.269s4.359,-1.855 4.563,-4.269l2.438,-28.59h-0.016c0,-0.047 0.016,-0.094 0.016,-0.141z"
android:fillColor="#fd657a"/>
</vector> </vector>

View File

@ -1,18 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp" android:width="64dp"
android:height="128dp" android:height="64dp"
android:viewportWidth="48" android:viewportWidth="48"
android:viewportHeight="48"> android:viewportHeight="48">
<path <path
android:pathData="M8,39.001v-30c0,-2.2 1.8,-4 4,-4h24c2.2,0 4,1.8 4,4v30c0,2.2 -1.8,4 -4,4H12C9.8,43.001 8,41.201 8,39.001z" android:pathData="M8,39.001v-30c0,-2.2 1.8,-4 4,-4h24c2.2,0 4,1.8 4,4v30c0,2.2 -1.8,4 -4,4H12C9.8,43.001 8,41.201 8,39.001z"
android:fillColor="#42a5f5"/> android:fillColor="#42a5f5"/>
<path <path
android:pathData="M14,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S14,9.105 14,8.001zM22,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S22,9.105 22,8.001zM30,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S30,9.105 30,8.001zM38,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S38,9.105 38,8.001z" android:pathData="M14,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S14,9.105 14,8.001zM22,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S22,9.105 22,8.001zM30,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S30,9.105 30,8.001zM38,8.001c0,-1.105 -0.895,-2 -2,-2s-2,0.895 -2,2s0.895,2 2,2S38,9.105 38,8.001z"
android:fillColor="#1e88e5"/> android:fillColor="#1e88e5"/>
<path <path
android:pathData="M11,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C11.4,9.001 11,8.601 11,8.001zM19,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C19.4,9.001 19,8.601 19,8.001zM27,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C27.4,9.001 27,8.601 27,8.001zM35,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C35.4,9.001 35,8.601 35,8.001z" android:pathData="M11,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C11.4,9.001 11,8.601 11,8.001zM19,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C19.4,9.001 19,8.601 19,8.001zM27,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C27.4,9.001 27,8.601 27,8.001zM35,8.001v-4c0,-0.6 0.4,-1 1,-1l0,0c0.6,0 1,0.4 1,1v4c0,0.6 -0.4,1 -1,1l0,0C35.4,9.001 35,8.601 35,8.001z"
android:fillColor="#cfd8dc"/> android:fillColor="#cfd8dc"/>
<path <path
android:pathData="M14,19.001h19.993v2H14V19.001zM14.007,15.001H34v2H14.007V15.001zM14,30.001h17v2H14V30.001zM27,34.001h6.993v2H27V34.001zM14,34.001h11v2H14V34.001zM21,23.001h-7v2h7V23.001z" android:pathData="M14,19.001h19.993v2H14V19.001zM14.007,15.001H34v2H14.007V15.001zM14,30.001h17v2H14V30.001zM27,34.001h6.993v2H27V34.001zM14,34.001h11v2H14V34.001zM21,23.001h-7v2h7V23.001z"
android:fillColor="#1565c0"/> android:fillColor="#1565c0"/>
</vector> </vector>

View File

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="48"
android:viewportHeight="48"
android:tint="?colorOnBackground"
android:autoMirrored="true">
<path
android:fillColor="?colorOnBackground"
android:pathData="M15,34.2Q15.75,34.2 16.3,33.675Q16.85,33.15 16.85,32.4Q16.85,31.65 16.3,31.1Q15.75,30.55 15,30.55Q14.25,30.55 13.725,31.1Q13.2,31.65 13.2,32.4Q13.2,33.15 13.725,33.675Q14.25,34.2 15,34.2ZM15,25.8Q15.75,25.8 16.3,25.275Q16.85,24.75 16.85,24Q16.85,23.25 16.3,22.7Q15.75,22.15 15,22.15Q14.25,22.15 13.725,22.7Q13.2,23.25 13.2,24Q13.2,24.75 13.725,25.275Q14.25,25.8 15,25.8ZM15,17.35Q15.75,17.35 16.3,16.825Q16.85,16.3 16.85,15.55Q16.85,14.8 16.3,14.25Q15.75,13.7 15,13.7Q14.25,13.7 13.725,14.25Q13.2,14.8 13.2,15.55Q13.2,16.3 13.725,16.825Q14.25,17.35 15,17.35ZM21.45,34.25H34.15V30.6H21.45ZM21.45,25.8H34.15V22.15H21.45ZM21.45,17.4H34.15V13.75H21.45ZM9,42.65Q7.55,42.65 6.45,41.55Q5.35,40.45 5.35,39V9Q5.35,7.55 6.45,6.45Q7.55,5.35 9,5.35H39Q40.45,5.35 41.55,6.45Q42.65,7.55 42.65,9V39Q42.65,40.45 41.55,41.55Q40.45,42.65 39,42.65ZM9,39H39Q39,39 39,39Q39,39 39,39V9Q39,9 39,9Q39,9 39,9H9Q9,9 9,9Q9,9 9,9V39Q9,39 9,39Q9,39 9,39ZM9,9Q9,9 9,9Q9,9 9,9V39Q9,39 9,39Q9,39 9,39Q9,39 9,39Q9,39 9,39V9Q9,9 9,9Q9,9 9,9Z"/>
</vector>

View File

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?colorOnBackground"
android:autoMirrored="true">
<path
android:fillColor="?colorOnBackground"
android:pathData="M19.1,19.2V15.05Q19.1,13.8 18.225,12.925Q17.35,12.05 16.1,12.05H6.85L10.45,15.7L8.95,17.2L2.75,11L8.95,4.8L10.45,6.3L6.85,9.9H16.1Q18.25,9.9 19.75,11.4Q21.25,12.9 21.25,15.05V19.2Z"/>
</vector>

View File

@ -2,9 +2,50 @@
android:width="48dp" android:width="48dp"
android:height="48dp" android:height="48dp"
android:viewportWidth="48" android:viewportWidth="48"
android:viewportHeight="48" android:viewportHeight="48">
android:tint="?colorOnBackground">
<path <path
android:fillColor="?colorOnBackground" android:pathData="M33,5L15,5L10,14L12,40L36,40L38,14Z"
android:pathData="M23.4,45.75Q16.5,38.9 12.35,34.55Q8.2,30.2 5.925,27.1Q3.65,24 2.925,21.725Q2.2,19.45 2.2,16.7Q2.2,11.65 5.575,8.15Q8.95,4.65 13.95,4.65Q16.6,4.65 19,5.725Q21.4,6.8 23.3,8.55L20.8,19.9H25.9L23.55,40L29.2,18.25H23.8L27.25,6.1Q28.8,5.35 30.525,5Q32.25,4.65 34.1,4.65Q39,4.65 42.45,8.15Q45.9,11.65 45.9,16.7Q45.9,19.4 45.125,21.675Q44.35,23.95 41.95,27Q39.55,30.05 35.1,34.475Q30.65,38.9 23.4,45.75ZM19.65,35.45 L21.05,23.7H15.4L18.3,10.55Q17.3,10.05 16.175,9.65Q15.05,9.25 13.9,9.25Q10.85,9.25 8.8,11.4Q6.75,13.55 6.75,16.7Q6.75,18.35 7.35,20.1Q7.95,21.85 9.425,23.925Q10.9,26 13.375,28.825Q15.85,31.65 19.65,35.45ZM29.6,33.65Q35.65,28 38.475,23.85Q41.3,19.7 41.3,16.65Q41.3,13.55 39.225,11.4Q37.15,9.25 34.1,9.25Q33.3,9.25 32.55,9.3Q31.8,9.35 31,9.65L29.55,14.45H34.7ZM34.7,14.45Q34.7,14.45 34.7,14.45Q34.7,14.45 34.7,14.45Q34.7,14.45 34.7,14.45Q34.7,14.45 34.7,14.45Q34.7,14.45 34.7,14.45Q34.7,14.45 34.7,14.45ZM15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Q15.4,23.7 15.4,23.7Z"/> android:strokeWidth="1"
android:fillColor="#546e7a"
android:strokeColor="#00000000"/>
<path
android:pathData="M41,43L7,43C9,38 16,36 24,36C32,36 39,38 41,43Z"
android:strokeWidth="1"
android:fillColor="#8bc34a"
android:strokeColor="#00000000"/>
<path
android:pathData="M34.5,38.9727L34.6094,38.1836C34.6602,37.8945 34.7031,37.5977 34.7617,37.3203C34.875,36.7656 35.0039,36.2148 35.1719,35.6719C35.4922,34.5938 35.9375,33.5508 36.4844,32.582C37.0352,31.6133 37.6914,30.7188 38.4492,29.9375C39.2109,29.1641 40.0547,28.4766 41,28C40.1992,28.6836 39.5664,29.5195 39.0469,30.3945C38.5234,31.2773 38.1406,32.2148 37.8633,33.168C37.5938,34.1289 37.4336,35.1055 37.3867,36.082C37.3516,36.5703 37.3594,37.0586 37.375,37.5469C37.3828,37.7891 37.4063,38.0156 37.4219,38.2461L37.5,39.0273Z"
android:strokeWidth="1"
android:fillColor="#8bc34a"
android:strokeColor="#00000000"/>
<path
android:pathData="M35.5195,40.7461C35.8125,39.8789 36.1523,39.1719 36.5508,38.4336C36.9531,37.7148 37.4063,37.0234 37.9414,36.3906C38.4688,35.7617 39.0859,35.1953 39.7734,34.7617C40.4648,34.332 41.2383,34.0625 42,34C41.2969,34.3086 40.7148,34.7773 40.2617,35.332C39.8125,35.8906 39.4766,36.5156 39.2227,37.1758C38.9648,37.832 38.7891,38.5195 38.6641,39.2109C38.5469,39.8906 38.4648,40.6367 38.4766,41.2539Z"
android:strokeWidth="1"
android:fillColor="#8bc34a"
android:strokeColor="#00000000"/>
<path
android:pathData="M32.5195,37.7617C32.7305,37.1953 32.9063,36.4961 33.0352,35.8398C33.1641,35.1719 33.2461,34.4961 33.2617,33.8164C33.2813,32.4805 33.0664,31.0391 32,30C32.668,30.3008 33.2695,30.8281 33.7109,31.4688C34.1641,32.1055 34.4883,32.832 34.7422,33.5742C34.9883,34.3164 35.1641,35.082 35.2852,35.8555C35.4023,36.6367 35.4805,37.3828 35.4805,38.2422Z"
android:strokeWidth="1"
android:fillColor="#8bc34a"
android:strokeColor="#00000000"/>
<path
android:pathData="M31.2617,33.7852C31.2773,32.6367 31.1875,30.375 29,28C30.8789,27.375 32.6328,28.0703 33.8438,28.9063L34.9414,14.668L31.2344,8L16.7656,8L13.0586,14.668L14.6328,35.0977C17.3008,34.3789 20.4336,34 24,34C26.6406,34 29.0391,34.2109 31.1914,34.6094C31.2344,34.1875 31.2617,33.8633 31.2617,33.7852Z"
android:strokeWidth="1"
android:fillColor="#78909c"
android:strokeColor="#00000000"/>
<path
android:pathData="M17.9727,19.1719L16.9297,19.1719L16.9297,22L15,22L15,14L18.1484,14C19.0977,14 19.8398,14.2109 20.3711,14.6328C20.9063,15.0547 21.1758,15.6484 21.1758,16.4141C21.1758,16.9727 21.0625,17.4336 20.8359,17.8008C20.6133,18.1641 20.2578,18.4609 19.7773,18.6875L21.4492,21.918L21.4492,22L19.3828,22ZM16.9297,17.6875L18.1484,17.6875C18.5156,17.6875 18.7891,17.5898 18.9766,17.3984C19.1602,17.207 19.2539,16.9375 19.2539,16.5898C19.2539,16.2461 19.1602,15.9766 18.9727,15.7773C18.7852,15.582 18.5117,15.4844 18.1484,15.4844L16.9297,15.4844Z"
android:strokeWidth="1"
android:fillColor="#37474f"
android:strokeColor="#00000000"/>
<path
android:pathData="M25,22L23,22L23,14L25,14Z"
android:strokeWidth="1"
android:fillColor="#37474f"
android:strokeColor="#00000000"/>
<path
android:pathData="M28.9297,19.2852L28.9297,22L27,22L27,14L30.1914,14C30.8047,14 31.3438,14.1133 31.8125,14.3398C32.2852,14.5625 32.6484,14.8828 32.9063,15.3008C33.168,15.7148 33.2969,16.1875 33.2969,16.7148C33.2969,17.4922 33.0156,18.1172 32.457,18.5859C31.8984,19.0547 31.1328,19.2852 30.1563,19.2852ZM28.9297,17.7969L30.1914,17.7969C30.5664,17.7969 30.8516,17.7031 31.0469,17.5156C31.2422,17.3281 31.3438,17.0664 31.3438,16.7266C31.3438,16.3516 31.2422,16.0547 31.0391,15.8281C30.8359,15.6094 30.5625,15.4922 30.2148,15.4922L28.9297,15.4922Z"
android:strokeWidth="1"
android:fillColor="#37474f"
android:strokeColor="#00000000"/>
</vector> </vector>

View File

@ -6,7 +6,7 @@
<group android:translateX="11.076923" <group android:translateX="11.076923"
android:translateY="11.076923"> android:translateY="11.076923">
<path <path
android:fillColor="?colorOnPrimary" android:fillColor="#FFFFFFFF"
android:pathData="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0,0 0,5 21H19A2,2 0,0 0,21 19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z"/> android:pathData="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0,0 0,5 21H19A2,2 0,0 0,21 19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z"/>
</group> </group>
</vector> </vector>

View File

@ -6,7 +6,7 @@
<group android:translateX="11.076923" <group android:translateX="11.076923"
android:translateY="11.076923"> android:translateY="11.076923">
<path <path
android:fillColor="?colorOnPrimary" android:fillColor="#FFFFFFFF"
android:pathData="M6,2C4.89,2 4,2.89 4,4V20A2,2 0,0 0,6 22H10V20.09L12.09,18H6V16H14.09L16.09,14H6V12H18.09L20,10.09V8L14,2H6M13,3.5L18.5,9H13V3.5M20.15,13C20,13 19.86,13.05 19.75,13.16L18.73,14.18L20.82,16.26L21.84,15.25C22.05,15.03 22.05,14.67 21.84,14.46L20.54,13.16C20.43,13.05 20.29,13 20.15,13M18.14,14.77L12,20.92V23H14.08L20.23,16.85L18.14,14.77Z"/> android:pathData="M6,2C4.89,2 4,2.89 4,4V20A2,2 0,0 0,6 22H10V20.09L12.09,18H6V16H14.09L16.09,14H6V12H18.09L20,10.09V8L14,2H6M13,3.5L18.5,9H13V3.5M20.15,13C20,13 19.86,13.05 19.75,13.16L18.73,14.18L20.82,16.26L21.84,15.25C22.05,15.03 22.05,14.67 21.84,14.46L20.54,13.16C20.43,13.05 20.29,13 20.15,13M18.14,14.77L12,20.92V23H14.08L20.23,16.85L18.14,14.77Z"/>
</group> </group>
</vector> </vector>

View File

@ -6,7 +6,7 @@
<group android:translateX="11.076923" <group android:translateX="11.076923"
android:translateY="11.076923"> android:translateY="11.076923">
<path <path
android:fillColor="?colorOnPrimary" android:fillColor="#FFFFFFFF"
android:pathData="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0,0 0,4 20H20A2,2 0,0 0,22 18V6C22,4.89 21.1,4 20,4Z"/> android:pathData="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0,0 0,4 20H20A2,2 0,0 0,22 18V6C22,4.89 21.1,4 20,4Z"/>
</group> </group>
</vector> </vector>

View File

@ -6,7 +6,7 @@
<group android:translateX="11.076923" <group android:translateX="11.076923"
android:translateY="11.076923"> android:translateY="11.076923">
<path <path
android:fillColor="?colorOnPrimary" android:fillColor="#FFFFFFFF"
android:pathData="M14,12H15.5V14.82L17.94,16.23L17.19,17.53L14,15.69V12M4,2H18A2,2 0,0 1,20 4V10.1C21.24,11.36 22,13.09 22,15A7,7 0,0 1,15 22C13.09,22 11.36,21.24 10.1,20H4A2,2 0,0 1,2 18V4A2,2 0,0 1,4 2M4,15V18H8.67C8.24,17.09 8,16.07 8,15H4M4,8H10V5H4V8M18,8V5H12V8H18M4,13H8.29C8.63,11.85 9.26,10.82 10.1,10H4V13M15,10.15A4.85,4.85 0,0 0,10.15 15C10.15,17.68 12.32,19.85 15,19.85A4.85,4.85 0,0 0,19.85 15C19.85,12.32 17.68,10.15 15,10.15Z"/> android:pathData="M14,12H15.5V14.82L17.94,16.23L17.19,17.53L14,15.69V12M4,2H18A2,2 0,0 1,20 4V10.1C21.24,11.36 22,13.09 22,15A7,7 0,0 1,15 22C13.09,22 11.36,21.24 10.1,20H4A2,2 0,0 1,2 18V4A2,2 0,0 1,4 2M4,15V18H8.67C8.24,17.09 8,16.07 8,15H4M4,8H10V5H4V8M18,8V5H12V8H18M4,13H8.29C8.63,11.85 9.26,10.82 10.1,10H4V13M15,10.15A4.85,4.85 0,0 0,10.15 15C10.15,17.68 12.32,19.85 15,19.85A4.85,4.85 0,0 0,19.85 15C19.85,12.32 17.68,10.15 15,10.15Z"/>
</group> </group>
</vector> </vector>

View File

@ -1,10 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector android:height="128dp" android:viewportHeight="64"
android:width="64dp" android:viewportWidth="64" android:width="128dp" xmlns:android="http://schemas.android.com/apk/res/android">
android:height="64dp" <path android:fillColor="#fd646f" android:pathData="m51.483,15.326 l3.937,-3.93c1.24,-1.25 0.36,-3.38 -1.4,-3.38h-12.02c-1.1,0 -2,0.9 -2,2v12c0,1.76 2.13,2.65 3.38,1.4l4.537,-4.529c2.615,3.426 4.083,7.646 4.083,12.113 0,11.215 -8.565,20 -19.5,20 -1.381,0 -2.5,1.119 -2.5,2.5s1.119,2.5 2.5,2.5c13.738,0 24.5,-10.981 24.5,-25 0,-5.817 -1.988,-11.301 -5.517,-15.674z"/>
android:viewportWidth="48" <path android:fillColor="#fd646f" android:pathData="m20.604,38.58 l-4.523,4.53c-2.613,-3.427 -4.081,-7.647 -4.081,-12.11 0,-11.215 8.565,-20 19.5,-20 1.381,0 2.5,-1.119 2.5,-2.5s-1.119,-2.5 -2.5,-2.5c-13.738,0 -24.5,10.981 -24.5,25 0,5.815 1.989,11.303 5.52,15.677l-3.936,3.943c-1.25,1.25 -0.36,3.38 1.4,3.38h12c1.1,0 2,-0.9 2,-2v-12.02c0,-1.76 -2.13,-2.64 -3.38,-1.4z"/>
android:viewportHeight="48"
android:tint="?colorOnSurfaceVariant">
<path
android:fillColor="?colorOnSurfaceVariant"
android:pathData="M8.6,40.6V37.2H13.85L13.55,36.9Q10.25,34.1 8.725,31.05Q7.2,28 7.2,24.15Q7.2,18.3 10.825,13.775Q14.45,9.25 20.25,7.8V12.45Q16.4,13.65 14.1,16.875Q11.8,20.1 11.8,24.15Q11.8,27.15 12.875,29.325Q13.95,31.5 15.95,33.1L17.2,33.9V28.55H20.6V40.6ZM27.8,40.25V35.55Q31.7,34.4 33.975,31.15Q36.25,27.9 36.25,23.8Q36.25,21.6 35.1,19.275Q33.95,16.95 32.2,15.15L31,14.1V19.45H27.55V7.4H39.6V10.8H34.25L34.6,11.2Q37.75,14.05 39.3,17.4Q40.85,20.75 40.85,23.8Q40.85,29.7 37.225,34.225Q33.6,38.75 27.8,40.25Z"/>
</vector> </vector>

View File

@ -1,10 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp" android:width="128dp"
android:height="48dp" android:height="128dp"
android:viewportWidth="48" android:viewportWidth="48"
android:viewportHeight="48" android:viewportHeight="48">
android:tint="?attr/colorOnSurfaceVariant"> <path
<path android:pathData="M42,38c0,2.209 -1.791,4 -4,4H10c-2.209,0 -4,-1.791 -4,-4V10c0,-2.209 1.791,-4 4,-4h28c2.209,0 4,1.791 4,4V38z"
android:fillColor="?attr/colorOnSurfaceVariant" android:fillColor="#CFD8DC"/>
android:pathData="M24,28.25Q23.1,28.25 22.425,27.6Q21.75,26.95 21.75,26Q21.75,25.1 22.425,24.425Q23.1,23.75 24.05,23.75Q24.95,23.75 25.6,24.4Q26.25,25.05 26.25,26Q26.25,26.9 25.6,27.575Q24.95,28.25 24,28.25ZM16,28.25Q15.1,28.25 14.425,27.6Q13.75,26.95 13.75,26Q13.75,25.1 14.4,24.425Q15.05,23.75 16,23.75Q16.9,23.75 17.575,24.4Q18.25,25.05 18.25,26Q18.25,26.9 17.6,27.575Q16.95,28.25 16,28.25ZM31.95,28.25Q31.1,28.25 30.425,27.6Q29.75,26.95 29.75,26Q29.75,25.1 30.425,24.425Q31.1,23.75 32,23.75Q32.9,23.75 33.575,24.4Q34.25,25.05 34.25,26Q34.25,26.9 33.575,27.575Q32.9,28.25 31.95,28.25ZM24,36.25Q23.1,36.25 22.425,35.575Q21.75,34.9 21.75,34Q21.75,33.1 22.425,32.425Q23.1,31.75 24.05,31.75Q24.95,31.75 25.6,32.425Q26.25,33.1 26.25,34.05Q26.25,34.9 25.6,35.575Q24.95,36.25 24,36.25ZM16,36.25Q15.1,36.25 14.425,35.575Q13.75,34.9 13.75,34Q13.75,33.1 14.4,32.425Q15.05,31.75 16,31.75Q16.9,31.75 17.575,32.425Q18.25,33.1 18.25,34.05Q18.25,34.9 17.6,35.575Q16.95,36.25 16,36.25ZM31.95,36.25Q31.1,36.25 30.425,35.575Q29.75,34.9 29.75,34Q29.75,33.1 30.425,32.425Q31.1,31.75 32,31.75Q32.9,31.75 33.575,32.425Q34.25,33.1 34.25,34.05Q34.25,34.9 33.575,35.575Q32.9,36.25 31.95,36.25ZM9.5,45.1Q7.65,45.1 6.3,43.725Q4.95,42.35 4.95,40.55V10.5Q4.95,8.6 6.3,7.25Q7.65,5.9 9.5,5.9H12.45V4.8Q12.45,4.1 13.075,3.475Q13.7,2.85 14.45,2.85Q15.3,2.85 15.85,3.475Q16.4,4.1 16.4,4.8V5.9H31.6V4.8Q31.6,4.1 32.175,3.475Q32.75,2.85 33.55,2.85Q34.4,2.85 34.975,3.475Q35.55,4.1 35.55,4.8V5.9H38.5Q40.4,5.9 41.75,7.25Q43.1,8.6 43.1,10.5V40.55Q43.1,42.35 41.75,43.725Q40.4,45.1 38.5,45.1ZM9.5,40.55H38.5Q38.5,40.55 38.5,40.55Q38.5,40.55 38.5,40.55V19.6H9.5V40.55Q9.5,40.55 9.5,40.55Q9.5,40.55 9.5,40.55ZM9.5,16.75H38.5V10.5Q38.5,10.5 38.5,10.5Q38.5,10.5 38.5,10.5H9.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5ZM9.5,16.75V10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5Q9.5,10.5 9.5,10.5V16.75Z"/> <path
android:pathData="M11,18H16V23H11zM18,18H23V23H18zM25,18H30V23H25zM32,18H37V23H32zM32,25H37V30H32zM11,25H16V30H11zM11,32H16V37H11zM18,25H23V30H18zM25,25H30V30H25zM18,32H23V37H18zM25,32H30V37H25zM32,32H37V37H32z"
android:fillColor="#90A4AE"/>
<path
android:pathData="M11,11H16V16H11zM18,11H23V16H18zM25,11H30V16H25zM32,11H37V16H32z"
android:fillColor="#F44336"/>
<path
android:pathData="M38,26c-0.338,0 -0.669,0.023 -1,0.05V30h-5v-2.382c-1.817,1.052 -3.329,2.565 -4.382,4.382H30v5h-3.95C26.023,37.331 26,37.662 26,38c0,1.405 0.254,2.747 0.697,4H38c2.209,0 4,-1.791 4,-4V26.697C40.747,26.254 39.405,26 38,26z"
android:fillColor="#ECEFF1"/>
<path
android:pathData="M37,30v-3.95c-1.812,0.15 -3.506,0.703 -5,1.568V30H37zM30,32h-2.382c-0.865,1.494 -1.418,3.188 -1.568,5H30V32z"
android:fillColor="#CFD8DC"/>
<path
android:pathData="M48,38c0,5.5 -4.5,10 -10,10s-10,-4.5 -10,-10s4.5,-10 10,-10S48,32.5 48,38"
android:fillColor="#F44336"/>
<path
android:pathData="M45,38c0,3.9 -3.1,7 -7,7s-7,-3.1 -7,-7s3.1,-7 7,-7S45,34.1 45,38"
android:fillColor="#EEEEEE"/>
<path
android:fillColor="#FF000000"
android:pathData="M42.4,41.1l-2.9,-2.9c0,-0.1 0,-0.1 0,-0.2c0,-0.4 -0.2,-0.8 -0.5,-1.1V33h-2v3.9c-0.3,0.3 -0.5,0.7 -0.5,1.1c0,0.8 0.7,1.5 1.5,1.5h0.1l2.9,2.9L42.4,41.1z"/>
</vector> </vector>

View File

@ -7,5 +7,5 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:shape="rectangle"> android:shape="rectangle">
<corners android:topLeftRadius="4dp" android:topRightRadius="4dp" /> <corners android:topLeftRadius="4dp" android:topRightRadius="4dp" />
<solid android:color="?colorTertiary" tools:color="?colorTertiary" /> <solid android:color="#2196f3" tools:color="?timetable_lesson_change_color" />
</shape> </shape>

View File

@ -9,7 +9,7 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="?colorTertiary" android:fillColor="@color/md_red_500"
android:pathData="M0,4V20L12,12.25" /> android:pathData="M0,4V20L12,12.25" />
</vector> </vector>

View File

@ -5,6 +5,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"> android:shape="oval">
<solid android:color="?colorError"/> <solid android:color="@color/red500"/>
<size android:width="10dp" android:height="10dp"/> <size android:width="10dp" android:height="10dp"/>
</shape> </shape>

View File

@ -55,7 +55,7 @@
<Button <Button
android:id="@+id/closeButton" android:id="@+id/closeButton"
style="@style/Widget.Material3.Button.OutlinedButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"

View File

@ -99,7 +99,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/crash_details" android:text="@string/crash_details"
android:textColor="?colorPrimary" /> android:textColor="@color/colorPrimary" />
</LinearLayout> </LinearLayout>

View File

@ -31,6 +31,23 @@
</pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch> </pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch>
</pl.szczodrzynski.navlib.NavView> </pl.szczodrzynski.navlib.NavView>
<TextView
android:id="@+id/nightlyText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginHorizontal="48dp"
android:layout_marginVertical="8dp"
android:background="@drawable/bg_rounded_4dp"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:padding="4dp"
android:textAllCaps="true"
android:textSize="12sp"
android:textStyle="bold"
tools:backgroundTint="#a0ff0000"
tools:text="Nightly\n20200503" />
</FrameLayout> </FrameLayout>
</layout> </layout>

View File

@ -241,7 +241,7 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/notesButton" android:id="@+id/notesButton"
style="@style/Widget.Material3.Button.OutlinedButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"

View File

@ -20,17 +20,11 @@
android:id="@+id/tabLayout" android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorSurfaceContainerLow" android:background="@color/colorSurface_6dp"
app:tabIndicatorColor="?colorPrimary" app:tabIndicatorColor="?colorPrimary"
app:tabMaxWidth="300dp"
app:tabMode="auto" app:tabMode="auto"
app:tabPaddingBottom="12dp"
app:tabPaddingEnd="16dp"
app:tabPaddingStart="16dp"
app:tabPaddingTop="12dp"
app:tabSelectedTextColor="?colorPrimary" app:tabSelectedTextColor="?colorPrimary"
app:tabTextAppearance="@style/NavView.TextView.BodyMedium" app:tabTextColor="?android:textColorPrimary" />
app:tabTextColor="?colorOnBackground" />
<pl.szczodrzynski.edziennik.ui.base.lazypager.LazyViewPager <pl.szczodrzynski.edziennik.ui.base.lazypager.LazyViewPager
android:id="@+id/viewPager" android:id="@+id/viewPager"

View File

@ -4,14 +4,9 @@
--> -->
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp" android:layout_marginHorizontal="16dp"
android:layout_marginVertical="8dp" android:layout_marginVertical="8dp"
android:paddingLeft="8dp"
android:paddingTop="8dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true" />
style="?attr/materialCardViewFilledStyle"
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge" />

View File

@ -7,40 +7,50 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:layout_margin="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical">
android:paddingLeft="8dp"
android:paddingTop="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginBottom="8dp"
app:srcCompat="@drawable/ic_archive" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/home_archive_title" android:text="@string/home_archive_title"
android:textAppearance="@style/NavView.TextView.TitleMedium" /> android:textAppearance="@style/NavView.TextView.Title" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/homeArchiveText" android:id="@+id/homeArchiveText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="left" android:layout_gravity="center_horizontal"
android:gravity="left" android:layout_margin="16dp"
android:textAppearance="@style/NavView.TextView.BodyMedium" android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:text="@string/home_archive_text" android:text="@string/home_archive_text"
android:textSize="16sp"
tools:text="Przeglądasz dane ucznia z roku szkolnego 2019/2020." /> tools:text="Przeglądasz dane ucznia z roku szkolnego 2019/2020." />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/homeArchiveClose" android:id="@+id/homeArchiveClose"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_marginTop="16dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/home_archive_close" /> android:text="@string/home_archive_close" />
</LinearLayout> </LinearLayout>
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
app:srcCompat="@drawable/ic_archive" />
</LinearLayout>
</layout> </layout>

View File

@ -6,51 +6,60 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:gravity="center_vertical"
android:paddingTop="8dp" android:orientation="horizontal"
android:orientation="vertical"> tools:layout_margin="8dp">
<ImageView
android:id="@+id/homeAvailabilityIcon" <LinearLayout
android:layout_width="24dp" android:layout_width="0dp"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_marginBottom="8dp" android:layout_weight="1"
app:srcCompat="@drawable/ic_update" /> android:orientation="vertical">
<TextView <TextView
android:id="@+id/homeAvailabilityTitle" android:id="@+id/homeAvailabilityTitle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/home_availability_title" android:text="@string/home_availability_title"
android:textAppearance="@style/NavView.TextView.TitleMedium" /> android:textAppearance="@style/NavView.TextView.Title" />
<TextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/homeAvailabilityText" android:id="@+id/homeAvailabilityText"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@style/NavView.TextView.BodyMedium" android:layout_gravity="center_horizontal"
android:layout_margin="16dp"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:text="@string/home_availability_text" android:text="@string/home_availability_text"
android:textSize="16sp"
tools:text="Zaktualizuj aplikację do najnowszej wersji 4.3.1." /> tools:text="Zaktualizuj aplikację do najnowszej wersji 4.3.1." />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="16dp">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/homeAvailabilityUpdate" android:id="@+id/homeAvailabilityUpdate"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/home_availability_update" /> android:text="@string/home_availability_update" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/homeAvailabilityInfo" android:id="@+id/homeAvailabilityInfo"
style="@style/Widget.Material3.Button.TonalButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:text="@string/home_availability_info" /> android:text="@string/home_availability_info" />
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/homeAvailabilityIcon"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
app:srcCompat="@drawable/ic_update" />
</LinearLayout> </LinearLayout>
</layout> </layout>

View File

@ -20,21 +20,14 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/getLogs" android:id="@+id/getLogs"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Save Debug Logs" /> android:text="Save Debug Logs" />
<com.google.android.material.button.MaterialButton
android:id="@+id/librusCaptchaButton"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="LIBRUS® Captcha" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/refreshWidget" android:id="@+id/refreshWidget"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Refresh all widgets" /> android:text="Refresh all widgets" />
@ -47,7 +40,7 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/runChucker" android:id="@+id/runChucker"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Launch Chucker" /> android:text="Launch Chucker" />
@ -60,14 +53,14 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/migrate71" android:id="@+id/migrate71"
style="@style/Widget.Material3.Button.OutlinedButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Migration 71" /> android:text="Migration 71" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/syncReceivers" android:id="@+id/syncReceivers"
style="@style/Widget.Material3.Button.OutlinedButton" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Sync receivers" /> android:text="Sync receivers" />
@ -80,7 +73,7 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/pruneWorkButton" android:id="@+id/pruneWorkButton"
style="@style/Widget.Material3.Button" style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Prune finished work" /> android:text="Prune finished work" />

View File

@ -1,62 +1,41 @@
<?xml version="1.0" encoding="utf-8"?><!-- <?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) Kuba Szczodrzyński 2020-2-28. ~ Copyright (c) Kuba Szczodrzyński 2020-2-28.
--> -->
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical">
android:padding="8dp">
<LinearLayout <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/NavView.TextView.Title"
android:text="@string/card_events_header_title" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/eventsNoData"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:layout_gravity="center_horizontal"
android:orientation="horizontal"> android:layout_margin="16dp"
android:fontFamily="sans-serif-light"
<com.google.android.material.button.MaterialButton android:text="@string/events_no_nearest"
style="@style/Widget.Material3.Button.IconButton.Filled" android:textSize="16sp" />
android:backgroundTint="?colorPrimaryContainer"
app:iconTint="?colorOnPrimaryContainer"
android:clickable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
app:icon="@drawable/ic_event_note" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/card_events_header_title"
android:textAppearance="@style/NavView.TextView.BodyLarge" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/eventsNoData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/events_no_nearest"
android:textAppearance="@style/NavView.TextView.BodyMedium" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/eventsView" android:id="@+id/eventsView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:clipToPadding="false" android:clipToPadding="false"
tools:itemCount="3" tools:visibility="visible"
tools:listitem="@layout/event_list_item" tools:listitem="@layout/event_list_item"
tools:visibility="visible" /> tools:itemCount="3"/>
</LinearLayout> </LinearLayout>
</layout> </layout>

Some files were not shown because too many files have changed in this diff Show More