Fix blank number and change strikethrough lesson in widget (#198)

This commit is contained in:
Rafał Borcz 2018-12-14 22:36:21 +01:00 committed by Mikołaj Pich
parent 2d4ada6c9e
commit 765eac5251
2 changed files with 15 additions and 5 deletions

View File

@ -78,7 +78,7 @@ class TimetableWidgetFactory(
setTextViewText(R.id.timetableWidgetItemDescription, it.info.capitalize())
} else setViewVisibility(R.id.timetableWidgetItemDescription, GONE)
if (it.changes) {
if (it.canceled) {
setInt(R.id.timetableWidgetItemSubject, "setPaintFlags",
STRIKE_THRU_TEXT_FLAG or ANTI_ALIAS_FLAG)
} else {

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/timetableWidgetItemContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -9,18 +10,25 @@
<TextView
android:id="@+id/timetableWidgetItemNumber"
android:layout_width="55dp"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:gravity="center"
android:text="0"
android:textSize="25sp" />
android:maxLines="1"
android:textColor="@android:color/black"
android:textSize="25sp"
tools:text="0" />
<TextView
android:id="@+id/timetableWidgetItemTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toEndOf="@id/timetableWidgetItemNumber"
android:layout_toRightOf="@id/timetableWidgetItemNumber"
android:text="@string/app_name"
@ -64,6 +72,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/timetableWidgetItemTime"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="5dp"
android:layout_toEndOf="@id/timetableWidgetItemNumber"