Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
5a1a07cd42 | |||
dbfdaffe99 | |||
58eb217ab7 | |||
24f920c05f | |||
6301308d76 | |||
8e205fa889 | |||
e9bdcee443 | |||
b214cfccb2 | |||
404ddd58b8 | |||
137ff7df0c | |||
b4071d7456 | |||
5e6e6cfde6 | |||
ffeb09a37f |
11
README.md
11
README.md
@ -1,12 +1,13 @@
|
|||||||
# ProjectLaogai "hso App"
|
# ProjectLaogai "hso App"
|
||||||
Some info about the app ...
|
ProjectLaogai is a app to access the timetable for any course of the Hochschule Offenburg. You can also check the current weeks mensa menus.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* look up what you can eat in the mensa
|
* look up what you can eat in the mensa
|
||||||
* check your timetable
|
* check your timetable
|
||||||
* probably many many bugs
|
* probably some funny bugs
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
[<img src="https://raw.githubusercontent.com/Seil0/Seil0.github.io/master/images/ProjectLaogai_HomeScreen.png" width=180>](https://github.com/Seil0/Seil0.github.io/blob/master/images/ProjectLaogai_HomeScreen.png)
|
||||||
|
[<img src="https://raw.githubusercontent.com/Seil0/Seil0.github.io/master/images/ProjectLaogai_Mensa.png" width=180>](https://github.com/Seil0/Seil0.github.io/blob/master/images/ProjectLaogai_Mensa.png)
|
||||||
|
[<img src="https://raw.githubusercontent.com/Seil0/Seil0.github.io/master/images/ProjectLaogai_NavDrawer.png" width=180>](https://github.com/Seil0/Seil0.github.io/blob/master/images/ProjectLaogai_NavDrawer.png)
|
||||||
|
|
||||||
|
ProjectLaogai © 2019 mosad [www.mosad.xyz](http://www.mosad.xyz), Project by [@Seil0](https://git.mosad.xyz/Seil0)
|
||||||
ProjectLaogai © 2018 mosad www.mosad.xyz, Project by [@Seil0](https://git.mosad.xyz/Seil0)
|
|
@ -12,8 +12,8 @@ android {
|
|||||||
applicationId "org.mosad.seil0.projectlaogai"
|
applicationId "org.mosad.seil0.projectlaogai"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 9
|
versionCode 11
|
||||||
versionName "0.3.1"
|
versionName "0.3.3"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -36,8 +36,8 @@ dependencies {
|
|||||||
implementation 'org.jsoup:jsoup:1.11.3'
|
implementation 'org.jsoup:jsoup:1.11.3'
|
||||||
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
|
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
|
||||||
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
|
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
|
||||||
implementation 'com.afollestad.material-dialogs:core:2.0.0-rc5'
|
implementation 'com.afollestad.material-dialogs:core:2.0.3'
|
||||||
implementation 'com.afollestad.material-dialogs:color:2.0.0-rc5'
|
implementation 'com.afollestad.material-dialogs:color:2.0.3'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||||
|
@ -29,6 +29,7 @@ import android.view.MenuItem
|
|||||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.GravityCompat
|
import androidx.core.view.GravityCompat
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentTransaction
|
import androidx.fragment.app.FragmentTransaction
|
||||||
import com.afollestad.aesthetic.Aesthetic
|
import com.afollestad.aesthetic.Aesthetic
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
@ -37,22 +38,22 @@ import kotlinx.android.synthetic.main.activity_main.*
|
|||||||
import kotlinx.android.synthetic.main.app_bar_main.*
|
import kotlinx.android.synthetic.main.app_bar_main.*
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jetbrains.anko.uiThread
|
import org.jetbrains.anko.uiThread
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cColor
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cCourse
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cCourseTTLinkList
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableCurrentWeek
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableNextWeek
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cWeekMenus
|
||||||
import org.mosad.seil0.projectlaogai.fragments.*
|
import org.mosad.seil0.projectlaogai.fragments.*
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.*
|
import org.mosad.seil0.projectlaogai.hsoparser.MensaParser
|
||||||
|
import org.mosad.seil0.projectlaogai.hsoparser.TimeTableParser
|
||||||
import kotlin.system.measureTimeMillis
|
import kotlin.system.measureTimeMillis
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
|
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
private val mensaParser = MensaParser()
|
private val mensaParser = MensaParser()
|
||||||
private val timeTableParser = TimeTableParser()
|
private val timeTableParser = TimeTableParser()
|
||||||
|
private var activeFragment: Fragment = HomeFragment() // the currently active fragment, home at the start
|
||||||
private var weekMenus = ArrayList<Meal>()
|
|
||||||
private var courseTTLinkList = ArrayList<CourseTTLink>()
|
|
||||||
private var timeTableCurrentWeek = arrayOf<Array<Lesson>>()
|
|
||||||
private var timeTableNextWeek = arrayOf<Array<Lesson>>()
|
|
||||||
|
|
||||||
private lateinit var course: CourseTTLink
|
|
||||||
private var color: Int = Color.BLACK
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
Aesthetic.attach(this)
|
Aesthetic.attach(this)
|
||||||
@ -73,17 +74,15 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Aesthetic.config {
|
Aesthetic.config {
|
||||||
colorPrimary(color)
|
colorPrimary(cColor)
|
||||||
colorPrimaryDark(color)
|
colorPrimaryDark(cColor)
|
||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//init home fragment TODO make a abstract fragment class
|
//init home fragment
|
||||||
val homeFragment = HomeFragment()
|
|
||||||
homeFragment.setMainActivity(this)
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
||||||
fragmentTransaction.replace(R.id.fragment_container, homeFragment)
|
fragmentTransaction.replace(R.id.fragment_container, activeFragment)
|
||||||
fragmentTransaction.commit()
|
fragmentTransaction.commit()
|
||||||
|
|
||||||
val toggle = ActionBarDrawerToggle(
|
val toggle = ActionBarDrawerToggle(
|
||||||
@ -133,93 +132,36 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
|||||||
// Handle navigation view item clicks here.
|
// Handle navigation view item clicks here.
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.nav_home -> {
|
R.id.nav_home -> {
|
||||||
val homeFragment = HomeFragment()
|
activeFragment = HomeFragment()
|
||||||
homeFragment.setMainActivity(this)
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
|
||||||
fragmentTransaction.replace(R.id.fragment_container, homeFragment)
|
|
||||||
fragmentTransaction.commit()
|
|
||||||
}
|
}
|
||||||
R.id.nav_mensa -> {
|
R.id.nav_mensa -> {
|
||||||
val mensaFragment = MensaFragment()
|
activeFragment = MensaFragment()
|
||||||
mensaFragment.setMainActivity(this)
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
|
||||||
fragmentTransaction.replace(R.id.fragment_container, mensaFragment)
|
|
||||||
fragmentTransaction.commit()
|
|
||||||
}
|
}
|
||||||
R.id.nav_timetable -> {
|
R.id.nav_timetable -> {
|
||||||
val timeTableFragment = TimeTableFragment()
|
activeFragment = TimeTableFragment()
|
||||||
timeTableFragment.setMainActivity(this)
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
|
||||||
fragmentTransaction.replace(R.id.fragment_container, timeTableFragment)
|
|
||||||
fragmentTransaction.commit()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
R.id.nav_moodle -> {
|
R.id.nav_moodle -> {
|
||||||
val moodleFragment = MoodleFragment()
|
activeFragment = MoodleFragment()
|
||||||
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
|
||||||
fragmentTransaction.replace(R.id.fragment_container, moodleFragment)
|
|
||||||
fragmentTransaction.commit()
|
|
||||||
}
|
}
|
||||||
R.id.nav_settings -> {
|
R.id.nav_settings -> {
|
||||||
val settingsFragment = SettingsFragment()
|
activeFragment = SettingsFragment()
|
||||||
settingsFragment.setMainActivity(this)
|
|
||||||
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
|
||||||
fragmentTransaction.replace(R.id.fragment_container, settingsFragment)
|
|
||||||
fragmentTransaction.commit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
|
||||||
|
fragmentTransaction.replace(R.id.fragment_container, activeFragment)
|
||||||
|
fragmentTransaction.commit()
|
||||||
|
|
||||||
drawer_layout.closeDrawer(GravityCompat.START)
|
drawer_layout.closeDrawer(GravityCompat.START)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* update the gui with the data of the new selected course
|
|
||||||
* save selected course and courseTTLink
|
|
||||||
*/
|
|
||||||
fun updateCourse(course: CourseTTLink) {
|
|
||||||
println(course.course)
|
|
||||||
println(course.courseTTLink)
|
|
||||||
|
|
||||||
this.course = course
|
|
||||||
// save new selected course
|
|
||||||
val sharedPref = getPreferences(MODE_PRIVATE) ?: return
|
|
||||||
with (sharedPref.edit()) {
|
|
||||||
putString(getString(R.string.save_key_course), course.course)
|
|
||||||
putString(getString(R.string.save_key_courseTTLink), course.courseTTLink.replace("http", "https"))
|
|
||||||
apply()
|
|
||||||
}
|
|
||||||
|
|
||||||
timeTableCurrentWeek = timeTableParser.getTimeTable(course.courseTTLink.replace("http", "https"))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* save the primary color
|
|
||||||
*/
|
|
||||||
fun saveColorPrimary(color : Int) {
|
|
||||||
val sharedPref = getPreferences(MODE_PRIVATE) ?: return
|
|
||||||
with (sharedPref.edit()) {
|
|
||||||
putInt(getString(R.string.save_key_colorPrimary), color)
|
|
||||||
apply()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load the mensa menus of the current week
|
* load the mensa menus of the current week
|
||||||
*/
|
*/
|
||||||
private fun load() {
|
private fun load() {
|
||||||
|
// load the settings
|
||||||
// load saved course
|
PreferencesController.load(this) // this must be finished before doing anything else
|
||||||
val sharedPref = getPreferences(MODE_PRIVATE) ?: return
|
|
||||||
course = CourseTTLink(
|
|
||||||
sharedPref.getString(getString(R.string.save_key_courseTTLink),
|
|
||||||
"https://www.hs-offenburg.de/index.php?id=6627&class=class&iddV=DA64F6FE-9DDB-429E-A677-05D0D40CB636&week=0")!!,
|
|
||||||
sharedPref.getString(getString(R.string.save_key_course), "AI3")!!
|
|
||||||
)
|
|
||||||
|
|
||||||
// load saved color
|
|
||||||
color = sharedPref.getInt(getString(R.string.save_key_colorPrimary), Color.BLACK)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load mensa, course timetable and courselist from the swfr/hso website
|
* load mensa, course timetable and courselist from the swfr/hso website
|
||||||
@ -231,16 +173,17 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
|||||||
* we need have time until the user opens the dialog
|
* we need have time until the user opens the dialog
|
||||||
*/
|
*/
|
||||||
doAsync {
|
doAsync {
|
||||||
courseTTLinkList = timeTableParser.getCourseTTLinks()
|
cCourseTTLinkList = timeTableParser.getCourseTTLinks()
|
||||||
}
|
}
|
||||||
|
|
||||||
val jobMenus = doAsync {
|
val jobMenus = doAsync {
|
||||||
weekMenus = mensaParser.getMensaMenu()
|
cWeekMenus = mensaParser.getMensaMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
val jobTTCurrentWeek = doAsync {
|
val jobTTCurrentWeek = doAsync {
|
||||||
try {
|
try {
|
||||||
timeTableCurrentWeek = timeTableParser.getTimeTable(course.courseTTLink)
|
cTimeTableCurrentWeek = timeTableParser.getTimeTable(cCourse.courseLink)
|
||||||
|
timeTableParser.printTimeTableWeek(cTimeTableCurrentWeek)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
||||||
uiThread {
|
uiThread {
|
||||||
@ -256,7 +199,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
|||||||
|
|
||||||
val jobTTNextWeek = doAsync {
|
val jobTTNextWeek = doAsync {
|
||||||
try {
|
try {
|
||||||
timeTableNextWeek = timeTableParser.getTimeTable(course.courseTTLink.replace("week=0","week=1"))
|
cTimeTableNextWeek = timeTableParser.getTimeTable(cCourse.courseLink.replace("week=0","week=1"))
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.stackTrace
|
e.stackTrace
|
||||||
}
|
}
|
||||||
@ -269,28 +212,4 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
|||||||
println("Completed in $time ms")
|
println("Completed in $time ms")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCourseTTLinkList(): ArrayList<CourseTTLink>{
|
|
||||||
return courseTTLinkList
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getTimeTableCurrentWeek(): Array<Array<Lesson>> {
|
|
||||||
return timeTableCurrentWeek
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getTimeTableNextWeek(): Array<Array<Lesson>> {
|
|
||||||
return timeTableNextWeek
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getWeekMenu(): ArrayList<Meal>{
|
|
||||||
return weekMenus
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getCourse(): CourseTTLink {
|
|
||||||
return course
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getColorPrimary(): Int {
|
|
||||||
return color
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* ProjectLaogai
|
||||||
|
*
|
||||||
|
* Copyright 2019 <seil0@mosad.xyz>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.mosad.seil0.projectlaogai
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import org.jetbrains.anko.defaultSharedPreferences
|
||||||
|
import org.mosad.seil0.projectlaogai.hsoparser.Course
|
||||||
|
import org.mosad.seil0.projectlaogai.hsoparser.Meal
|
||||||
|
import org.mosad.seil0.projectlaogai.hsoparser.TimeTable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The PreferencesController class
|
||||||
|
* contains all preferences and global variables that exist in this app
|
||||||
|
*/
|
||||||
|
class PreferencesController {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
var cCourseTTLinkList = ArrayList<Course>()
|
||||||
|
var cWeekMenus = ArrayList<Meal>()
|
||||||
|
var cTimeTableCurrentWeek = TimeTable()
|
||||||
|
var cTimeTableNextWeek = TimeTable()
|
||||||
|
var cColor: Int = Color.BLACK
|
||||||
|
var cCourse = Course("https://www.hs-offenburg.de/index.php?id=6627&class=class&iddV=DA64F6FE-9DDB-429E-A677-05D0D40CB636&week=0", "AI3")
|
||||||
|
|
||||||
|
// the save function
|
||||||
|
fun save(context: Context) {
|
||||||
|
println(cCourse.courseLink)
|
||||||
|
// save the course
|
||||||
|
val sharedPref = context.defaultSharedPreferences
|
||||||
|
with (sharedPref.edit()) {
|
||||||
|
putString(context.getString(R.string.save_key_course), cCourse.courseName)
|
||||||
|
putString(context.getString(R.string.save_key_courseTTLink), cCourse.courseLink)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
// save the primary color
|
||||||
|
with (sharedPref.edit()) {
|
||||||
|
putInt(context.getString(R.string.save_key_colorPrimary), cColor)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// the load function
|
||||||
|
fun load(context: Context) {
|
||||||
|
// load saved course
|
||||||
|
val sharedPref = context.defaultSharedPreferences
|
||||||
|
cCourse = Course(
|
||||||
|
sharedPref.getString(context.getString(R.string.save_key_courseTTLink), "https://www.hs-offenburg.de/index.php?id=6627&class=class&iddV=DA64F6FE-9DDB-429E-A677-05D0D40CB636&week=0")!!,
|
||||||
|
sharedPref.getString(context.getString(R.string.save_key_course), "AI3")!!
|
||||||
|
)
|
||||||
|
|
||||||
|
// load saved color
|
||||||
|
cColor = sharedPref.getInt(context.getString(R.string.save_key_colorPrimary), Color.BLACK)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -32,10 +32,12 @@ import com.afollestad.materialdialogs.MaterialDialog
|
|||||||
import kotlinx.android.synthetic.main.fragment_home.*
|
import kotlinx.android.synthetic.main.fragment_home.*
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jetbrains.anko.uiThread
|
import org.jetbrains.anko.uiThread
|
||||||
import org.mosad.seil0.projectlaogai.MainActivity
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableCurrentWeek
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cWeekMenus
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.*
|
import org.mosad.seil0.projectlaogai.hsoparser.*
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
||||||
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonTextView
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +47,6 @@ import java.util.*
|
|||||||
class HomeFragment : Fragment() {
|
class HomeFragment : Fragment() {
|
||||||
|
|
||||||
private lateinit var linLayoutTimeTable: LinearLayout
|
private lateinit var linLayoutTimeTable: LinearLayout
|
||||||
private var mainActivity = MainActivity()
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
|
||||||
@ -71,9 +72,9 @@ class HomeFragment : Fragment() {
|
|||||||
val cal = Calendar.getInstance()
|
val cal = Calendar.getInstance()
|
||||||
|
|
||||||
if (cal.get(Calendar.HOUR_OF_DAY) < 15) {
|
if (cal.get(Calendar.HOUR_OF_DAY) < 15) {
|
||||||
dayMenus = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), cal.get(Calendar.DAY_OF_WEEK))
|
dayMenus = MensaParser().getMensaMenuDay(cWeekMenus, cal.get(Calendar.DAY_OF_WEEK))
|
||||||
} else {
|
} else {
|
||||||
dayMenus = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), cal.get(Calendar.DAY_OF_WEEK) + 1)
|
dayMenus = MensaParser().getMensaMenuDay(cWeekMenus, cal.get(Calendar.DAY_OF_WEEK) + 1)
|
||||||
uiThread {
|
uiThread {
|
||||||
txtView_Menu1Heading.text = resources.getString(R.string.meal_1_tomorrow)
|
txtView_Menu1Heading.text = resources.getString(R.string.meal_1_tomorrow)
|
||||||
txtView_Menu2Heading.text = resources.getString(R.string.meal_2_tomorrow)
|
txtView_Menu2Heading.text = resources.getString(R.string.meal_2_tomorrow)
|
||||||
@ -122,34 +123,48 @@ class HomeFragment : Fragment() {
|
|||||||
private fun addCurrentTimeTable() {
|
private fun addCurrentTimeTable() {
|
||||||
val dayIndex = NotRetardedCalendar().getDayOfWeekIndex()
|
val dayIndex = NotRetardedCalendar().getDayOfWeekIndex()
|
||||||
|
|
||||||
if (mainActivity.getTimeTableCurrentWeek().isNotEmpty() && dayIndex < 6) {
|
if (cTimeTableCurrentWeek.days.isNotEmpty() && dayIndex < 6) {
|
||||||
|
|
||||||
val timeTableDay = mainActivity.getTimeTableCurrentWeek()[dayIndex]
|
val timeTableDay = cTimeTableCurrentWeek.days[dayIndex]
|
||||||
|
|
||||||
for (i in 0..5) {
|
// for all timeslots of the day
|
||||||
|
for ((i, timeslot) in timeTableDay.timeslots.withIndex()) {
|
||||||
val lessonCardView = LessonCardView(context!!, null)
|
val lessonCardView = LessonCardView(context!!, null)
|
||||||
|
|
||||||
lessonCardView.getTxtViewLesson().text = resources.getString(R.string.string_new_line, timeTableDay[i].lessonSubject)
|
|
||||||
lessonCardView.getTxtViewLesson().append(timeTableDay[i].lessonTeacher + "\n")
|
|
||||||
lessonCardView.getTxtViewLesson().append(timeTableDay[i].lessonRoom)
|
|
||||||
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
||||||
|
|
||||||
if(lessonCardView.getTxtViewLesson().text.length > 2)
|
for (lesson in timeslot) {
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setLesson(lesson)
|
||||||
|
|
||||||
|
// TODO why does this exist
|
||||||
|
if (lessonTxtView.text.length > 3)
|
||||||
|
lessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lessonCardView.getLinLayoutLesson().childCount > 2)
|
||||||
linLayoutTimeTable.addView(lessonCardView)
|
linLayoutTimeTable.addView(lessonCardView)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a card if there is no lesson today
|
// add a card if there is no lesson today
|
||||||
if (linLayoutTimeTable.childCount == 0) {
|
if (linLayoutTimeTable.childCount == 0) {
|
||||||
// TODO we could display the next day with a lecture
|
// TODO we could display the next day with a lecture
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setText(resources.getString(R.string.no_lesson_today))
|
||||||
|
|
||||||
val noLessonCardView = LessonCardView(context!!, null)
|
val noLessonCardView = LessonCardView(context!!, null)
|
||||||
noLessonCardView.getTxtViewLesson().text = resources.getString(R.string.no_lesson_today)
|
noLessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
|
||||||
linLayoutTimeTable.addView(noLessonCardView)
|
linLayoutTimeTable.addView(noLessonCardView)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dayIndex == 6) {
|
if (dayIndex == 6) {
|
||||||
// if that's the case it's sunday
|
// if that's the case it's sunday
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setText(resources.getString(R.string.no_lesson_today))
|
||||||
|
|
||||||
val noLessonCardView = LessonCardView(context!!, null)
|
val noLessonCardView = LessonCardView(context!!, null)
|
||||||
noLessonCardView.getTxtViewLesson().text = resources.getString(R.string.no_lesson_today)
|
noLessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
|
||||||
linLayoutTimeTable.addView(noLessonCardView)
|
linLayoutTimeTable.addView(noLessonCardView)
|
||||||
} else {
|
} else {
|
||||||
MaterialDialog(context!!)
|
MaterialDialog(context!!)
|
||||||
@ -162,8 +177,4 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMainActivity(mainActivity: MainActivity) {
|
|
||||||
this.mainActivity = mainActivity
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import android.view.ViewGroup
|
|||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jetbrains.anko.uiThread
|
import org.jetbrains.anko.uiThread
|
||||||
import org.mosad.seil0.projectlaogai.MainActivity
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cWeekMenus
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.MensaDayCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.MensaDayCardView
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.MenuCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.MenuCardView
|
||||||
@ -43,7 +43,6 @@ import java.util.*
|
|||||||
class MensaFragment : Fragment() {
|
class MensaFragment : Fragment() {
|
||||||
|
|
||||||
private lateinit var linLayoutMensaFragment: LinearLayout
|
private lateinit var linLayoutMensaFragment: LinearLayout
|
||||||
private var mainActivity = MainActivity()
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ class MensaFragment : Fragment() {
|
|||||||
val cardViewMensaDay = MensaDayCardView(context!!, null)
|
val cardViewMensaDay = MensaDayCardView(context!!, null)
|
||||||
var add = false
|
var add = false
|
||||||
|
|
||||||
for (meal in mainActivity.getWeekMenu()) {
|
for (meal in cWeekMenus) {
|
||||||
//println("Day: " + meal.day)
|
//println("Day: " + meal.day)
|
||||||
if (meal.day.contains(strDay)) {
|
if (meal.day.contains(strDay)) {
|
||||||
|
|
||||||
@ -112,8 +111,4 @@ class MensaFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMainActivity(mainActivity: MainActivity) {
|
|
||||||
this.mainActivity = mainActivity
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,11 @@ package org.mosad.seil0.projectlaogai.fragments
|
|||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
import com.afollestad.aesthetic.Aesthetic
|
import com.afollestad.aesthetic.Aesthetic
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
import com.afollestad.materialdialogs.color.colorChooser
|
import com.afollestad.materialdialogs.color.colorChooser
|
||||||
@ -37,10 +37,15 @@ import com.afollestad.materialdialogs.list.listItems
|
|||||||
import kotlinx.android.synthetic.main.fragment_settings.*
|
import kotlinx.android.synthetic.main.fragment_settings.*
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jetbrains.anko.uiThread
|
import org.jetbrains.anko.uiThread
|
||||||
import org.mosad.seil0.projectlaogai.MainActivity
|
import org.mosad.seil0.projectlaogai.PreferencesController
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cColor
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cCourse
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cCourseTTLinkList
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableCurrentWeek
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableNextWeek
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.CourseTTLink
|
import org.mosad.seil0.projectlaogai.hsoparser.TimeTableParser
|
||||||
import java.util.ArrayList
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The settings controller class
|
* The settings controller class
|
||||||
@ -53,9 +58,6 @@ class SettingsFragment : Fragment() {
|
|||||||
private lateinit var linLayoutInfo: LinearLayout
|
private lateinit var linLayoutInfo: LinearLayout
|
||||||
private lateinit var linLayoutMainColor: LinearLayout
|
private lateinit var linLayoutMainColor: LinearLayout
|
||||||
private lateinit var viewPrimaryColor: View
|
private lateinit var viewPrimaryColor: View
|
||||||
private lateinit var courseTTLinkList: ArrayList<CourseTTLink>
|
|
||||||
private var mainActivity = MainActivity()
|
|
||||||
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
|
||||||
@ -76,7 +78,7 @@ class SettingsFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
txtView_Course.text = mainActivity.getCourse().course
|
txtView_Course.text = cCourse.courseName
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,12 +93,11 @@ class SettingsFragment : Fragment() {
|
|||||||
// open a new dialog
|
// open a new dialog
|
||||||
val courseList = ArrayList<String>()
|
val courseList = ArrayList<String>()
|
||||||
|
|
||||||
courseTTLinkList = mainActivity.getCourseTTLinkList()
|
cCourseTTLinkList.forEach { (_, course) ->
|
||||||
courseTTLinkList.forEach { (_, course) ->
|
|
||||||
courseList.add(course)
|
courseList.add(course)
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialDialog(context!!).listItems(items = courseList){ _, index, text ->
|
MaterialDialog(context!!).listItems(items = courseList) { _, index, text ->
|
||||||
txtView_Course.text = text // update txtView
|
txtView_Course.text = text // update txtView
|
||||||
|
|
||||||
val dialog = MaterialDialog(context!!).cancelable(false)
|
val dialog = MaterialDialog(context!!).cancelable(false)
|
||||||
@ -105,7 +106,12 @@ class SettingsFragment : Fragment() {
|
|||||||
dialog.show()
|
dialog.show()
|
||||||
|
|
||||||
doAsync {
|
doAsync {
|
||||||
mainActivity.updateCourse(courseTTLinkList[index])
|
cCourse = cCourseTTLinkList[index] // set the course
|
||||||
|
PreferencesController.save(context!!)
|
||||||
|
|
||||||
|
// update current & next weeks timetable
|
||||||
|
cTimeTableCurrentWeek = TimeTableParser().getTimeTable(cCourse.courseLink)
|
||||||
|
cTimeTableNextWeek = TimeTableParser().getTimeTable(cCourse.courseLink.replace("week=0","week=1"))
|
||||||
|
|
||||||
uiThread {
|
uiThread {
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
@ -113,7 +119,7 @@ class SettingsFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
linLayoutInfo.setOnClickListener {
|
linLayoutInfo.setOnClickListener {
|
||||||
@ -130,7 +136,7 @@ class SettingsFragment : Fragment() {
|
|||||||
|
|
||||||
MaterialDialog(context!!)
|
MaterialDialog(context!!)
|
||||||
.title(R.string.primary_color)
|
.title(R.string.primary_color)
|
||||||
.colorChooser(colors, allowCustomArgb = true,initialSelection = mainActivity.getColorPrimary()) { _, color ->
|
.colorChooser(colors, allowCustomArgb = true, initialSelection = cColor) { _, color ->
|
||||||
viewPrimaryColor.setBackgroundColor(color)
|
viewPrimaryColor.setBackgroundColor(color)
|
||||||
Aesthetic.config {
|
Aesthetic.config {
|
||||||
colorPrimary(color)
|
colorPrimary(color)
|
||||||
@ -138,15 +144,12 @@ class SettingsFragment : Fragment() {
|
|||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
mainActivity.saveColorPrimary(color)
|
cColor = color
|
||||||
|
PreferencesController.save(context!!)
|
||||||
}
|
}
|
||||||
.positiveButton(R.string.select)
|
.positiveButton(R.string.select)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMainActivity(mainActivity: MainActivity) {
|
|
||||||
this.mainActivity = mainActivity
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,20 +22,21 @@
|
|||||||
|
|
||||||
package org.mosad.seil0.projectlaogai.fragments
|
package org.mosad.seil0.projectlaogai.fragments
|
||||||
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
import org.jetbrains.anko.doAsync
|
import org.jetbrains.anko.doAsync
|
||||||
import org.jetbrains.anko.uiThread
|
import org.jetbrains.anko.uiThread
|
||||||
import org.mosad.seil0.projectlaogai.MainActivity
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableCurrentWeek
|
||||||
|
import org.mosad.seil0.projectlaogai.PreferencesController.Companion.cTimeTableNextWeek
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.DataTypes
|
import org.mosad.seil0.projectlaogai.hsoparser.DataTypes
|
||||||
import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
|
import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
||||||
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonTextView
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.MensaDayCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.MensaDayCardView
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -47,7 +48,6 @@ import java.util.*
|
|||||||
class TimeTableFragment : Fragment() {
|
class TimeTableFragment : Fragment() {
|
||||||
|
|
||||||
private lateinit var linLayoutTTFragment: LinearLayout
|
private lateinit var linLayoutTTFragment: LinearLayout
|
||||||
private var mainActivity = MainActivity()
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class TimeTableFragment : Fragment() {
|
|||||||
|
|
||||||
linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment)
|
linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment)
|
||||||
|
|
||||||
if (mainActivity.getTimeTableCurrentWeek().isNotEmpty()) {
|
if (cTimeTableCurrentWeek.days.isNotEmpty()) {
|
||||||
addCurrentWeek()
|
addCurrentWeek()
|
||||||
} else {
|
} else {
|
||||||
// TODO show card with error msg
|
// TODO show card with error msg
|
||||||
@ -77,63 +77,88 @@ class TimeTableFragment : Fragment() {
|
|||||||
uiThread {
|
uiThread {
|
||||||
|
|
||||||
// add current weeks days
|
// add current weeks days
|
||||||
for(day in dayIndex..5) {
|
for (day in dayIndex..5) {
|
||||||
val cardViewTimeTableDay = MensaDayCardView(context!!, null)
|
val cardViewTimeTableDay = MensaDayCardView(context!!, null)
|
||||||
cardViewTimeTableDay.setDayHeading(formatter.format(calendar.time))
|
cardViewTimeTableDay.setDayHeading(formatter.format(calendar.time))
|
||||||
|
|
||||||
// for each lessen of the day
|
// for each timeslot of the day
|
||||||
for((i, lesson) in mainActivity.getTimeTableCurrentWeek()[day].withIndex()) {
|
for ((i, timeslot) in cTimeTableCurrentWeek.days[day].timeslots.withIndex()) {
|
||||||
val lessonCardView = LessonCardView(context!!, null)
|
val lessonCardView = LessonCardView(context!!, null)
|
||||||
lessonCardView.setBackgroundColor(Color.TRANSPARENT)
|
|
||||||
|
|
||||||
lessonCardView.getTxtViewLesson().text = resources.getString(R.string.string_new_line, lesson.lessonSubject)
|
|
||||||
lessonCardView.getTxtViewLesson().append(lesson.lessonTeacher + "\n")
|
|
||||||
lessonCardView.getTxtViewLesson().append(lesson.lessonRoom)
|
|
||||||
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
||||||
|
|
||||||
|
//println(timeslot)
|
||||||
|
|
||||||
|
for (lesson in timeslot) {
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setLesson(lesson)
|
||||||
|
|
||||||
|
// TODO why does this exist
|
||||||
|
if (lessonTxtView.text.length > 3)
|
||||||
|
lessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
}
|
||||||
|
|
||||||
// only add the lesson if it contains data
|
// only add the lesson if it contains data
|
||||||
if(lessonCardView.getTxtViewLesson().text.length > 2)
|
if (lessonCardView.getLinLayoutLesson().childCount > 1)
|
||||||
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
||||||
}
|
}
|
||||||
|
|
||||||
calendar.add(Calendar.DATE,1)
|
calendar.add(Calendar.DATE, 1)
|
||||||
|
|
||||||
// if the day contains no lessons add a text "No lesson today"
|
// if the day contains no lessons add a text "No lesson today"
|
||||||
if (cardViewTimeTableDay.getLinLayoutMensaDay().childCount <= 1) {
|
if (cardViewTimeTableDay.getLinLayoutMensaDay().childCount <= 1) {
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setText(resources.getString(R.string.no_lesson_today))
|
||||||
|
|
||||||
val lessonCardView = LessonCardView(context!!, null)
|
val lessonCardView = LessonCardView(context!!, null)
|
||||||
lessonCardView.setBackgroundColor(Color.TRANSPARENT)
|
lessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
lessonCardView.getTxtViewLesson().text = resources.getString(R.string.no_lesson_today)
|
|
||||||
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
||||||
}
|
}
|
||||||
|
|
||||||
linLayoutTTFragment.addView(cardViewTimeTableDay)
|
linLayoutTTFragment.addView(cardViewTimeTableDay)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO if there is no lesson at one day , show a no lesson card
|
|
||||||
// add next weeks days, max number = dayIndex, if timetable was loaded
|
// add next weeks days, max number = dayIndex, if timetable was loaded
|
||||||
if (mainActivity.getTimeTableNextWeek().isNotEmpty()) {
|
if (cTimeTableNextWeek.days.isNotEmpty()) {
|
||||||
calendar.add(Calendar.DATE,1) // before this we are at a sunday (no lecture on sundays!)
|
calendar.add(Calendar.DATE, 1) // before this we are at a sunday (no lecture on sundays!)
|
||||||
|
|
||||||
for(day in 0..(dayIndex - 1)) {
|
for (day in 0..(dayIndex - 1)) {
|
||||||
|
|
||||||
val cardViewTimeTableDay = MensaDayCardView(context!!, null)
|
val cardViewTimeTableDay = MensaDayCardView(context!!, null)
|
||||||
cardViewTimeTableDay.setDayHeading(formatter.format(calendar.time))
|
cardViewTimeTableDay.setDayHeading(formatter.format(calendar.time))
|
||||||
|
|
||||||
// for each lessen of the day
|
// for each timeslot of the day
|
||||||
for((i, lesson) in mainActivity.getTimeTableNextWeek()[day].withIndex()) {
|
for ((i, timeslot) in cTimeTableNextWeek.days[day].timeslots.withIndex()) {
|
||||||
val lessonCardView = LessonCardView(context!!, null)
|
val lessonCardView = LessonCardView(context!!, null)
|
||||||
lessonCardView.setBackgroundColor(Color.TRANSPARENT)
|
|
||||||
|
|
||||||
lessonCardView.getTxtViewLesson().text = resources.getString(R.string.string_new_line, lesson.lessonSubject)
|
|
||||||
lessonCardView.getTxtViewLesson().append(lesson.lessonTeacher + "\n")
|
|
||||||
lessonCardView.getTxtViewLesson().append(lesson.lessonRoom)
|
|
||||||
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
|
||||||
|
|
||||||
if(lessonCardView.getTxtViewLesson().text.length > 2)
|
|
||||||
|
for (lesson in timeslot) {
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setLesson(lesson)
|
||||||
|
|
||||||
|
if (lessonTxtView.text.length > 3)
|
||||||
|
lessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
}
|
||||||
|
|
||||||
|
// only add the lesson if it contains data
|
||||||
|
if (lessonCardView.getLinLayoutLesson().childCount > 1)
|
||||||
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
||||||
}
|
}
|
||||||
|
|
||||||
calendar.add(Calendar.DATE,1)
|
calendar.add(Calendar.DATE, 1)
|
||||||
|
|
||||||
|
// if the day contains no lessons add a text "No lesson today"
|
||||||
|
if (cardViewTimeTableDay.getLinLayoutMensaDay().childCount <= 1) {
|
||||||
|
val lessonTxtView = LessonTextView(context!!)
|
||||||
|
lessonTxtView.setText(resources.getString(R.string.no_lesson_today))
|
||||||
|
|
||||||
|
val lessonCardView = LessonCardView(context!!, null)
|
||||||
|
lessonCardView.getLinLayoutLesson().addView(lessonTxtView)
|
||||||
|
|
||||||
|
cardViewTimeTableDay.getLinLayoutMensaDay().addView(lessonCardView)
|
||||||
|
}
|
||||||
|
|
||||||
linLayoutTTFragment.addView(cardViewTimeTableDay)
|
linLayoutTTFragment.addView(cardViewTimeTableDay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,8 +168,4 @@ class TimeTableFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMainActivity(mainActivity: MainActivity) {
|
|
||||||
this.mainActivity = mainActivity
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,12 @@ class NotRetardedCalendar {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class Course(val courseLink: String, val courseName: String)
|
||||||
|
|
||||||
|
data class Meal(val day: String, val heading: String, val parts: ArrayList<String>, val additives: String)
|
||||||
|
|
||||||
data class Lesson(val lessonSubject: String, val lessonTeacher: String, val lessonRoom:String, val lessonRemark: String)
|
data class Lesson(val lessonSubject: String, val lessonTeacher: String, val lessonRoom:String, val lessonRemark: String)
|
||||||
|
|
||||||
data class CourseTTLink(val courseTTLink: String, val course: String)
|
data class TimeTableDay( val timeslots: Array<ArrayList<Lesson>> = Array(6) { ArrayList<Lesson>()})
|
||||||
|
|
||||||
data class Meal(val day: String, val heading: String, val parts: ArrayList<String>, val additives: String)
|
data class TimeTable(val days: Array<TimeTableDay> = Array(6) { TimeTableDay() })
|
@ -26,16 +26,12 @@ import org.jsoup.Jsoup
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MensaParser {
|
class MensaParser {
|
||||||
private var mealList = ArrayList<Meal>()
|
|
||||||
|
|
||||||
init {
|
|
||||||
// do something
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the mensa menu for the whole week
|
* returns the mensa menu for the whole week
|
||||||
*/
|
*/
|
||||||
fun getMensaMenu(): ArrayList<Meal> {
|
fun getMensaMenu(): ArrayList<Meal> {
|
||||||
|
val mealList = ArrayList<Meal>()
|
||||||
val menuHTML = Jsoup.connect("https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/").get()
|
val menuHTML = Jsoup.connect("https://www.swfr.de/de/essen-trinken/speiseplaene/mensa-offenburg/").get()
|
||||||
|
|
||||||
menuHTML.select("#speiseplan-tabs").select("div.tab-content").select("div.menu-tagesplan").forEachIndexed { _, element ->
|
menuHTML.select("#speiseplan-tabs").select("div.tab-content").select("div.menu-tagesplan").forEachIndexed { _, element ->
|
||||||
|
@ -26,50 +26,98 @@ import org.jsoup.Jsoup
|
|||||||
|
|
||||||
class TimeTableParser {
|
class TimeTableParser {
|
||||||
private val days = arrayOf("Monday", "Tuesday" ,"Wednesday", "Thursday", "Friday", "Saturday")
|
private val days = arrayOf("Monday", "Tuesday" ,"Wednesday", "Thursday", "Friday", "Saturday")
|
||||||
private var courseTTLinkList = ArrayList<CourseTTLink>()
|
private var courseTTLinkList = ArrayList<Course>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the timetable from the given url
|
* get the timetable from the given url
|
||||||
* the timetable is organised per row not per column;
|
* the timetable is organised per row not per column;
|
||||||
* Mon 1, Tue 1, Wed 1, Thur 1, Fri 1, Sat 1, Mon 2 and so on
|
* Mon 1, Tue 1, Wed 1, Thur 1, Fri 1, Sat 1, Mon 2 and so on
|
||||||
*/
|
*/
|
||||||
fun getTimeTable(courseTTURL: String): Array<Array<Lesson>> {
|
fun getTimeTable(courseTTURL: String): TimeTable {
|
||||||
var timeTableWeek = arrayOf<Array<Lesson>>()
|
var timeTableWeek = TimeTable() // this must be a var!
|
||||||
val scheduleHTML = Jsoup.connect(courseTTURL).get()
|
val scheduleHTML = Jsoup.connect(courseTTURL).get()
|
||||||
|
|
||||||
// create the timetable array
|
// create the timetable array
|
||||||
for (i in 0..5) {
|
/* for (i in 0..5) {
|
||||||
var timeTableDay = arrayOf<Lesson>()
|
var timeTableDay = arrayOf<Lesson>()
|
||||||
for (j in 0..5) {
|
for (j in 0..5) {
|
||||||
timeTableDay += Lesson("", "","","")
|
timeTableDay += Lesson("", "","","")
|
||||||
}
|
}
|
||||||
timeTableWeek += timeTableDay
|
timeTableWeek += timeTableDay
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//val week = scheduleHTML.select("h1.timetable-caption").text()
|
//val week = scheduleHTML.select("h1.timetable-caption").text()
|
||||||
//println("$week successful!\n")
|
//println("$week successful!\n")
|
||||||
|
|
||||||
scheduleHTML.select("table.timetable").select("td.lastcol").forEachIndexed { index, element ->
|
val rows= scheduleHTML.select("table.timetable").select("tr[scope=\"row\"]")
|
||||||
timeTableWeek[index % 6][index / 6] = Lesson(element.select("div.lesson-subject").text(), element.select("div.lesson-teacher").text(), element.select("div.lesson-room").text(), element.select("div.lesson-remark").text())
|
var sDay = -1
|
||||||
|
var sRow = -1
|
||||||
|
var sLesson = Lesson("", "", "", "")
|
||||||
|
|
||||||
|
// get each row with index, reflects 1 timeslot per day
|
||||||
|
for ((rowIndex, row) in rows.withIndex()) {
|
||||||
|
var day = 0
|
||||||
|
|
||||||
|
row.select("td.lastcol, td[style]").forEach { element ->
|
||||||
|
// elements are now all lessons, including empty ones
|
||||||
|
|
||||||
|
//println("-------------> Element (Day.Timeslot: " + day + "." + rowIndex + "): " + element)
|
||||||
|
//println("Day.Timeslot: " + day + "." + rowIndex + " lesson: " + element.select("div.lesson-subject").text() + ", " + element.select("div.lesson-teacher").text())
|
||||||
|
|
||||||
|
// if there is a lecture with rowspan="2", we need to shift everything by one to the left. This is stupid and ugly there needs to bee an API
|
||||||
|
if ((sDay > -1 && sRow > -1) && (sDay == day && ((sRow + 1) == rowIndex))) {
|
||||||
|
// we found a lecture that is longer than 1 lesson
|
||||||
|
timeTableWeek.days[day].timeslots[rowIndex].add(sLesson) // this just works if there is one lecture per slot
|
||||||
|
|
||||||
|
// adjust the following slot
|
||||||
|
sDay++
|
||||||
|
sLesson = Lesson(element.select("div.lesson-subject").text(), element.select("div.lesson-teacher").text(), element.select("div.lesson-room").text(), element.select("div.lesson-remark").text())
|
||||||
|
|
||||||
|
// adjust the slot directly as we don't get there anymore
|
||||||
|
if(sDay == 5) {
|
||||||
|
timeTableWeek.days[day + 1].timeslots[rowIndex].add(sLesson)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
timeTableWeek.days[day].timeslots[rowIndex].add(Lesson(element.select("div.lesson-subject").text(), element.select("div.lesson-teacher").text(), element.select("div.lesson-room").text(), element.select("div.lesson-remark").text()))
|
||||||
|
}
|
||||||
|
|
||||||
|
// we found a lecture with rowspan="2", save day, row and lesson for later adjustment
|
||||||
|
if(element.toString().contains("rowspan=\"2\"")) {
|
||||||
|
sDay = day
|
||||||
|
sRow = rowIndex
|
||||||
|
sLesson = timeTableWeek.days[day].timeslots[rowIndex].get(index = 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(element.hasClass("lastcol")) day++
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printTimeTableWeek(timeTableWeek)
|
||||||
|
|
||||||
|
/*scheduleHTML.select("table.timetable").select("td.lastcol").forEachIndexed { index, element ->
|
||||||
|
//println("Index: " + index + " lesson: " + element.select("div.lesson-subject").text() + ", " + element.select("div.lesson-teacher").text())
|
||||||
|
timeTableWeek[index % 6][index / 6] = Lesson(element.select("div.lesson-subject").text(), element.select("div.lesson-teacher").text(), element.select("div.lesson-room").text(), element.select("div.lesson-remark").text())
|
||||||
|
}*/
|
||||||
|
|
||||||
return timeTableWeek
|
return timeTableWeek
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parse all courses from the courses site at https://www.hs-offenburg.de/studium/vorlesungsplaene/
|
* parse all courses from the courses site at https://www.hs-offenburg.de/studium/vorlesungsplaene/
|
||||||
*/
|
*/
|
||||||
fun getCourseTTLinks(): ArrayList<CourseTTLink> {
|
fun getCourseTTLinks(): ArrayList<Course> {
|
||||||
val courseHTML = Jsoup.connect("https://www.hs-offenburg.de/studium/vorlesungsplaene/").get()
|
val courseHTML = Jsoup.connect("https://www.hs-offenburg.de/studium/vorlesungsplaene/").get()
|
||||||
|
|
||||||
courseHTML.select("ul.index-group").select("li.Class").select("a[href]").forEachIndexed { _, element ->
|
courseHTML.select("ul.index-group").select("li.Class").select("a[href]").forEachIndexed { _, element ->
|
||||||
courseTTLinkList.add(CourseTTLink(element.attr("href"),element.text()))
|
courseTTLinkList.add(Course(element.attr("href").replace("http", "https"),element.text()))
|
||||||
}
|
}
|
||||||
return courseTTLinkList
|
return courseTTLinkList
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
fun printTimeTableWeek (timeTableWeek: Array<Array<Lesson>>) {
|
fun printTimeTableWeekOLD (timeTableWeek: Array<Array<Lesson>>) {
|
||||||
|
|
||||||
for (j in 0..5) print(days[j].padEnd(25 ,' ') + " | ")
|
for (j in 0..5) print(days[j].padEnd(25 ,' ') + " | ")
|
||||||
println()
|
println()
|
||||||
@ -86,7 +134,51 @@ class TimeTableParser {
|
|||||||
for (j in 0..5) print("-".padEnd(26 + (j.toFloat().div(j).toInt()), '-') + "+")
|
for (j in 0..5) print("-".padEnd(26 + (j.toFloat().div(j).toInt()), '-') + "+")
|
||||||
println()
|
println()
|
||||||
}
|
}
|
||||||
|
println(" \n")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
fun printTimeTableWeek(timetable: TimeTable) {
|
||||||
|
for (j in 0..5) print(days[j].padEnd(75 ,' ') + " | ")
|
||||||
println()
|
println()
|
||||||
|
for (j in 0..5) print("-".padEnd(76 + (j.toFloat().div(j).toInt()), '-') + "+")
|
||||||
|
println()
|
||||||
|
|
||||||
|
// the timeslot
|
||||||
|
for (i in 0..5) {
|
||||||
|
|
||||||
|
for (j in 0..5) {
|
||||||
|
val ldiff = if (timetable.days[j].timeslots[i].size == 0) 1 else timetable.days[j].timeslots[i].size
|
||||||
|
|
||||||
|
for (lesson in timetable.days[j].timeslots[i]) print(lesson.lessonSubject.padEnd(75/ldiff ,' '))
|
||||||
|
if (ldiff == 2) print(" ")
|
||||||
|
print(" | ")
|
||||||
|
}
|
||||||
|
println()
|
||||||
|
|
||||||
|
for (j in 0..5) {
|
||||||
|
val ldiff = if (timetable.days[j].timeslots[i].size == 0) 1 else timetable.days[j].timeslots[i].size
|
||||||
|
|
||||||
|
for (lesson in timetable.days[j].timeslots[i]) print(lesson.lessonTeacher.padEnd(75/ldiff ,' '))
|
||||||
|
if (ldiff == 2) print(" ")
|
||||||
|
print(" | ")
|
||||||
|
}
|
||||||
|
println()
|
||||||
|
|
||||||
|
for (j in 0..5) {
|
||||||
|
val ldiff = if (timetable.days[j].timeslots[i].size == 0) 1 else timetable.days[j].timeslots[i].size
|
||||||
|
|
||||||
|
for (lesson in timetable.days[j].timeslots[i]) print(lesson.lessonRoom.padEnd(75/ldiff ,' '))
|
||||||
|
if (ldiff == 2) print(" ")
|
||||||
|
print(" | ")
|
||||||
|
}
|
||||||
|
println()
|
||||||
|
|
||||||
|
for (j in 0..5) print("-".padEnd(76 + (j.toFloat().div(j).toInt()), '-') + "+")
|
||||||
|
println()
|
||||||
|
}
|
||||||
|
|
||||||
|
println(" \n")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -25,26 +25,27 @@ package org.mosad.seil0.projectlaogai.uicomponents
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import org.mosad.seil0.projectlaogai.R
|
import org.mosad.seil0.projectlaogai.R
|
||||||
|
|
||||||
class LessonCardView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : androidx.cardview.widget.CardView(context, attrs){
|
class LessonCardView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : androidx.cardview.widget.CardView(context, attrs){
|
||||||
|
|
||||||
private var txtViewLesson: TextView
|
private var linLayoutLesson: LinearLayout
|
||||||
private var txtViewTime: TextView
|
private var txtViewTime: TextView
|
||||||
|
|
||||||
init {
|
init {
|
||||||
inflate(context, R.layout.lesson_cardview,this)
|
inflate(context, R.layout.lesson_cardview,this)
|
||||||
|
|
||||||
txtViewLesson = findViewById(R.id.txtView_Lesson)
|
linLayoutLesson = findViewById(R.id.linLayout_Lesson)
|
||||||
txtViewTime = findViewById(R.id.txtView_Time)
|
txtViewTime = findViewById(R.id.txtView_Time)
|
||||||
|
|
||||||
// workaround to prevent a white border
|
// workaround to prevent a white border
|
||||||
this.setBackgroundColor(Color.TRANSPARENT)
|
this.setBackgroundColor(Color.TRANSPARENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTxtViewLesson(): TextView {
|
fun getLinLayoutLesson(): LinearLayout {
|
||||||
return txtViewLesson
|
return linLayoutLesson
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTxtViewTime(): TextView {
|
fun getTxtViewTime(): TextView {
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.mosad.seil0.projectlaogai.uicomponents
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.widget.TextView
|
||||||
|
import org.mosad.seil0.projectlaogai.hsoparser.Lesson
|
||||||
|
|
||||||
|
class LessonTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : TextView(context, attrs) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
this.setTextColor(Color.BLACK)
|
||||||
|
this.textSize = 16F
|
||||||
|
this.setPadding(0,6,0,0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setLesson(lesson: Lesson) {
|
||||||
|
this.text = resources.getString(org.mosad.seil0.projectlaogai.R.string.string_new_line, lesson.lessonSubject)
|
||||||
|
this.append(lesson.lessonTeacher + "\n")
|
||||||
|
this.append(lesson.lessonRoom)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setText(text: String) {
|
||||||
|
this.text = text
|
||||||
|
}
|
||||||
|
}
|
@ -9,20 +9,9 @@
|
|||||||
app:cardUseCompatPadding="true" app:cardPreventCornerOverlap="false" app:contentPadding="5dp">
|
app:cardUseCompatPadding="true" app:cardPreventCornerOverlap="false" app:contentPadding="5dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent" android:id="@+id/linLayout_Lesson">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtView_Lesson"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/a_lesson"
|
|
||||||
android:textColor="@android:color/primary_text_light"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:typeface="sans"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txtView_Time"
|
android:id="@+id/txtView_Time"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<string name="app_name" translatable="false">Project Laogai</string>
|
<string name="app_name" translatable="false">Project Laogai</string>
|
||||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||||
<string name="nav_header_title" translatable="false">hso App 0.3.2</string>
|
<string name="nav_header_title" translatable="false">hso App 0.3.3</string>
|
||||||
<string name="nav_header_subtitle" translatable="false">seil0@mosad.xyz</string>
|
<string name="nav_header_subtitle" translatable="false">seil0@mosad.xyz</string>
|
||||||
<string name="nav_header_desc" translatable="false">Project Laogai</string>
|
<string name="nav_header_desc" translatable="false">Project Laogai</string>
|
||||||
|
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<string name="primary_color">primary color</string>
|
<string name="primary_color">primary color</string>
|
||||||
<string name="main_color_desc">The primary color, default is black</string>
|
<string name="main_color_desc">The primary color, default is black</string>
|
||||||
<string name="select">select</string>
|
<string name="select">select</string>
|
||||||
<string name="version" translatable="false">version 0.3.2</string>
|
<string name="version" translatable="false">version 0.3.3</string>
|
||||||
<string name="about">about</string>
|
<string name="about">about</string>
|
||||||
<string name="about_txtView" translatable="false">hso App by @Seil0</string>
|
<string name="about_txtView" translatable="false">hso App by @Seil0</string>
|
||||||
<string name="about_text" translatable="false">"This software is made by @Seil0 and is published under the terms and
|
<string name="about_text" translatable="false">"This software is made by @Seil0 and is published under the terms and
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.11'
|
ext.kotlin_version = '1.3.21'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
classpath 'com.android.tools.build:gradle:3.3.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
Reference in New Issue
Block a user