Skip to content

Commit

Permalink
[UI] Upgrade to Material 3 design, refactor some core elements (#201)
Browse files Browse the repository at this point in the history
* Material 3 theme and color support, filled cards

* Change drawer header, dark bottombar color

* Replace MaterialComponents with Material3

* wielki powrót pr m3 do szkolnego (nie czytajcie tego kodu)

* fix M3 UI code & upgrade kotlin

* update dependencies

* fix missing Intent receiver flags for Tiramisu+

* fix kapt errors related to SelectiveDAO + migrate BuildConfig

* adapt code to updated dependencies + align lessons (based by #196)

* fix: no query filtering

* fix: duplicated items in about card

* fix: "Back button opens drawer" (redundant super call)

* fix: too small heading in agenda dialog

* adapt notes fragment to MD3

* add lock layout function (#199)

* hide classroom heading when no classroom is specified

* add support for grade column codes

* grades: join code and category together

* add cosmetic ui changes + fix build issues

* fix proguard rules (attempt 1)

* add new Retrofit2 rules

* add new ProGuard rules + fix QR scanning

* fix agenda view crash when building release variant

* improve LessonDetailsDialog

* remove duplicated string extension

* set separate app ID & icon for debug version

* remove unneeded import statement

* fix collapsing toolbar title when doing back gesture

* remove useless dependencies

* fix UI issues on old Android versions

* fix missing color resources + cleanup dependencies

* fix release building issue

* fix release building issue & remove ripple from NavView

* move version badge to the top bar

* Revert changes introduced by rebase

* Update NavLib from sadorowo/NavLib

* Revert "add lock layout function (#199)"

This reverts commit 2fd7038.

* Revert "add support for grade column codes"

* Revert unnecessary code changes, part 1

* Lower minSdk to 19

* Revert unnecessary code changes, part 2

* Add new application logo

* Restore bottom bar support in NavLib, revert unnecessary changes

* Use new IconicsMaterialButton in MessageFragment

* Migrate NavView to view binding

* Support IconButton in IconicsMaterialButton

* Cleanup NavLib w600dp styles

* Remove NavLib text styles

* Refactor all application themes, update styles in layouts

* Move enums and config entry to .data, fix app crashing

* Rename non-theme styles to AppStyle

* Restructure app config classes, move config to .data

* Add Theme enum and UiManager, support basic theme changing

* Actually support basic theme changing

* Serialize enum as string, fix config migration, bring back DebugDb

* Fix changing themes, apply night mode in App

* Fix resolving ColorStateList attributes, add LabPlaygroundFragment

* add Iconics methods into ProGuard rules

* Replace home card icon buttons, remove unused icons

* Update gradle properties

* Update build.gradle

* Remove unnecessary dependencies

* Remove playstore icon

* Apply fixes after review

---------

Co-authored-by: Adam Kasprzycki <[email protected]>
Co-authored-by: Kuba Szczodrzyński <[email protected]>
  • Loading branch information
3 people authored Jun 30, 2024
1 parent fadf1d7 commit 0823e72
Show file tree
Hide file tree
Showing 595 changed files with 5,742 additions and 3,927 deletions.
20 changes: 19 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/dictionaries/Kuba.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 54 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ apply from: 'git-info.gradle'
android {
compileSdkVersion setup.compileSdk

namespace "pl.szczodrzynski.edziennik"

defaultConfig {
applicationId 'pl.szczodrzynski.edziennik'
applicationId "pl.szczodrzynski.edziennik"
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk

Expand All @@ -20,8 +22,9 @@ android {

buildConfigField "java.util.Map<String, String>", "GIT_INFO", gitInfoMap
buildConfigField "String", "VERSION_BASE", "\"${release.versionName}\""

manifestPlaceholders = [
buildTimestamp: String.valueOf(System.currentTimeMillis())
buildTimestamp: String.valueOf(System.currentTimeMillis())
]

multiDexEnabled = true
Expand All @@ -36,46 +39,57 @@ android {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}

correctErrorTypes = true
}
}

buildTypes {
debug {
getIsDefault().set(true)
minifyEnabled = false
applicationIdSuffix = ".debug"
manifestPlaceholders = [
buildTimestamp: 0
buildTimestamp: 0
]
}

release {
minifyEnabled = true
shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles fileTree('proguard').asList().toArray()
}
}
flavorDimensions "platform"

flavorDimensions += "platform"

productFlavors {
unofficial {
getIsDefault().set(true)
versionName "${release.versionName}-${gitInfo.versionSuffix}"
}

official {}
play {}
}

variantFilter { variant ->
def flavors = variant.flavors*.name
setIgnore(variant.buildType.name == "debug" && !flavors.contains("unofficial") || flavors.contains("main"))
}

sourceSets {
unofficial {
java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml")
}

official {
java.srcDirs = ["src/main/java", "src/play-not/java"]
manifest.srcFile("src/play-not/AndroidManifest.xml")
}

play {
java.srcDirs = ["src/main/java", "src/play/java"]
}
Expand All @@ -84,29 +98,36 @@ android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}

buildFeatures {
dataBinding = true
viewBinding = true
buildConfig = true
}

compileOptions {
coreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

packagingOptions {
resources {
excludes += ['META-INF/library-core_release.kotlin_module']
}
}

externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
}
}

lint {
checkReleaseBuilds false
}
Expand All @@ -115,6 +136,7 @@ android {
tasks.whenTaskAdded { task ->
if (!task.name.endsWith("Release") && !task.name.endsWith("ReleaseWithR8"))
return

def renameTaskName = "rename${task.name.capitalize()}"

def flavor = ""
Expand All @@ -125,16 +147,20 @@ tasks.whenTaskAdded { task ->
if (task.name.startsWith("minify"))
flavor = task.name.substring("minify".length(), task.name.indexOf("Release")).uncapitalize()

def taskName = "package${flavor.capitalize()}Release"

if (flavor != "") {
tasks.create(renameTaskName, Copy) {
tasks.register(renameTaskName, Copy) {
dependsOn(taskName)
from file("${projectDir}/${flavor}/release/"),
file("${buildDir}/outputs/mapping/${flavor}Release/"),
file("${buildDir}/outputs/apk/${flavor}/release/"),
file("${buildDir}/outputs/bundle/${flavor}Release/")
file("${layout.buildDirectory}/outputs/mapping/${flavor}Release/"),
file("${layout.buildDirectory}/outputs/apk/${flavor}/release/"),
file("${layout.buildDirectory}/outputs/bundle/${flavor}Release/")
include "*.aab", "*.apk", "mapping.txt", "output-metadata.json"
destinationDir file("${projectDir}/release/")
rename ".+?\\.(.+)", "Edziennik_${android.defaultConfig.versionName}_${flavor}." + '$1'
}

task.finalizedBy(renameTaskName)
}
}
Expand All @@ -145,37 +171,37 @@ dependencies {
// Language cores
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.multidex:multidex:2.0.1"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"

// Android Jetpack
implementation "androidx.appcompat:appcompat:1.5.1"
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.room:room-runtime:2.4.3"
implementation "androidx.room:room-ktx:2.4.3"
implementation "androidx.work:work-runtime-ktx:2.7.1"
kapt "androidx.room:room-compiler:2.4.3"
implementation "androidx.core:core-ktx:1.13.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.2"
implementation "androidx.navigation:navigation-fragment-ktx:2.7.7"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.room:room-runtime:2.6.1"
implementation "androidx.room:room-ktx:2.6.1"
implementation "androidx.work:work-runtime-ktx:2.9.0"
kapt "androidx.room:room-compiler:2.6.1"

// Google design libs
implementation "com.google.android.material:material:1.6.1"
implementation "com.google.android.material:material:1.12.0"
implementation "com.google.android.flexbox:flexbox:3.0.0"

// Play Services/Firebase
implementation "com.google.android.gms:play-services-wearable:17.1.0"
implementation "com.google.android.gms:play-services-wearable:18.2.0"
implementation("com.google.firebase:firebase-core") { version { strictly "19.0.2" } }
implementation "com.google.firebase:firebase-crashlytics:18.2.13"
implementation "com.google.firebase:firebase-crashlytics:19.0.1"
implementation("com.google.firebase:firebase-messaging") { version { strictly "20.1.3" } }

// OkHttp, Retrofit, Gson, Jsoup
implementation("com.squareup.okhttp3:okhttp") { version { strictly "3.12.13" } }
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'org.jsoup:jsoup:1.14.3'
implementation "pl.droidsonroids:jspoon:1.3.2"
implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2"
Expand All @@ -189,19 +215,22 @@ dependencies {
implementation "eu.szkolny:material-about-library:1d5ebaf47c"
implementation "eu.szkolny:mhttp:af4b62e6e9"
implementation "eu.szkolny:nachos:0e5dfcaceb"
implementation "eu.szkolny.selective-dao:annotation:27f8f3f194"
implementation "eu.szkolny.selective-dao:annotation:6a337f9"
officialImplementation "eu.szkolny:ssl-provider:1.0.0"
unofficialImplementation "eu.szkolny:ssl-provider:1.0.0"

implementation "pl.szczodrzynski:numberslidingpicker:2921225f76"
implementation "pl.szczodrzynski:recyclertablayout:700f980584"
implementation "pl.szczodrzynski:tachyon:551943a6b5"
kapt "eu.szkolny.selective-dao:codegen:27f8f3f194"
kapt "eu.szkolny.selective-dao:codegen:6a337f9"

// Iconics & related
implementation "com.mikepenz:iconics-core: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 "eu.szkolny:szkolny-font:77e33acc2a"
implementation 'com.mikepenz:google-material-typeface:4.0.0.2-kotlin@aar'
implementation "eu.szkolny:szkolny-font:95eabe7"

// Other dependencies
implementation "cat.ereza:customactivityoncrash:2.3.0"
Expand Down
2 changes: 1 addition & 1 deletion app/git-info.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "org.eclipse.jgit:org.eclipse.jgit:5.5.+"
Expand Down
31 changes: 31 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@
"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"
Expand Down
Loading

0 comments on commit 0823e72

Please sign in to comment.