Browse Source

added a splah screen

pull/20/head
Jannik 4 years ago
parent
commit
a5a1ad333b
  1. 17
      app/src/main/AndroidManifest.xml
  2. 7
      app/src/main/java/org/mosad/seil0/projectlaogai/MainActivity.kt
  3. 16
      app/src/main/java/org/mosad/seil0/projectlaogai/SplashActivity.kt
  4. 6
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt
  5. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MensaFragment.kt
  6. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/SettingsFragment.kt
  7. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt
  8. 22
      app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/DataTypes.kt
  9. BIN
      app/src/main/res/drawable-v24/ic_launcher.png
  10. 13
      app/src/main/res/drawable/background_splash.xml
  11. 2
      app/src/main/res/layout/fragment_home.xml
  12. 2
      app/src/main/res/layout/fragment_mensa.xml
  13. 2
      app/src/main/res/layout/fragment_settings.xml
  14. 2
      app/src/main/res/layout/fragment_time_table.xml
  15. 5
      app/src/main/res/values/styles.xml

17
app/src/main/AndroidManifest.xml

@ -10,17 +10,24 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:screenOrientation="portrait">
<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>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>

7
app/src/main/java/org/mosad/seil0/projectlaogai/MainActivity.kt

@ -33,6 +33,10 @@ import androidx.fragment.app.FragmentTransaction
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.app_bar_main.*
import org.jetbrains.anko.doAsync
import org.mosad.seil0.projectlaogai.fragments.HomeFragment
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.Lesson
import org.mosad.seil0.projectlaogai.hsoparser.Meal
import org.mosad.seil0.projectlaogai.hsoparser.MensaParser
@ -143,7 +147,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
/**
* load the mensa menus of the current week
* TODO show loading screen while loading
* TODO make mensa nad timetable query parallel
* TODO make mensa and timetable query parallel (use coroutines)
* TODO evaluate if we should use a timeout here
*/
private fun load() {
@ -151,6 +155,5 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
weekMenus = mensaParser.getMensaMenu()
timeTableWeek = timeTableParser.getTimeTable("https://www.hs-offenburg.de/index.php?id=6627&class=class&iddV=DA64F6FE-9DDB-429E-A677-05D0D40CB636&week=0")
}.get()
}
}

16
app/src/main/java/org/mosad/seil0/projectlaogai/SplashActivity.kt

@ -0,0 +1,16 @@
package org.mosad.seil0.projectlaogai
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}

6
app/src/main/java/org/mosad/seil0/projectlaogai/HomeFragment.kt → app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt

@ -20,7 +20,7 @@
*
*/
package org.mosad.seil0.projectlaogai
package org.mosad.seil0.projectlaogai.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
@ -32,6 +32,7 @@ import kotlinx.android.synthetic.main.fragment_home.*
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.uiThread
import org.mosad.seil0.projectlaogai.R
import org.mosad.seil0.projectlaogai.hsoparser.DataTypes
import org.mosad.seil0.projectlaogai.hsoparser.Lesson
import org.mosad.seil0.projectlaogai.hsoparser.Meal
@ -88,8 +89,7 @@ class HomeFragment : Fragment() {
for (i in 0..5) {
val lessonCardView = LessonCardView(context!!, null)
lessonCardView.getTxtViewLesson().text = """${timeTableDay[i].lessonSubject}
"""
lessonCardView.getTxtViewLesson().text = timeTableDay[i].lessonSubject + "\n"
lessonCardView.getTxtViewLesson().append(timeTableDay[i].lessonTeacher + "\n")
lessonCardView.getTxtViewLesson().append(timeTableDay[i].lessonRoom)
lessonCardView.getTxtViewTime().text = DataTypes().getTime()[i]

3
app/src/main/java/org/mosad/seil0/projectlaogai/MensaFragment.kt → app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MensaFragment.kt

@ -20,7 +20,7 @@
*
*/
package org.mosad.seil0.projectlaogai
package org.mosad.seil0.projectlaogai.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
@ -30,6 +30,7 @@ import android.view.ViewGroup
import android.widget.LinearLayout
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.uiThread
import org.mosad.seil0.projectlaogai.R
import org.mosad.seil0.projectlaogai.hsoparser.Meal
import org.mosad.seil0.projectlaogai.hsoparser.MensaParser
import org.mosad.seil0.projectlaogai.uicomponents.MensaDayCardView

3
app/src/main/java/org/mosad/seil0/projectlaogai/SettingsFragment.kt → app/src/main/java/org/mosad/seil0/projectlaogai/fragments/SettingsFragment.kt

@ -20,7 +20,7 @@
*
*/
package org.mosad.seil0.projectlaogai
package org.mosad.seil0.projectlaogai.fragments
import android.graphics.Color
import android.os.Bundle
@ -33,6 +33,7 @@ import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.color.colorChooser
import com.afollestad.materialdialogs.list.listItems
import kotlinx.android.synthetic.main.fragment_settings.*
import org.mosad.seil0.projectlaogai.R
/**
* The settings controller class

3
app/src/main/java/org/mosad/seil0/projectlaogai/TimeTableFragment.kt → app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt

@ -1,4 +1,4 @@
package org.mosad.seil0.projectlaogai
package org.mosad.seil0.projectlaogai.fragments
import android.os.Bundle
@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import org.mosad.seil0.projectlaogai.R
/**
* The timetable controller class

22
app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/DataTypes.kt

@ -1,3 +1,25 @@
/**
* ProjectLaogai
*
* Copyright 2018 <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.hsoparser
class DataTypes {

BIN
app/src/main/res/drawable-v24/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

13
app/src/main/res/drawable/background_splash.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/colorPrimary"/>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/ic_launcher"/>
</item>
</layer-list>

2
app/src/main/res/layout/fragment_home.xml

@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeFragment">
tools:context=".fragments.HomeFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

2
app/src/main/res/layout/fragment_mensa.xml

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MensaFragment">
tools:context=".fragments.MensaFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

2
app/src/main/res/layout/fragment_settings.xml

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingsFragment">
tools:context=".fragments.SettingsFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

2
app/src/main/res/layout/fragment_time_table.xml

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TimeTableFragment">
tools:context=".fragments.TimeTableFragment">
<TextView
android:layout_width="match_parent"

5
app/src/main/res/values/styles.xml

@ -7,6 +7,7 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
@ -14,4 +15,8 @@
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
</resources>

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close