Skip to content

Commit

Permalink
compatability with new api
Browse files Browse the repository at this point in the history
  • Loading branch information
phytal committed Jun 21, 2021
1 parent 67a40fe commit bca0251
Show file tree
Hide file tree
Showing 32 changed files with 316 additions and 251 deletions.
163 changes: 84 additions & 79 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,84 +1,89 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

# Created by https://www.gitignore.io/api/jetbrains
# Edit at https://www.gitignore.io/?templates=jetbrains
# Built application files
*.apk
*.aar
*.ap_
*.aab

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# Files for the ART/Dalvik VM
*.dex

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Java class files
*.class

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# File-based project format
*.iws

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator/

# End of https://www.gitignore.io/api/jetbrains
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/jarRepositories.xml
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Android Profiling
*.hprof
4 changes: 2 additions & 2 deletions .idea/vcs.xml → .idea/compiler.xml

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

2 changes: 1 addition & 1 deletion .idea/discord.xml

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

25 changes: 0 additions & 25 deletions .idea/jarRepositories.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.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/runConfigurations.xml

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project Sarona
## View Grades More Simple.
## Viewing Grades Made Simple.
---
### Summary
An Android grade-fetching app made with Kotlin. The app fetches student grades from the HomeAccessCenter (HAC) and displays them in a simple format.
Expand Down
6 changes: 0 additions & 6 deletions app/.idea/vcs.xml

This file was deleted.

34 changes: 13 additions & 21 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "com.phytal.sarona"
minSdkVersion 26
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -48,21 +47,20 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'com.google.android.material:material:1.4.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.preference:preference-ktx:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

def room_version = "2.3.0-alpha02"
def room_version = "2.4.0-alpha03"

implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
Expand All @@ -76,7 +74,7 @@ dependencies {
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"

def lifecycle_version = "2.2.0"
def lifecycle_version = "2.3.1"
def arch_version = "2.1.0"

// ViewModel
Expand Down Expand Up @@ -109,12 +107,6 @@ dependencies {
implementation 'org.kodein.di:kodein-di-framework-android-x:6.5.5'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'

//KMongo
implementation 'org.litote.kmongo:kmongo:4.0.2'
implementation 'org.litote.kmongo:kmongo-async:4.0.2'
implementation 'org.litote.kmongo:kmongo-coroutine:4.0.2'
implementation 'org.litote.kmongo:kmongo-rxjava2:4.0.2'

// Glide
implementation "com.github.bumptech.glide:glide:4.9.0"
}
8 changes: 0 additions & 8 deletions app/local.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ package com.phytal.sarona.data.db

import androidx.lifecycle.LiveData
import androidx.room.*
import com.phytal.sarona.data.db.entities.CurrentCourseList
import com.phytal.sarona.data.db.entities.CourseList

@Dao
interface CurrentCourseDao {
interface CourseDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun upsert(course: CurrentCourseList)
fun upsert(course: CourseList)

@Delete
fun delete(course: CurrentCourseList)
fun delete(course: CourseList)

@Query("DELETE FROM course_table")
fun deleteAllCourses()

@Query("SELECT * FROM course_table")
fun getAllCourses(): LiveData<CurrentCourseList>
fun getAllCourses(): LiveData<CourseList>

@Query("SELECT * FROM course_table WHERE id LIKE :cid LIMIT 1")
fun findById(cid: String): CurrentCourseList
fun findById(cid: String): CourseList
}
6 changes: 3 additions & 3 deletions app/src/main/java/com/phytal/sarona/data/db/CourseDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.phytal.sarona.data.db.entities.CurrentCourseList
import com.phytal.sarona.data.db.entities.CourseList
import com.phytal.sarona.data.db.entities.DataConverter
import com.phytal.sarona.internal.helpers.SingletonHolder


@Database(entities = [CurrentCourseList::class], version = 1)
@Database(entities = [CourseList::class], version = 1)
@TypeConverters(DataConverter::class)
abstract class CourseDatabase: RoomDatabase() {

abstract fun courseDao(): CurrentCourseDao
abstract fun courseDao(): CourseDao

companion object : SingletonHolder<CourseDatabase, Context>({
Room.databaseBuilder(it.applicationContext, CourseDatabase::class.java, "course_table.db")
Expand Down
Loading

0 comments on commit bca0251

Please sign in to comment.