the menus text is now selectable
* fixed some formating errors at the mensa screen
This commit is contained in:
parent
f97e8b2b14
commit
3d7f6f961a
|
@ -84,8 +84,10 @@ 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) //TODO move this out of the first for loop, performance!!
|
||||||
|
|
|
@ -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("\n"))
|
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))
|
||||||
|
|
|
@ -36,13 +36,15 @@
|
||||||
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>
|
||||||
|
|
||||||
|
@ -75,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
|
||||||
|
|
|
@ -35,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>
|
Loading…
Reference in New Issue