16 Commits
0.2.2 ... 0.3.2

Author SHA1 Message Date
75a457312d major bug fixes & version 0.3.2
* fixed a issue that prevented the app from showing the second weeks schedule, until now the app showed always the current week as next week
* minor color chooser improvements
* minor code clean up
2019-01-03 13:46:09 +01:00
87bf614d28 added color saving
** WARNING this contains issues, many issues **
2019-01-03 01:45:28 +01:00
e69354af96 clean up 2018-12-18 11:49:46 +01:00
ec74a8e4f8 basic color selection 2018-12-14 15:02:19 +01:00
b49d16b1a1 updated some libs, meal tomorrow shows correct string if there's no meal 2018-12-02 00:05:23 +01:00
70059b4b0c added moodle webview 2018-11-30 13:54:39 +01:00
3d7f6f961a the menus text is now selectable
* fixed some formating errors at the mensa screen
2018-11-26 12:56:06 +01:00
f97e8b2b14 fixed text overlapping and some crashes 2018-11-26 11:17:07 +01:00
deaf139b70 updated some libraries 2018-11-22 18:07:30 +01:00
bf48bec16b minor fixes 2018-11-19 12:00:39 +01:00
e6c4096787 minor gui fixes, clean up 2018-11-18 21:28:43 +01:00
b083e44711 added a new icon, gui cleanup 2018-11-18 19:46:21 +01:00
2df58311cb updated version number 2018-11-17 15:02:53 +01:00
f6f652ffb6 the home screen will now always show the first 2 meals
* things like a "Schneller Teller" are not shown in the home screen anymore
* updated ti kotlin 1.3.10
2018-11-16 14:19:24 +01:00
8fa0d496c6 updated some libraries
* material-dialog 2.0.0-beta4  -> 2.0.0-beta5
2018-11-15 23:51:48 +01:00
0607d58760 show tomorrows meal if iths latr than 1500 2018-11-13 16:17:05 +01:00
63 changed files with 326 additions and 268 deletions

View File

@ -5,13 +5,15 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
android { android {
signingConfigs {
}
compileSdkVersion 28 compileSdkVersion 28
defaultConfig { defaultConfig {
applicationId "org.mosad.seil0.projectlaogai" applicationId "org.mosad.seil0.projectlaogai"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 6 versionCode 9
versionName "0.2.2" versionName "0.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@ -27,16 +29,17 @@ android {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.1' implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'org.jsoup:jsoup:1.11.3' implementation 'org.jsoup:jsoup:1.11.3'
implementation 'org.jetbrains.anko:anko-commons:0.10.7' implementation 'org.jetbrains.anko:anko-commons:0.10.8'
implementation 'com.afollestad.material-dialogs:core:2.0.0-beta4' implementation 'com.afollestad:aesthetic:1.0.0-beta05'
implementation 'com.afollestad.material-dialogs:color:2.0.0-beta4' implementation 'com.afollestad.material-dialogs:core:2.0.0-rc5'
implementation 'com.afollestad.material-dialogs:color:2.0.0-rc5'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
} }

View File

@ -5,20 +5,20 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_laogai_icon"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_laogai_icon"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".SplashActivity" android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@style/SplashTheme" android:theme="@style/SplashTheme"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -22,6 +22,7 @@
package org.mosad.seil0.projectlaogai package org.mosad.seil0.projectlaogai
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
@ -29,22 +30,19 @@ 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.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import com.afollestad.aesthetic.Aesthetic
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.google.android.material.navigation.NavigationView import com.google.android.material.navigation.NavigationView
import kotlinx.android.synthetic.main.activity_main.* 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.fragments.HomeFragment import org.mosad.seil0.projectlaogai.fragments.*
import org.mosad.seil0.projectlaogai.fragments.MensaFragment
import org.mosad.seil0.projectlaogai.fragments.SettingsFragment
import org.mosad.seil0.projectlaogai.fragments.TimeTableFragment
import org.mosad.seil0.projectlaogai.hsoparser.* import org.mosad.seil0.projectlaogai.hsoparser.*
import kotlin.system.measureTimeMillis import kotlin.system.measureTimeMillis
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
//TODO make toolbar and navbar global
private val mensaParser = MensaParser() private val mensaParser = MensaParser()
private val timeTableParser = TimeTableParser() private val timeTableParser = TimeTableParser()
@ -54,15 +52,33 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
private var timeTableNextWeek = arrayOf<Array<Lesson>>() private var timeTableNextWeek = arrayOf<Array<Lesson>>()
private lateinit var course: CourseTTLink private lateinit var course: CourseTTLink
private var color: Int = Color.BLACK
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
Aesthetic.attach(this)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
// load mensa and timetable // load mensa, timetable and color
load() load()
// If we haven't set any defaults, do that now
if (Aesthetic.isFirstTime) {
// this is executed on the first app start, use this to show tutorial etc.
Aesthetic.config {
colorPrimary(Color.BLACK)
colorPrimaryDark(Color.BLACK)
apply()
}
} else {
Aesthetic.config {
colorPrimary(color)
colorPrimaryDark(color)
apply()
}
}
//init home fragment TODO make a abstract fragment class //init home fragment TODO make a abstract fragment class
val homeFragment = HomeFragment() val homeFragment = HomeFragment()
homeFragment.setMainActivity(this) homeFragment.setMainActivity(this)
@ -79,6 +95,16 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
nav_view.setNavigationItemSelectedListener(this) nav_view.setNavigationItemSelectedListener(this)
} }
override fun onResume() {
super.onResume()
Aesthetic.resume(this)
}
override fun onPause() {
super.onPause()
Aesthetic.pause(this)
}
override fun onBackPressed() { override fun onBackPressed() {
if (drawer_layout.isDrawerOpen(GravityCompat.START)) { if (drawer_layout.isDrawerOpen(GravityCompat.START)) {
drawer_layout.closeDrawer(GravityCompat.START) drawer_layout.closeDrawer(GravityCompat.START)
@ -129,10 +155,11 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
} }
R.id.nav_moodle -> { R.id.nav_moodle -> {
val moodleFragment = MoodleFragment()
} val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
R.id.nav_email -> { fragmentTransaction.replace(R.id.fragment_container, moodleFragment)
fragmentTransaction.commit()
} }
R.id.nav_settings -> { R.id.nav_settings -> {
val settingsFragment = SettingsFragment() val settingsFragment = SettingsFragment()
@ -167,9 +194,19 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
timeTableCurrentWeek = timeTableParser.getTimeTable(course.courseTTLink.replace("http", "https")) 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
* TODO evaluate if we should use a timeout here
*/ */
private fun load() { private fun load() {
@ -181,11 +218,15 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
sharedPref.getString(getString(R.string.save_key_course), "AI3")!! 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
* TODO make an API see https://git.mosad.xyz/Seil0/TheCitadelofRicks * TODO make an API see https://git.mosad.xyz/Seil0/TheCitadelofRicks
*/ */
val time = measureTimeMillis { val time = measureTimeMillis {
/* getting the course list should be faster than the timetable, /* getting the course list should be faster than the timetable,
* we need have time until the user opens the dialog * we need have time until the user opens the dialog
*/ */
@ -193,19 +234,11 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
courseTTLinkList = timeTableParser.getCourseTTLinks() courseTTLinkList = timeTableParser.getCourseTTLinks()
} }
doAsync { val jobMenus = doAsync {
try {
timeTableNextWeek = timeTableParser.getTimeTable(course.courseTTLink.replace("week=0","week=1"))
} catch (e: Exception) {
e.stackTrace
}
}
val t1 = doAsync {
weekMenus = mensaParser.getMensaMenu() weekMenus = mensaParser.getMensaMenu()
} }
val t2 = doAsync { val jobTTCurrentWeek = doAsync {
try { try {
timeTableCurrentWeek = timeTableParser.getTimeTable(course.courseTTLink) timeTableCurrentWeek = timeTableParser.getTimeTable(course.courseTTLink)
} catch (e: Exception) { } catch (e: Exception) {
@ -221,11 +254,19 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
} }
} }
t1.get() val jobTTNextWeek = doAsync {
t2.get() try {
timeTableNextWeek = timeTableParser.getTimeTable(course.courseTTLink.replace("week=0","week=1"))
} catch (e: Exception) {
e.stackTrace
}
}
jobMenus.get()
jobTTCurrentWeek.get()
jobTTNextWeek.get()
} }
println("Completed in $time ms") println("Completed in $time ms")
} }
fun getCourseTTLinkList(): ArrayList<CourseTTLink>{ fun getCourseTTLinkList(): ArrayList<CourseTTLink>{
@ -236,7 +277,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
return timeTableCurrentWeek return timeTableCurrentWeek
} }
fun getTimeTableNextWeek(): Array<Array<Lesson>> { fun getTimeTableNextWeek(): Array<Array<Lesson>> {
return timeTableNextWeek return timeTableNextWeek
} }
@ -248,4 +289,8 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
return course return course
} }
fun getColorPrimary(): Int {
return color
}
} }

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -64,25 +64,52 @@ class HomeFragment : Fragment() {
/** /**
* add the current mensa meal to the home screens * add the current mensa meal to the home screens
* TODO show meals of the next day if its later than 1500
*/ */
private fun addCurrentMensaMenu() { private fun addCurrentMensaMenu() {
doAsync { doAsync {
val dayMenus: ArrayList<Meal> = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), Calendar.getInstance().get(Calendar.DAY_OF_WEEK)) val dayMenus: ArrayList<Meal>
val cal = Calendar.getInstance()
if (cal.get(Calendar.HOUR_OF_DAY) < 15) {
dayMenus = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), cal.get(Calendar.DAY_OF_WEEK))
} else {
dayMenus = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), cal.get(Calendar.DAY_OF_WEEK) + 1)
uiThread {
txtView_Menu1Heading.text = resources.getString(R.string.meal_1_tomorrow)
txtView_Menu2Heading.text = resources.getString(R.string.meal_2_tomorrow)
}
}
uiThread { uiThread {
if (dayMenus.size >= 2) { if (dayMenus.size >= 2) {
for (part in dayMenus[0].parts) { // get the index of the first meal, not a "Schneller Teller"
txtViewMenu1.append(part) loop@ for ((i, meal) in dayMenus.withIndex()) {
if (meal.heading.contains("Essen")) {
for ((j, part) in dayMenus[i].parts.withIndex()) {
txtViewMenu1.append(part)
if (j < (dayMenus[i].parts.size - 2))
txtViewMenu1.append("\n")
}
for ((j, part) in dayMenus[i + 1].parts.withIndex()) {
txtViewMenu2.append(part)
if (j < (dayMenus[i + 1].parts.size - 2))
txtViewMenu2.append("\n")
}
break@loop
}
} }
for (part in dayMenus[1].parts) {
txtViewMenu2.append(part)
}
} else { } else {
txtViewMenu1.text = resources.getString(R.string.no_meal_today) if (txtView_Menu1Heading.text == resources.getString(R.string.meal_1_tomorrow)) {
txtViewMenu2.text = resources.getString(R.string.no_meal_today) txtViewMenu1.text = resources.getString(R.string.no_meal_tomorrow)
txtViewMenu2.text = resources.getString(R.string.no_meal_tomorrow)
} else {
txtViewMenu1.text = resources.getString(R.string.no_meal_today)
txtViewMenu2.text = resources.getString(R.string.no_meal_today)
}
} }
} }
} }

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -71,7 +71,7 @@ class MensaFragment : Fragment() {
Calendar.THURSDAY -> "Don" Calendar.THURSDAY -> "Don"
Calendar.FRIDAY -> "Fre" Calendar.FRIDAY -> "Fre"
Calendar.SATURDAY -> "Sam" Calendar.SATURDAY -> "Sam"
else -> "TODAY" //TODO else -> "TODAY" // the app will likely crash here
} }
val cardViewMensaDay = MensaDayCardView(context!!, null) val cardViewMensaDay = MensaDayCardView(context!!, null)
@ -84,11 +84,13 @@ class MensaFragment : Fragment() {
val menuViewMenu = MenuCardView(context!!, null) val menuViewMenu = MenuCardView(context!!, null)
menuViewMenu.setMenuHeading(meal.heading) menuViewMenu.setMenuHeading(meal.heading)
for(part in meal.parts) { for ((i, part) in meal.parts.withIndex()) {
menuViewMenu.getTxtViewMenu().append(part) menuViewMenu.getTxtViewMenu().append(part)
if(i < (meal.parts.size - 2))
menuViewMenu.getTxtViewMenu().append("\n")
} }
cardViewMensaDay.setDayHeading(meal.day) //TODO move this out of the first for loop, performance!! cardViewMensaDay.setDayHeading(meal.day)
cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu) cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu)
add = true add = true
} }

View File

@ -0,0 +1,58 @@
/**
* 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.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.webkit.WebSettings
import android.webkit.WebView
import org.mosad.seil0.projectlaogai.R
import android.webkit.WebViewClient
/**
* The moodle screen controller class
* contains all needed parts to display and the moodle screen
*/
class MoodleFragment : Fragment() {
private lateinit var webView: WebView
private lateinit var webSettings: WebSettings
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view: View = inflater.inflate(R.layout.fragment_moodle, container, false)
webView = view.findViewById(R.id.webView)
webView.loadUrl("https://elearning.hs-offenburg.de/moodle/")
webSettings = webView.getSettings()
//webSettings.setJavaScriptEnabled(true) // Enable Javascript
webView.setWebViewClient(WebViewClient()) // Force links and redirects to open in the WebView instead of in a browser
return view
}
}

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -29,6 +29,7 @@ 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 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
import com.afollestad.materialdialogs.customview.customView import com.afollestad.materialdialogs.customview.customView
@ -125,12 +126,19 @@ class SettingsFragment : Fragment() {
linLayoutMainColor.setOnClickListener { linLayoutMainColor.setOnClickListener {
// open a new color chooser dialog // open a new color chooser dialog
val colors = intArrayOf(Color.parseColor("#3F51B5"), Color.RED, Color.GREEN, Color.BLUE) val colors = intArrayOf(Color.BLACK, Color.DKGRAY, Color.RED, Color.GREEN, Color.YELLOW)
MaterialDialog(context!!) MaterialDialog(context!!)
.title(R.string.primary_color) .title(R.string.primary_color)
.colorChooser(colors, initialSelection = Color.parseColor("#3F51B5")) { _, color -> .colorChooser(colors, allowCustomArgb = true,initialSelection = mainActivity.getColorPrimary()) { _, color ->
viewPrimaryColor.setBackgroundColor(color) viewPrimaryColor.setBackgroundColor(color)
Aesthetic.config {
colorPrimary(color)
colorPrimaryDark(color)
apply()
}
mainActivity.saveColorPrimary(color)
} }
.positiveButton(R.string.select) .positiveButton(R.string.select)
.show() .show()

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -55,7 +55,11 @@ class TimeTableFragment : Fragment() {
linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment) linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment)
addCurrentWeek() if (mainActivity.getTimeTableCurrentWeek().isNotEmpty()) {
addCurrentWeek()
} else {
// TODO show card with error msg
}
return view return view
} }
@ -87,14 +91,25 @@ class TimeTableFragment : Fragment() {
lessonCardView.getTxtViewLesson().append(lesson.lessonRoom) lessonCardView.getTxtViewLesson().append(lesson.lessonRoom)
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i] lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]
// only add the lesson if it contains data
if(lessonCardView.getTxtViewLesson().text.length > 2) if(lessonCardView.getTxtViewLesson().text.length > 2)
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 lessonCardView = LessonCardView(context!!, null)
lessonCardView.setBackgroundColor(Color.TRANSPARENT)
lessonCardView.getTxtViewLesson().text = resources.getString(R.string.no_lesson_today)
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 (mainActivity.getTimeTableNextWeek().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!)
@ -123,7 +138,6 @@ class TimeTableFragment : Fragment() {
} }
} }
// TODO if there is no lesson at one day , show a no lesson card
} }
} }

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -43,7 +43,7 @@ class MensaParser {
for (i in 0 .. (element.select("div.row h4").size - 1)) { for (i in 0 .. (element.select("div.row h4").size - 1)) {
try { try {
val heading = element.select("div.row h4")[i].text() val heading = element.select("div.row h4")[i].text()
val parts = ArrayList<String>(element.select("div.row").select("div.menu-info")[i].html().substringBefore("<span").replace("<br>", "|").split("|")) val parts = ArrayList<String>(element.select("div.row").select("div.menu-info")[i].html().substringBefore("<span").replace("<br>", " ").split("\n"))
val additives = element.select("div.row").select("div.menu-info")[i].select("span.show-with-allergenes").text() val additives = element.select("div.row").select("div.menu-info")[i].select("span.show-with-allergenes").text()
mealList.add(Meal(day, heading, parts, additives)) mealList.add(Meal(day, heading, parts, additives))
@ -52,6 +52,7 @@ class MensaParser {
} }
} }
} }
return mealList return mealList
} }

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -27,9 +27,16 @@ 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<CourseTTLink>()
private var timeTableWeek = arrayOf<Array<Lesson>>()
init { /**
* get the timetable from the given url
* 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
*/
fun getTimeTable(courseTTURL: String): Array<Array<Lesson>> {
var timeTableWeek = arrayOf<Array<Lesson>>()
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>()
@ -38,15 +45,6 @@ class TimeTableParser {
} }
timeTableWeek += timeTableDay timeTableWeek += timeTableDay
} }
}
/**
* get the timetable from the given url
* 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
*/
fun getTimeTable(courseTTURL: String): Array<Array<Lesson>> {
val scheduleHTML = Jsoup.connect(courseTTURL).get()
//val week = scheduleHTML.select("h1.timetable-caption").text() //val week = scheduleHTML.select("h1.timetable-caption").text()
//println("$week successful!\n") //println("$week successful!\n")
@ -70,7 +68,7 @@ class TimeTableParser {
return courseTTLinkList return courseTTLinkList
} }
@Suppress("unused")
fun printTimeTableWeek (timeTableWeek: Array<Array<Lesson>>) { fun printTimeTableWeek (timeTableWeek: Array<Array<Lesson>>) {
for (j in 0..5) print(days[j].padEnd(25 ,' ') + " | ") for (j in 0..5) print(days[j].padEnd(25 ,' ') + " | ")

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ class LessonCardView @JvmOverloads constructor(context: Context, attrs: Attribu
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.parseColor("#3F51B5")) this.setBackgroundColor(Color.TRANSPARENT)
} }
fun getTxtViewLesson(): TextView { fun getTxtViewLesson(): TextView {

View File

@ -1,7 +1,7 @@
/** /**
* ProjectLaogai * ProjectLaogai
* *
* Copyright 2018 <seil0@mosad.xyz> * Copyright 2019 <seil0@mosad.xyz>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -1,34 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
<item
android:color="#00000000"
android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>

View File

@ -4,10 +4,12 @@
<item <item
android:drawable="@color/colorPrimary"/> android:drawable="@color/colorPrimary"/>
<item> <!--TODO when minAPI is 23 use this-->
<!--<item android:gravity="center" android:width="144dp" android:height="144dp">-->
<item android:gravity="center">
<bitmap <bitmap
android:gravity="center" android:gravity="fill_horizontal|fill_vertical"
android:src="@drawable/ic_launcher"/> android:src="@mipmap/ic_laogai_icon_splash"/>
</item> </item>
</layer-list> </layer-list>

View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path android:fillColor="#008577"
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

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M8.1,13.34l2.83,-2.83L3.91,3.5c-1.56,1.56 -1.56,4.09 0,5.66l4.19,4.18zM14.88,11.53c1.53,0.71 3.68,0.21 5.27,-1.38 1.91,-1.91 2.28,-4.65 0.81,-6.12 -1.46,-1.46 -4.2,-1.1 -6.12,0.81 -1.59,1.59 -2.09,3.74 -1.38,5.27L3.7,19.87l1.41,1.41L12,14.41l6.88,6.88 1.41,-1.41L13.41,13l1.47,-1.47z"/>
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M20,3L4,3v10c0,2.21 1.79,4 4,4h6c2.21,0 4,-1.79 4,-4v-3h2c1.11,0 2,-0.9 2,-2L22,5c0,-1.11 -0.89,-2 -2,-2zM20,8h-2L18,5h2v3zM4,19h16v2L4,21z"/> android:pathData="M5,13.18v4L12,21l7,-3.82v-4L12,17l-7,-3.82zM12,3L1,9l11,6 9,-4.91V17h2V9L12,3z"/>
</vector> </vector>

View File

@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:autoMirrored="true"
android:height="24dp" android:height="24dp"
android:viewportWidth="24.0" android:width="24dp"
android:viewportHeight="24.0"> android:viewportHeight="24.0"
<path android:viewportWidth="24.0">
android:fillColor="#FF000000" <path android:fillColor="#FF000000"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/> android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector> </vector>

View File

@ -2,8 +2,8 @@
android:shape="rectangle"> android:shape="rectangle">
<gradient <gradient
android:angle="135" android:angle="135"
android:centerColor="@color/colorPrimary" android:centerColor="?colorPrimary"
android:endColor="@color/colorPrimaryDark" android:endColor="?colorPrimaryDark"
android:startColor="@color/colorPrimary" android:startColor="?colorPrimary"
android:type="linear"/> android:type="linear"/>
</shape> </shape>

View File

@ -20,7 +20,7 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/design_default_color_primary" android:background="?colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/> app:popupTheme="@style/AppTheme.PopupOverlay"/>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>

View File

@ -13,23 +13,22 @@
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/cardView" android:id="@+id/cardView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="125dp" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:clickable="false" android:clickable="false"
android:maxHeight="125dp" android:maxHeight="125dp"
app:cardCornerRadius="15dp"
app:cardUseCompatPadding="true" app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent" android:elevation="5dp">
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" android:layout_marginBottom="2dp">
<TextView <TextView
android:text="@string/meal_1" android:text="@string/meal_1"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -37,33 +36,33 @@
android:textStyle="bold" android:textAlignment="center" android:textSize="16sp" android:textStyle="bold" android:textAlignment="center" android:textSize="16sp"
android:typeface="sans" android:fontFamily="sans-serif" android:paddingBottom="5dp"/> android:typeface="sans" android:fontFamily="sans-serif" android:paddingBottom="5dp"/>
<TextView <TextView
android:id="@+id/txtViewMenu1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="sans-serif" android:fontFamily="sans-serif"
android:textAlignment="center" android:textAlignment="center"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:typeface="sans" android:id="@+id/txtViewMenu1"/> android:typeface="sans"
android:textIsSelectable="true"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/cardView2" android:id="@+id/cardView2"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="125dp" android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
app:cardCornerRadius="15dp"
app:cardUseCompatPadding="true" app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView"> app:layout_constraintTop_toBottomOf="@+id/cardView" android:elevation="5dp"
android:layout_marginEnd="5dp" android:layout_marginStart="5dp">
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" android:layout_marginBottom="2dp">
<TextView <TextView
android:text="@string/meal_2" android:text="@string/meal_2"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -78,7 +77,8 @@
android:textAlignment="center" android:textAlignment="center"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:typeface="sans"/> android:typeface="sans"
android:textIsSelectable="true"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<ScrollView <ScrollView
@ -88,7 +88,8 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardView2" android:id="@+id/scrollViewTimeTable" app:layout_constraintTop_toBottomOf="@+id/cardView2" android:id="@+id/scrollViewTimeTable"
android:background="@color/colorPrimary" android:paddingTop="6dp"> android:background="@color/md_divider_dark_theme" android:paddingTop="6dp"
android:layout_marginTop="5dp">
<LinearLayout <LinearLayout
android:id="@+id/linLayoutTimeTable" android:id="@+id/linLayoutTimeTable"

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.MoodleFragment">
<!-- TODO: Update blank fragment layout -->
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/webView"/>
</FrameLayout>

View File

@ -137,7 +137,7 @@
<View <View
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:id="@+id/view_PrimaryColor" android:layout_height="40dp" android:id="@+id/view_PrimaryColor"
android:background="@color/colorPrimary"/> android:background="?colorPrimary"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -5,8 +5,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardBackgroundColor="@android:color/background_light" app:cardBackgroundColor="@android:color/background_light"
app:contentPadding="5dp" app:cardElevation="5dp" app:cardElevation="5dp"
app:cardUseCompatPadding="true" app:cardPreventCornerOverlap="false" app:cardCornerRadius="12dp"> app:cardUseCompatPadding="true" app:cardPreventCornerOverlap="false" app:contentPadding="5dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -12,7 +12,7 @@
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/linLayout_MensaDay"> android:layout_height="wrap_content" android:id="@+id/linLayout_MensaDay" android:paddingBottom="5dp">
<TextView <TextView
android:text="@string/sample_date" android:text="@string/sample_date"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -11,7 +11,6 @@
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:clickable="false" android:clickable="false"
android:maxHeight="125dp" android:maxHeight="125dp"
app:cardCornerRadius="15dp"
app:cardUseCompatPadding="true" app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
@ -36,7 +35,8 @@
android:textAlignment="center" android:textAlignment="center"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:typeface="sans"/> android:typeface="sans"
android:textIsSelectable="true"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -4,20 +4,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height" android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar" android:background="@color/colorPrimary"
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark" android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:orientation="vertical" android:orientation="vertical"
android:gravity="bottom"> android:gravity="bottom"
android:id="@+id/nav_header_main">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing" android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" app:srcCompat="@mipmap/ic_laogai_icon"
android:contentDescription="@string/nav_header_desc" android:contentDescription="@string/nav_header_desc"
android:id="@+id/imageView"/> android:id="@+id/imageView"/>

View File

@ -7,7 +7,7 @@
<item android:id="@+id/nav_home" android:title="@string/home" android:icon="@drawable/ic_baseline_home_24dp"/> <item android:id="@+id/nav_home" android:title="@string/home" android:icon="@drawable/ic_baseline_home_24dp"/>
<item <item
android:id="@+id/nav_mensa" android:id="@+id/nav_mensa"
android:icon="@drawable/ic_free_breakfast_black_24dp" android:icon="@drawable/ic_local_dining_black_24dp"
android:title="@string/mensa"/> android:title="@string/mensa"/>
<item <item
android:id="@+id/nav_timetable" android:id="@+id/nav_timetable"
@ -15,12 +15,8 @@
android:title="@string/timetable"/> android:title="@string/timetable"/>
<item <item
android:id="@+id/nav_moodle" android:id="@+id/nav_moodle"
android:icon="@drawable/ic_menu_slideshow" android:icon="@drawable/ic_school_black_24dp"
android:title="@string/moodle"/> android:title="@string/moodle"/>
<item
android:id="@+id/nav_email"
android:icon="@android:drawable/ic_dialog_email"
android:title="@string/e_mail"/>
<item <item
android:id="@+id/nav_settings" android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings_black_24dp" android:icon="@drawable/ic_settings_black_24dp"

View File

@ -4,5 +4,5 @@
<item android:id="@+id/action_settings" <item android:id="@+id/action_settings"
android:title="@string/settings" android:title="@string/settings"
android:orderInCategory="100" android:orderInCategory="100"
app:showAsAction="never"/> app:showAsAction="never" android:visible="false"/>
</menu> </menu>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -4,13 +4,15 @@
<string name="mensa">Mensa</string> <string name="mensa">Mensa</string>
<string name="timetable">Stundenplan</string> <string name="timetable">Stundenplan</string>
<string name="moodle">Moodle</string> <string name="moodle">Moodle</string>
<string name="e_mail">E-Mail</string>
<string name="settings">Einstellungen</string> <string name="settings">Einstellungen</string>
<string name="meal_1">Essen 1</string> <string name="meal_1">Essen 1</string>
<string name="meal_2">Essen 2</string> <string name="meal_2">Essen 2</string>
<string name="meal_1_tomorrow">Essen 1, Morgen</string>
<string name="meal_2_tomorrow">Essen 1, Morgen</string>
<string name="no_meal_today">heute keine Essensausgabe</string> <string name="no_meal_today">heute keine Essensausgabe</string>
<string name="no_meal_tomorrow">morgen keine Essensausgabe</string>
<string name="no_more_food">Diese Woche keine weitere Essensausgabe</string> <string name="no_more_food">Diese Woche keine weitere Essensausgabe</string>
<string name="no_lesson_today">heute keine Vorlesung</string> <string name="no_lesson_today">heute keine Vorlesung!</string>
<string name="error">Fehler</string> <string name="error">Fehler</string>
<string name="no_tt_error">Stundenplan konnte nicht geladen werden!</string> <string name="no_tt_error">Stundenplan konnte nicht geladen werden!</string>
<string name="gen_tt_error">Allgemeiner Stundenplan Fehler!"</string> <string name="gen_tt_error">Allgemeiner Stundenplan Fehler!"</string>
@ -18,11 +20,10 @@
<string name="user">Benutzer</string> <string name="user">Benutzer</string>
<string name="course_desc">Tippen, um den Kurs zu ändern</string> <string name="course_desc">Tippen, um den Kurs zu ändern</string>
<string name="primary_color">Primärfarbe</string> <string name="primary_color">Primärfarbe</string>
<string name="main_color_desc">Die Primärfarbe, standard ist Indigo</string> <string name="main_color_desc">Die Primärfarbe, standard ist Schwarz</string>
<string name="select">auswählen</string> <string name="select">auswählen</string>
<string name="about">über</string> <string name="about">über</string>
<string name="loading_timetable">lade Stundenplan …</string> <string name="loading_timetable">lade Stundenplan …</string>
<string name="hello_blank_fragment">bald ™</string>
<string name="navigation_drawer_close">Navigationsleiste schließen</string> <string name="navigation_drawer_close">Navigationsleiste schließen</string>
<string name="navigation_drawer_open">Navigationsleiste öffnen</string> <string name="navigation_drawer_open">Navigationsleiste öffnen</string>
</resources> </resources>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">@color/design_default_color_primary</color> <color name="colorPrimary">#000000</color>
<color name="colorPrimaryDark">@color/design_default_color_primary_dark</color> <color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#d81b60</color> <color name="colorAccent">#d81b60</color>
<color name="colorMensaDay">#ebe8e9</color> <color name="colorMensaDay">#ebe8e9</color>
<color name="ic_launcher_background">#FFFFFF</color>
</resources> </resources>

View File

@ -4,5 +4,4 @@
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen> <dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen> <dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources> </resources>

View File

@ -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.2.2</string> <string name="nav_header_title" translatable="false">hso App 0.3.2</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>
@ -10,15 +10,17 @@
<string name="mensa">Mensa</string> <string name="mensa">Mensa</string>
<string name="timetable">Timetable</string> <string name="timetable">Timetable</string>
<string name="moodle">Moodle</string> <string name="moodle">Moodle</string>
<string name="e_mail">E-Mail</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<string name="meal_1">Meal 1</string> <string name="meal_1">Meal 1</string>
<string name="meal_2">Meal 2</string> <string name="meal_2">Meal 2</string>
<string name="meal_1_tomorrow">Meal 1, tomorrow</string>
<string name="meal_2_tomorrow">Meal 2, tomorrow</string>
<string name="no_meal_today">Mensa closed today</string> <string name="no_meal_today">Mensa closed today</string>
<string name="no_meal_tomorrow">Mensa closed tomorrow</string>
<string name="no_more_food">No more Food this week</string> <string name="no_more_food">No more Food this week</string>
<string name="no_lesson_today">"no lecture today "</string> <string name="no_lesson_today">"No lecture today!"</string>
<string name="error">Error</string> <string name="error">Error</string>
<string name="no_tt_error">Could not load timetable!"</string> <string name="no_tt_error">Could not load timetable!"</string>
<string name="gen_tt_error">There was an error with the timetable!"</string> <string name="gen_tt_error">There was an error with the timetable!"</string>
@ -33,18 +35,21 @@
<string name="user">User</string> <string name="user">User</string>
<string name="course_desc">Tap to change course</string> <string name="course_desc">Tap to change course</string>
<string name="primary_color">primary color</string> <string name="primary_color">primary color</string>
<string name="main_color_desc">The primary color, default is indigo</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.2.2</string> <string name="version" translatable="false">version 0.3.2</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 conditions of GPL 3. For further information visit \ngit.mosad.xyz/Seil0/ProjectLaogai \n\n© 2018 seil0@mosad.xyz "</string> <string name="about_text" translatable="false">"This software is made by @Seil0 and is published under the terms and
conditions of GPL 3. For further information visit \ngit.mosad.xyz/Seil0/ProjectLaogai \n\n© 2018-2019
seil0@mosad.xyz "
</string>
<string name="loading_timetable">loading timetable …</string> <string name="loading_timetable">loading timetable …</string>
<string name="hello_blank_fragment">soon ™</string>
<string name="string_new_line" translatable="false">%1$s\n</string> <string name="string_new_line" translatable="false">%1$s\n</string>
<string name="save_key_course" translatable="false">org.mosad.seil0.projectlaogai.course</string> <string name="save_key_course" translatable="false">org.mosad.seil0.projectlaogai.course</string>
<string name="save_key_courseTTLink" translatable="false">org.mosad.seil0.projectlaogai.courseTTLink</string> <string name="save_key_courseTTLink" translatable="false">org.mosad.seil0.projectlaogai.courseTTLink</string>
<string name="save_key_colorPrimary" translatable="false">org.mosad.seil0.projectlaogai.colorPrimary</string>
</resources> </resources>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Exclude specific shared preferences that contain GCM registration Id -->
</full-backup-content>

View File

@ -1,7 +1,7 @@
// 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.0' ext.kotlin_version = '1.3.11'
repositories { repositories {
google() google()
jcenter() jcenter()