szkolny/app/src/main/res/layout/attendance_details_dialog.xml
franek 0823e72328
[UI] Upgrade to Material 3 design, refactor some core elements (#201)
* Material 3 theme and color support, filled cards

* Change drawer header, dark bottombar color

* Replace MaterialComponents with Material3

* wielki powrót pr m3 do szkolnego (nie czytajcie tego kodu)

* fix M3 UI code & upgrade kotlin

* update dependencies

* fix missing Intent receiver flags for Tiramisu+

* fix kapt errors related to SelectiveDAO + migrate BuildConfig

* adapt code to updated dependencies + align lessons (based by szkolny-eu/szkolny-android#196)

* fix: no query filtering

* fix: duplicated items in about card

* fix: "Back button opens drawer" (redundant super call)

* fix: too small heading in agenda dialog

* adapt notes fragment to MD3

* add lock layout function (szkolny-eu/szkolny-android#199)

* hide classroom heading when no classroom is specified

* add support for grade column codes

* grades: join code and category together

* add cosmetic ui changes + fix build issues

* fix proguard rules (attempt 1)

* add new Retrofit2 rules

* add new ProGuard rules + fix QR scanning

* fix agenda view crash when building release variant

* improve LessonDetailsDialog

* remove duplicated string extension

* set separate app ID & icon for debug version

* remove unneeded import statement

* fix collapsing toolbar title when doing back gesture

* remove useless dependencies

* fix UI issues on old Android versions

* fix missing color resources + cleanup dependencies

* fix release building issue

* fix release building issue & remove ripple from NavView

* move version badge to the top bar

* Revert changes introduced by rebase

* Update NavLib from sadorowo/NavLib

* Revert "add lock layout function (szkolny-eu/szkolny-android#199)"

This reverts commit 2fd7038d0c0b43f2d39333d2e556bde066cd28b6.

* Revert "add support for grade column codes"

* Revert unnecessary code changes, part 1

* Lower minSdk to 19

* Revert unnecessary code changes, part 2

* Add new application logo

* Restore bottom bar support in NavLib, revert unnecessary changes

* Use new IconicsMaterialButton in MessageFragment

* Migrate NavView to view binding

* Support IconButton in IconicsMaterialButton

* Cleanup NavLib w600dp styles

* Remove NavLib text styles

* Refactor all application themes, update styles in layouts

* Move enums and config entry to .data, fix app crashing

* Rename non-theme styles to AppStyle

* Restructure app config classes, move config to .data

* Add Theme enum and UiManager, support basic theme changing

* Actually support basic theme changing

* Serialize enum as string, fix config migration, bring back DebugDb

* Fix changing themes, apply night mode in App

* Fix resolving ColorStateList attributes, add LabPlaygroundFragment

* add Iconics methods into ProGuard rules

* Replace home card icon buttons, remove unused icons

* Update gradle properties

* Update build.gradle

* Remove unnecessary dependencies

* Remove playstore icon

* Apply fixes after review

---------

Co-authored-by: Adam Kasprzycki <66315787+santoni0@users.noreply.github.com>
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
2024-06-30 16:12:07 +02:00

253 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) Kuba Szczodrzyński 2020-5-9.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View"/>
<import type="pl.szczodrzynski.edziennik.utils.Utils"/>
<import type="pl.szczodrzynski.edziennik.utils.models.Date"/>
<import type="pl.szczodrzynski.edziennik.utils.models.Time"/>
<variable
name="attendance"
type="pl.szczodrzynski.edziennik.data.db.full.AttendanceFull" />
<variable
name="devMode"
type="boolean" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="24dp"
android:paddingTop="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/attendanceName"
android:layout_width="72dp"
android:layout_height="72dp"
android:background="@drawable/bg_rounded_16dp"
android:gravity="center"
android:padding="8dp"
android:text="@{attendance.typeShort}"
android:textIsSelectable="true"
android:textSize="36sp"
app:autoSizeMinTextSize="18sp"
app:autoSizeMaxTextSize="56sp"
app:autoSizeTextType="uniform"
tools:background="#ff673ab7"
tools:text="e" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@{@string/dialog_grade_details_semester_format(attendance.semester)}"
android:textAppearance="?textAppearanceBodySmall"
android:textIsSelectable="true"
tools:text="semestr 1" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{attendance.subjectLongName}"
android:textAppearance="?textAppearanceTitleLarge"
android:textIsSelectable="true"
tools:text="matematyka" />
</LinearLayout>
</LinearLayout>
<com.mikepenz.iconics.view.IconicsTextView
android:id="@+id/legend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="?textAppearanceBodySmall"
tools:text="[ - ] dodano notatki" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/attendance_details_teacher"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:id="@+id/teacherName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{attendance.teacherName}"
android:textIsSelectable="true"
tools:text="Andrzej Religijny" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_type"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{attendance.typeName}"
android:textIsSelectable="true"
tools:text="nieobecność nieusprawiedliwiona" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_date"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{attendance.date.formattedString}"
android:textIsSelectable="true"
tools:text="30 lutego 2002" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_time"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{attendance.startTime.stringHM}"
android:textIsSelectable="true"
tools:text="10:60" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_lesson_topic"
android:textAppearance="?textAppearanceLabelMedium"
android:visibility="@{attendance.lessonTopic == null ? View.GONE : View.VISIBLE}" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{attendance.lessonTopic}"
android:textIsSelectable="true"
android:visibility="@{attendance.lessonTopic == null ? View.GONE : View.VISIBLE}"
tools:text="Malowanie autoportretu na ścianie sali gimnastycznej. Modlitwa w terenie." />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_is_counted"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:id="@+id/attendanceIsCounted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:textIsSelectable="true"
tools:text="Tak" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false"
android:visibility="@{devMode ? View.VISIBLE : View.GONE}">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_id"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{Long.toString(attendance.id)}"
android:textIsSelectable="true"
tools:text="12345" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/attendance_details_type_id"
android:textAppearance="?textAppearanceLabelMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:text="@{Long.toString(attendance.baseType)}"
android:textIsSelectable="true"
tools:text="12345" />
</LinearLayout>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/notesButton"
style="?materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:text="@string/notes_button" />
</LinearLayout>
</ScrollView>
</layout>