Browse Source

fixed text overlapping and some crashes

pull/20/head
Jannik 4 years ago
parent
commit
f97e8b2b14
  1. 4
      app/build.gradle
  2. 8
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt
  3. 6
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt
  4. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/MensaParser.kt
  5. 8
      app/src/main/res/layout/fragment_home.xml
  6. 4
      app/src/main/res/layout/fragment_moodle.xml
  7. 7
      app/src/main/res/values/strings.xml

4
app/build.gradle

@ -12,8 +12,8 @@ android {
applicationId "org.mosad.seil0.projectlaogai"
minSdkVersion 21
targetSdkVersion 28
versionCode 8
versionName "0.3.0"
versionCode 9
versionName "0.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {

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

@ -87,12 +87,16 @@ class HomeFragment : Fragment() {
// get the index of the first meal, not a "Schneller Teller"
loop@ for ((i, meal) in dayMenus.withIndex()) {
if(meal.heading.contains("Essen")) {
for (part in dayMenus[i].parts) {
for ((j, part) in dayMenus[i].parts.withIndex()) {
txtViewMenu1.append(part)
if(j < (dayMenus[i].parts.size - 2))
txtViewMenu1.append("\n")
}
for (part in dayMenus[i + 1].parts) {
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

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

@ -55,7 +55,11 @@ class TimeTableFragment : Fragment() {
linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment)
addCurrentWeek()
if (mainActivity.getTimeTableCurrentWeek().isNotEmpty()) {
addCurrentWeek()
} else {
// TODO show card with error msg
}
return view
}

3
app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/MensaParser.kt

@ -43,7 +43,7 @@ class MensaParser {
for (i in 0 .. (element.select("div.row h4").size - 1)) {
try {
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()
mealList.add(Meal(day, heading, parts, additives))
@ -52,6 +52,7 @@ class MensaParser {
}
}
}
return mealList
}

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

@ -13,7 +13,7 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="0dp"
android:layout_height="125dp"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
@ -28,7 +28,7 @@
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:layout_marginBottom="2dp">
<TextView
android:text="@string/meal_1"
android:layout_width="match_parent"
@ -49,7 +49,7 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView2"
android:layout_width="0dp"
android:layout_height="125dp"
android:layout_height="wrap_content"
app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
@ -60,7 +60,7 @@
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent" android:layout_marginBottom="2dp">
<TextView
android:text="@string/meal_2"
android:layout_width="match_parent"

4
app/src/main/res/layout/fragment_moodle.xml

@ -9,9 +9,5 @@
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/webView"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment"/>
</FrameLayout>

7
app/src/main/res/values/strings.xml

@ -2,7 +2,7 @@
<string name="app_name" translatable="false">Project Laogai</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title" translatable="false">hso App 0.3.0</string>
<string name="nav_header_title" translatable="false">hso App 0.3.1</string>
<string name="nav_header_subtitle" translatable="false">seil0@mosad.xyz</string>
<string name="nav_header_desc" translatable="false">Project Laogai</string>
@ -36,7 +36,7 @@
<string name="primary_color">primary color</string>
<string name="main_color_desc">The primary color, default is black</string>
<string name="select">select</string>
<string name="version" translatable="false">version 0.3.0</string>
<string name="version" translatable="false">version 0.3.1</string>
<string name="about">about</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
@ -50,7 +50,4 @@
<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>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</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