szkolnyplus/app/src/main/res/layout/timetable_lesson.xml

190 lines
8.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
2019-11-10 13:27:26 -06:00
<import type="android.view.View" />
<variable
name="annotationVisible"
type="boolean"/>
<variable
name="lessonNumber"
type="Integer" />
<variable
name="unread"
type="boolean" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground"
android:foreground="@drawable/bg_rounded_ripple_4dp"
tools:padding="32dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_height="90dp"
android:background="?timetable_lesson_bg"
android:orientation="vertical"
android:paddingBottom="4dp">
<TextView
android:id="@+id/annotation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/timetable_lesson_annotation"
android:fontFamily="sans-serif-condensed"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:text="@string/timetable_lesson_cancelled"
android:textColor="#000"
android:textSize="12sp"
android:textStyle="italic"
android:visibility="@{annotationVisible ? View.VISIBLE : View.GONE}"
tools:text="Zastępstwo: zamiast lekcji język polski z Adam Dodatkowy"
tools:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:orientation="horizontal"
android:baselineAligned="false">
<!--tools:background="@drawable/timetable_subject_color_rounded"-->
<TextView
android:id="@+id/subjectName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1"
android:ellipsize="end"
android:fontFamily="sans-serif-light"
android:maxLines="@{annotationVisible ? 1 : 2}"
android:textSize="16sp"
android:textStyle="bold"
app:autoSizeMaxTextSize="16sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeTextType="uniform"
tools:maxLines="2"
tools:text="pracownia urządzeń techniki komputerowej" />
<View
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:visibility="@{unread ? View.VISIBLE : View.GONE}"
android:background="@drawable/unread_red_circle" />
<ImageView
android:id="@+id/attendanceIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:visibility="gone"
tools:srcCompat="@sample/check"
tools:visibility="visible" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="0"
app:srcCompat="@drawable/bg_circle"
android:visibility="gone" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-condensed-light"
android:includeFontPadding="false"
android:layout_marginBottom="-4dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="@{Integer.toString(lessonNumber)}"
android:textSize="28sp"
android:visibility="@{lessonNumber != null ? View.VISIBLE : View.GONE}"
tools:text="3"/>
2019-11-10 13:27:26 -06:00
<!--android:layout_marginTop="@{annotationVisible ? `-4dp` : `4dp`}"
android:layout_marginBottom="@{annotationVisible ? `-4dp` : `0dp`}"-->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="8dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/detailsFirst"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
tools:text="8:10 - 8:55 • 015 językowa → 016 językowa" />
<TextView
android:id="@+id/detailsSecond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textAppearance="@style/NavView.TextView.Helper"
android:textSize="12sp"
tools:text="Paweł Informatyczny • 2b3T n1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="end|bottom"
android:orientation="horizontal">
<View
android:id="@+id/event3"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
tools:background="@drawable/unread_red_circle" />
<View
android:id="@+id/event2"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
tools:background="@drawable/unread_red_circle" />
<View
android:id="@+id/event1"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
tools:background="@drawable/unread_red_circle" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</layout>