mirror of
https://github.com/n08i40k/polytechnic-android.git
synced 2025-12-06 09:47:48 +03:00
1.2.2
Ещё больше визуальных изменений.
This commit is contained in:
9
.idea/appInsightsSettings.xml
generated
9
.idea/appInsightsSettings.xml
generated
@@ -17,6 +17,15 @@
|
|||||||
</option>
|
</option>
|
||||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||||
|
<option name="versions">
|
||||||
|
<list>
|
||||||
|
<VersionSetting>
|
||||||
|
<option name="buildVersion" value="2" />
|
||||||
|
<option name="displayName" value="1.1 (2)" />
|
||||||
|
<option name="displayVersion" value="1.1" />
|
||||||
|
</VersionSetting>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
<option name="visibilityType" value="ALL" />
|
<option name="visibilityType" value="ALL" />
|
||||||
</InsightsFilterSettings>
|
</InsightsFilterSettings>
|
||||||
</value>
|
</value>
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ android {
|
|||||||
applicationId = "ru.n08i40k.polytechnic.next"
|
applicationId = "ru.n08i40k.polytechnic.next"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 4
|
versionCode = 5
|
||||||
versionName = "1.2.1"
|
versionName = "1.2.2"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class FakeScheduleRepository : ScheduleRepository {
|
|||||||
defaultIndex = 2,
|
defaultIndex = 2,
|
||||||
name = "Операционные системы и среды",
|
name = "Операционные системы и среды",
|
||||||
time = LessonTime(655, 735),
|
time = LessonTime(655, 735),
|
||||||
cabinets = arrayListOf("42"),
|
cabinets = arrayListOf("42", "52"),
|
||||||
teacherNames = arrayListOf("Сергачева А.О."),
|
teacherNames = arrayListOf("Сергачева А.О.", "Не Сергачева А.О."),
|
||||||
),
|
),
|
||||||
Lesson(
|
Lesson(
|
||||||
type = LessonType.DEFAULT,
|
type = LessonType.DEFAULT,
|
||||||
@@ -61,7 +61,7 @@ class FakeScheduleRepository : ScheduleRepository {
|
|||||||
name = "Физическая культура",
|
name = "Физическая культура",
|
||||||
time = LessonTime(755, 835),
|
time = LessonTime(755, 835),
|
||||||
cabinets = arrayListOf("c/3"),
|
cabinets = arrayListOf("c/3"),
|
||||||
teacherNames = arrayListOf("Васюнин В.Г."),
|
teacherNames = arrayListOf("Васюнин В.Г.", "Не Васюнин В.Г."),
|
||||||
),
|
),
|
||||||
Lesson(
|
Lesson(
|
||||||
type = LessonType.DEFAULT,
|
type = LessonType.DEFAULT,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.material3.Card
|
||||||
import androidx.compose.material3.CardColors
|
import androidx.compose.material3.CardColors
|
||||||
import androidx.compose.material3.CardDefaults
|
import androidx.compose.material3.CardDefaults
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@@ -19,7 +20,6 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
@@ -67,41 +67,44 @@ fun LessonExtraInfo(
|
|||||||
mutableExpanded: MutableState<Boolean> = mutableStateOf(true)
|
mutableExpanded: MutableState<Boolean> = mutableStateOf(true)
|
||||||
) {
|
) {
|
||||||
Dialog(onDismissRequest = { mutableExpanded.value = false }) {
|
Dialog(onDismissRequest = { mutableExpanded.value = false }) {
|
||||||
Column(modifier = Modifier.padding(5.dp)) {
|
Card {
|
||||||
Text(lesson.name)
|
Column(Modifier.padding(10.dp)) {
|
||||||
|
Text(lesson.name)
|
||||||
|
|
||||||
if (lesson.teacherNames.isNotEmpty()) {
|
if (lesson.teacherNames.isNotEmpty()) {
|
||||||
val teachers = buildString {
|
val teachers = buildString {
|
||||||
append(stringResource(if (lesson.teacherNames.count() > 1) R.string.lesson_teachers else R.string.lesson_teacher))
|
append(stringResource(if (lesson.teacherNames.count() > 1) R.string.lesson_teachers else R.string.lesson_teacher))
|
||||||
append(" - ")
|
append(" - ")
|
||||||
append(lesson.teacherNames.joinToString(", "))
|
append(lesson.teacherNames.joinToString(", "))
|
||||||
|
}
|
||||||
|
Text(teachers)
|
||||||
}
|
}
|
||||||
Text(teachers)
|
|
||||||
}
|
|
||||||
|
|
||||||
val duration = buildString {
|
val duration = buildString {
|
||||||
append(stringResource(R.string.lesson_duration))
|
append(stringResource(R.string.lesson_duration))
|
||||||
append(" - ")
|
|
||||||
val duration = if (lesson.time != null) lesson.time.end - lesson.time.start else 0
|
|
||||||
|
|
||||||
val hours = duration / 60
|
|
||||||
val minutes = duration % 60
|
|
||||||
|
|
||||||
append(hours)
|
|
||||||
append(stringResource(R.string.hours))
|
|
||||||
append(" ")
|
|
||||||
append(minutes)
|
|
||||||
append(stringResource(R.string.minutes))
|
|
||||||
}
|
|
||||||
Text(duration)
|
|
||||||
|
|
||||||
if (lesson.cabinets.isNotEmpty()) {
|
|
||||||
val cabinets = buildString {
|
|
||||||
append(stringResource(R.string.cabinets))
|
|
||||||
append(" - ")
|
append(" - ")
|
||||||
append(lesson.cabinets.joinToString(", "))
|
val duration =
|
||||||
|
if (lesson.time != null) lesson.time.end - lesson.time.start else 0
|
||||||
|
|
||||||
|
val hours = duration / 60
|
||||||
|
val minutes = duration % 60
|
||||||
|
|
||||||
|
append(hours)
|
||||||
|
append(stringResource(R.string.hours))
|
||||||
|
append(" ")
|
||||||
|
append(minutes)
|
||||||
|
append(stringResource(R.string.minutes))
|
||||||
|
}
|
||||||
|
Text(duration)
|
||||||
|
|
||||||
|
if (lesson.cabinets.isNotEmpty()) {
|
||||||
|
val cabinets = buildString {
|
||||||
|
append(stringResource(R.string.cabinets))
|
||||||
|
append(" - ")
|
||||||
|
append(lesson.cabinets.joinToString(", "))
|
||||||
|
}
|
||||||
|
Text(cabinets)
|
||||||
}
|
}
|
||||||
Text(cabinets)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,7 +117,7 @@ private fun LessonViewRow(
|
|||||||
time: LessonTime? = LessonTime(0, 60),
|
time: LessonTime? = LessonTime(0, 60),
|
||||||
timeFormat: LessonTimeFormat = LessonTimeFormat.FROM_TO,
|
timeFormat: LessonTimeFormat = LessonTimeFormat.FROM_TO,
|
||||||
name: String = "Test",
|
name: String = "Test",
|
||||||
teacherNames: String? = "Хомченко Н.Е.",
|
teacherNames: ArrayList<String> = arrayListOf("Хомченко Н.Е.", "Хомченко Н.Е."),
|
||||||
cabinets: ArrayList<String> = arrayListOf("14", "31"),
|
cabinets: ArrayList<String> = arrayListOf("14", "31"),
|
||||||
cardColors: CardColors = CardDefaults.cardColors(),
|
cardColors: CardColors = CardDefaults.cardColors(),
|
||||||
verticalPadding: Dp = 10.dp
|
verticalPadding: Dp = 10.dp
|
||||||
@@ -123,8 +126,7 @@ private fun LessonViewRow(
|
|||||||
if (timeFormat == LessonTimeFormat.FROM_TO) cardColors.contentColor else cardColors.disabledContentColor
|
if (timeFormat == LessonTimeFormat.FROM_TO) cardColors.contentColor else cardColors.disabledContentColor
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier.padding(10.dp, verticalPadding),
|
||||||
.padding(10.dp, verticalPadding),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
@@ -145,9 +147,7 @@ private fun LessonViewRow(
|
|||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = formattedTime[0],
|
text = formattedTime[0], fontFamily = FontFamily.Monospace, color = contentColor
|
||||||
fontFamily = FontFamily.Monospace,
|
|
||||||
color = contentColor
|
|
||||||
)
|
)
|
||||||
if (formattedTime.count() > 1) {
|
if (formattedTime.count() > 1) {
|
||||||
Text(
|
Text(
|
||||||
@@ -164,40 +164,54 @@ private fun LessonViewRow(
|
|||||||
Column(
|
Column(
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
val fraction =
|
val fraction = if (cabinets.size == 0) 1F
|
||||||
if (cabinets.size == 0) 1F
|
else if (cabinets.any { it.contains("/") }) 0.9F
|
||||||
else if (cabinets.any { it.contains("/") }) 0.9F
|
else 0.925F
|
||||||
else 0.925F
|
|
||||||
Text(
|
|
||||||
modifier = Modifier.fillMaxWidth(fraction),
|
|
||||||
text = name,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
color = contentColor
|
|
||||||
)
|
|
||||||
if (!teacherNames.isNullOrEmpty()) {
|
|
||||||
Text(
|
|
||||||
modifier = Modifier.fillMaxWidth(fraction),
|
|
||||||
text = teacherNames,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
color = contentColor
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(verticalArrangement = Arrangement.Center) {
|
|
||||||
cabinets.forEach {
|
Row {
|
||||||
Text(
|
Column {
|
||||||
modifier = Modifier.fillMaxWidth(),
|
Text(
|
||||||
textAlign = TextAlign.End,
|
modifier = Modifier.fillMaxWidth(fraction),
|
||||||
text = it,
|
text = name,
|
||||||
fontFamily = FontFamily.Monospace,
|
fontWeight = FontWeight.Medium,
|
||||||
fontWeight = FontWeight.Bold,
|
maxLines = 1,
|
||||||
maxLines = 1,
|
overflow = TextOverflow.Ellipsis,
|
||||||
color = contentColor
|
color = contentColor
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for (listIdx: Int in 0..<teacherNames.size) {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.fillMaxWidth(fraction),
|
||||||
|
text = teacherNames[listIdx],
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
color = contentColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
if (cabinets.size <= teacherNames.size) {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
text = "",
|
||||||
|
maxLines = 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
for (listIdx: Int in 0..<cabinets.size) {
|
||||||
|
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
text = cabinets[listIdx],
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
color = contentColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,7 +230,7 @@ fun FreeLessonRow(
|
|||||||
) else null,
|
) else null,
|
||||||
LessonTimeFormat.ONLY_MINUTES_DURATION,
|
LessonTimeFormat.ONLY_MINUTES_DURATION,
|
||||||
stringResource(R.string.lesson_break),
|
stringResource(R.string.lesson_break),
|
||||||
null,
|
arrayListOf(),
|
||||||
arrayListOf(),
|
arrayListOf(),
|
||||||
cardColors,
|
cardColors,
|
||||||
2.5.dp
|
2.5.dp
|
||||||
@@ -235,7 +249,7 @@ fun LessonRow(
|
|||||||
lesson.time,
|
lesson.time,
|
||||||
LessonTimeFormat.FROM_TO,
|
LessonTimeFormat.FROM_TO,
|
||||||
lesson.name,
|
lesson.name,
|
||||||
lesson.teacherNames.joinToString(", "),
|
lesson.teacherNames,
|
||||||
lesson.cabinets,
|
lesson.cabinets,
|
||||||
cardColors,
|
cardColors,
|
||||||
5.dp
|
5.dp
|
||||||
|
|||||||
Reference in New Issue
Block a user