Skip to content

Commit 8adeee0

Browse files
committed
Fixes & renaming
1 parent 2182490 commit 8adeee0

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

app/src/main/java/dev/alllexey/itmowidgets/services/MyFirebaseMessagingService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
156156
createNotificationChannel(channelId)
157157

158158
val notificationBuilder = NotificationCompat.Builder(this, channelId)
159-
.setSmallIcon(R.drawable.ic_notification)
159+
.setSmallIcon(R.drawable.ic_exercise)
160160
.setContentTitle(title)
161161
.setContentText(messageBody)
162162
.setAutoCancel(true)

app/src/main/java/dev/alllexey/itmowidgets/ui/sport/sign/SportSignViewModel.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import kotlinx.coroutines.launch
2828
import kotlinx.coroutines.supervisorScope
2929
import java.time.DayOfWeek
3030
import java.time.LocalDate
31+
import java.time.OffsetDateTime
3132
import java.time.format.TextStyle
3233
import java.util.Locale
3334

@@ -212,13 +213,13 @@ class SportSignViewModel(private val myItmo: MyItmoApi, context: Context) : View
212213
val isAvailable = lesson.available > 0 && lesson.canSignIn.isCanSignIn
213214
// If "Show Only Available" is on, we hide full lessons, unless Auto Sign is ON (which might show them)
214215
// or if the user is already signed up.
215-
val shouldShow = lesson.signed || !state.showOnlyAvailable || isAvailable || (state.showAutoSign && lesson.canSignIn.isCanSignIn)
216+
val shouldShow = !state.showOnlyAvailable || (lesson.dateEnd > OffsetDateTime.now() && (lesson.signed || isAvailable || (state.showAutoSign && lesson.canSignIn.isCanSignIn)))
216217

217218
isToday && shouldShow
218219
}
219220
.map { createSportLessonData(it, isReal = true) }
220221
// Filter again after mapping because createSportLessonData calculates precise unavailability reasons
221-
.filter { item -> !state.showOnlyAvailable || item.canSignIn || item.apiData.signed || (state.showAutoSign && item.apiData.available <= 0) }
222+
.filter { item -> !state.showOnlyAvailable || (item.apiData.dateEnd > OffsetDateTime.now() && (item.canSignIn || item.apiData.signed || (state.showAutoSign && item.apiData.available <= 0))) }
222223

223224
// B. Phantom Lessons (Auto Sign suggestions based on history)
224225
val phantomLessons = if (state.showAutoSign) {
@@ -278,6 +279,7 @@ class SportSignViewModel(private val myItmo: MyItmoApi, context: Context) : View
278279
private fun createSportLessonData(lesson: SportLesson, isReal: Boolean): SportLessonData {
279280
val reasons = if (isReal) UnavailableReason.getSortedUnavailableReasons(lesson) else {
280281
val allowed = setOf(
282+
UnavailableReason.LessonInPast::class,
281283
UnavailableReason.SelectionFailed::class,
282284
UnavailableReason.HealthGroupMismatch::class,
283285
UnavailableReason.Other::class,

app/src/main/res/layout/fragment_onboarding_services.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
android:id="@+id/tv_title"
1919
android:layout_width="match_parent"
2020
android:layout_height="wrap_content"
21-
android:text="Кастомные сервисы"
21+
android:text="Пользовательские сервисы"
2222
android:textAlignment="center"
2323
android:textAppearance="?attr/textAppearanceTitleLargeEmphasized"
2424
app:layout_constraintTop_toTopOf="parent" />
@@ -96,7 +96,7 @@
9696
android:layout_width="0dp"
9797
android:layout_height="wrap_content"
9898
android:layout_weight="1"
99-
android:text="Кастомные сервисы"
99+
android:text="Пользовательские сервисы"
100100
android:textAppearance="?attr/textAppearanceTitleMedium" />
101101

102102
<com.google.android.material.materialswitch.MaterialSwitch

app/src/main/res/xml/account_preferences.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
<SwitchPreference
3434
app:defaultValue="false"
3535
app:key="custom_services_allow"
36-
app:summary="Добавляет в приложение уникальные инструменты"
36+
app:summary="Добавляет в приложение уникальные инструменты. Ваш токен MyITMO будет отправлен на сервер приложения для аутентификации."
3737
app:title="Пользовательские сервисы" />
3838

39-
<Preference
40-
app:icon="@drawable/ic_outline_help"
41-
app:key="custom_services_info"
42-
app:summary="Подробное описание новых функций"
43-
app:title="Что это дает?" />
39+
<!-- <Preference-->
40+
<!-- app:icon="@drawable/ic_outline_help"-->
41+
<!-- app:key="custom_services_info"-->
42+
<!-- app:summary="Подробное описание уникальных функций"-->
43+
<!-- app:title="Что это такое?" />-->
4444
</PreferenceCategory>
4545
</PreferenceScreen>

0 commit comments

Comments
 (0)