-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Displaying number of expirations and warnings
- Loading branch information
1 parent
4cf1524
commit 9e5d28b
Showing
13 changed files
with
160 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package io.fixmyride.enums | ||
|
||
enum class NotificationType { | ||
TPL_EXPIRY, | ||
CI_EXPIRY, | ||
UPCOMING_INSPECTION; | ||
object NotificationType { | ||
const val TPL_ABOUT_TO_EXPIRE = 1 | ||
const val TPL_EXPIRED = -1 | ||
|
||
const val CI_ABOUT_TO_EXPIRE = 2 | ||
const val CI_EXPIRED = -2 | ||
|
||
const val INSPECTION_UPCOMING = 3 | ||
const val INSPECTION_EXPIRED = -3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package io.fixmyride.models | ||
|
||
import io.fixmyride.enums.NotificationType | ||
|
||
data class Notification( | ||
val relatedVehicleId: Int, | ||
val expirations: List<NotificationType>, | ||
val expirations: List<Int>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.fixmyride.ui.widgets | ||
|
||
import android.content.Context | ||
import androidx.glance.GlanceId | ||
import androidx.glance.GlanceModifier | ||
import androidx.glance.appwidget.GlanceAppWidget | ||
import androidx.glance.appwidget.GlanceAppWidgetReceiver | ||
import androidx.glance.appwidget.provideContent | ||
import androidx.glance.background | ||
import androidx.glance.layout.Column | ||
import androidx.glance.layout.fillMaxSize | ||
import androidx.glance.text.Text | ||
import io.fixmyride.ui.theme.ColorPalette | ||
|
||
private object ExpirationsWidget : GlanceAppWidget() { | ||
override suspend fun provideGlance(context: Context, id: GlanceId) { | ||
|
||
// In this method, load data needed to render the AppWidget. | ||
// Use `withContext` to switch to another thread for long running | ||
// operations. | ||
provideContent { | ||
Column( | ||
modifier = GlanceModifier | ||
.fillMaxSize() | ||
.background(color = ColorPalette.background), | ||
) { | ||
Text("Sup'") | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
object ExpirationsReceiver : GlanceAppWidgetReceiver() { | ||
override val glanceAppWidget: GlanceAppWidget | ||
get() = ExpirationsWidget | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:description="@string/app_name" | ||
android:initialLayout="@layout/glance_default_loading_layout" | ||
android:minWidth="100dp" | ||
android:minHeight="50dp" | ||
android:resizeMode="none" | ||
android:updatePeriodMillis="10000" | ||
android:widgetCategory="home_screen" /> |