ios widget showing what is available at chucks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: make the widgets nicer

+74 -81
+6
android/app/proguard-rules.pro
··· 15 15 # Retrofit 16 16 -dontwarn retrofit2.** 17 17 -keep class retrofit2.** { *; } 18 + 19 + # Widget receivers - keep these from being stripped 20 + -keep class com.wasupchucks.widget.** { *; } 21 + 22 + # Glance 23 + -keep class androidx.glance.** { *; }
+6 -9
android/app/src/main/java/com/wasupchucks/widget/ui/LargeWidget.kt
··· 7 7 import androidx.glance.GlanceTheme 8 8 import androidx.glance.Image 9 9 import androidx.glance.ImageProvider 10 + import androidx.glance.appwidget.appWidgetBackground 11 + import androidx.glance.appwidget.cornerRadius 12 + import androidx.glance.background 10 13 import androidx.glance.layout.Alignment 11 14 import androidx.glance.layout.Column 12 15 import androidx.glance.layout.Row ··· 58 61 Column( 59 62 modifier = GlanceModifier 60 63 .fillMaxSize() 64 + .appWidgetBackground() 65 + .background(GlanceTheme.colors.widgetBackground) 66 + .cornerRadius(24.dp) 61 67 .padding(16.dp) 62 68 ) { 63 69 // Header row ··· 130 136 } 131 137 } 132 138 } 133 - 134 - Spacer(modifier = GlanceModifier.height(12.dp)) 135 - 136 - // Divider simulation 137 - Spacer( 138 - modifier = GlanceModifier 139 - .fillMaxWidth() 140 - .height(1.dp) 141 - ) 142 139 143 140 Spacer(modifier = GlanceModifier.height(12.dp)) 144 141
+13 -18
android/app/src/main/java/com/wasupchucks/widget/ui/MediumWidget.kt
··· 7 7 import androidx.glance.GlanceTheme 8 8 import androidx.glance.Image 9 9 import androidx.glance.ImageProvider 10 + import androidx.glance.appwidget.appWidgetBackground 11 + import androidx.glance.appwidget.cornerRadius 12 + import androidx.glance.background 10 13 import androidx.glance.layout.Alignment 11 14 import androidx.glance.layout.Column 12 15 import androidx.glance.layout.Row 13 16 import androidx.glance.layout.Spacer 14 17 import androidx.glance.layout.fillMaxHeight 15 18 import androidx.glance.layout.fillMaxSize 16 - import androidx.glance.layout.fillMaxWidth 17 19 import androidx.glance.layout.height 18 20 import androidx.glance.layout.padding 19 21 import androidx.glance.layout.size ··· 58 60 Row( 59 61 modifier = GlanceModifier 60 62 .fillMaxSize() 63 + .appWidgetBackground() 64 + .background(GlanceTheme.colors.widgetBackground) 65 + .cornerRadius(24.dp) 61 66 .padding(12.dp), 62 67 verticalAlignment = Alignment.CenterVertically 63 68 ) { 64 - // Left side - Status 69 + // Left side - Status (half width) 65 70 Column( 66 71 modifier = GlanceModifier 67 72 .defaultWeight() ··· 92 97 Text( 93 98 text = remaining.toCompactCountdown(), 94 99 style = TextStyle( 95 - fontSize = 40.sp, 100 + fontSize = 48.sp, 96 101 fontWeight = FontWeight.Bold, 97 102 color = GlanceTheme.colors.onSurface 98 103 ) ··· 116 121 } 117 122 } 118 123 119 - // Divider 120 - Spacer( 121 - modifier = GlanceModifier 122 - .width(1.dp) 123 - .fillMaxHeight() 124 - .padding(vertical = 8.dp) 125 - ) 126 - 127 124 Spacer(modifier = GlanceModifier.width(12.dp)) 128 125 129 126 // Right side - Specials ··· 131 128 modifier = GlanceModifier 132 129 .defaultWeight() 133 130 .fillMaxHeight(), 134 - verticalAlignment = Alignment.Top 131 + verticalAlignment = Alignment.CenterVertically 135 132 ) { 136 133 Text( 137 134 text = venueName, 138 135 style = TextStyle( 139 - fontSize = 11.sp, 136 + fontSize = 12.sp, 140 137 fontWeight = FontWeight.Bold, 141 138 color = GlanceTheme.colors.onSurfaceVariant 142 139 ) 143 140 ) 144 141 145 - Spacer(modifier = GlanceModifier.height(4.dp)) 142 + Spacer(modifier = GlanceModifier.height(6.dp)) 146 143 147 144 if (specials.isEmpty()) { 148 - Spacer(modifier = GlanceModifier.defaultWeight()) 149 145 Text( 150 146 text = "No specials available", 151 147 style = TextStyle( 152 - fontSize = 11.sp, 148 + fontSize = 13.sp, 153 149 color = GlanceTheme.colors.onSurfaceVariant 154 150 ) 155 151 ) 156 - Spacer(modifier = GlanceModifier.defaultWeight()) 157 152 } else { 158 153 specials.take(4).forEach { item -> 159 154 Text( 160 155 text = "\u2022 ${item.name}", 161 156 style = TextStyle( 162 - fontSize = 11.sp, 157 + fontSize = 13.sp, 163 158 color = GlanceTheme.colors.onSurface 164 159 ), 165 160 maxLines = 1
+47 -53
android/app/src/main/java/com/wasupchucks/widget/ui/SmallWidget.kt
··· 7 7 import androidx.glance.GlanceTheme 8 8 import androidx.glance.Image 9 9 import androidx.glance.ImageProvider 10 + import androidx.glance.appwidget.appWidgetBackground 11 + import androidx.glance.appwidget.cornerRadius 12 + import androidx.glance.background 10 13 import androidx.glance.layout.Alignment 11 - import androidx.glance.layout.Box 12 14 import androidx.glance.layout.Column 13 15 import androidx.glance.layout.Row 14 16 import androidx.glance.layout.Spacer 15 17 import androidx.glance.layout.fillMaxSize 16 - import androidx.glance.layout.fillMaxWidth 17 - import androidx.glance.layout.height 18 18 import androidx.glance.layout.padding 19 19 import androidx.glance.layout.size 20 + import androidx.glance.layout.width 20 21 import androidx.glance.text.FontWeight 21 22 import androidx.glance.text.Text 22 23 import androidx.glance.text.TextStyle ··· 49 50 else -> R.drawable.ic_closed 50 51 } 51 52 52 - Box( 53 + Column( 53 54 modifier = GlanceModifier 54 55 .fillMaxSize() 56 + .appWidgetBackground() 57 + .background(GlanceTheme.colors.widgetBackground) 58 + .cornerRadius(24.dp) 55 59 .padding(12.dp), 56 - contentAlignment = Alignment.Center 60 + horizontalAlignment = Alignment.CenterHorizontally, 61 + verticalAlignment = Alignment.CenterVertically 57 62 ) { 58 - Column( 59 - modifier = GlanceModifier.fillMaxSize(), 60 - horizontalAlignment = Alignment.CenterHorizontally 63 + // Status indicator 64 + Row( 65 + verticalAlignment = Alignment.CenterVertically 61 66 ) { 62 - // Status indicator 63 - Row( 64 - modifier = GlanceModifier.fillMaxWidth(), 65 - verticalAlignment = Alignment.CenterVertically, 66 - horizontalAlignment = Alignment.Start 67 - ) { 68 - Image( 69 - provider = ImageProvider(iconRes), 70 - contentDescription = null, 71 - modifier = GlanceModifier.size(20.dp) 72 - ) 73 - Spacer(modifier = GlanceModifier.size(4.dp)) 74 - Text( 75 - text = if (status.isOpen) "Open" else "Closed", 76 - style = TextStyle( 77 - fontSize = 12.sp, 78 - fontWeight = FontWeight.Bold, 79 - color = statusColor 80 - ) 81 - ) 82 - } 83 - 84 - Spacer(modifier = GlanceModifier.defaultWeight()) 85 - 86 - // Countdown 87 - status.timeRemaining?.let { remaining -> 88 - Text( 89 - text = remaining.toCompactCountdown(), 90 - style = TextStyle( 91 - fontSize = 48.sp, 92 - fontWeight = FontWeight.Bold, 93 - color = GlanceTheme.colors.onSurface 94 - ) 67 + Image( 68 + provider = ImageProvider(iconRes), 69 + contentDescription = null, 70 + modifier = GlanceModifier.size(16.dp) 71 + ) 72 + Spacer(modifier = GlanceModifier.width(4.dp)) 73 + Text( 74 + text = if (status.isOpen) "Open" else "Closed", 75 + style = TextStyle( 76 + fontSize = 12.sp, 77 + fontWeight = FontWeight.Bold, 78 + color = statusColor 95 79 ) 96 - } 97 - 98 - // Label 99 - val labelText = when { 100 - status.isOpen -> "until ${status.currentPhase.displayName} ends" 101 - status.nextPhase != null && status.nextPhase != MealPhase.CLOSED -> "until ${status.nextPhase.displayName}" 102 - else -> "See you tomorrow!" 103 - } 80 + ) 81 + } 104 82 83 + // Countdown 84 + status.timeRemaining?.let { remaining -> 105 85 Text( 106 - text = labelText, 86 + text = remaining.toCompactCountdown(), 107 87 style = TextStyle( 108 - fontSize = 11.sp, 109 - color = GlanceTheme.colors.onSurfaceVariant 88 + fontSize = 52.sp, 89 + fontWeight = FontWeight.Bold, 90 + color = GlanceTheme.colors.onSurface 110 91 ) 111 92 ) 93 + } 112 94 113 - Spacer(modifier = GlanceModifier.defaultWeight()) 95 + // Label 96 + val labelText = when { 97 + status.isOpen -> "until ${status.currentPhase.displayName} ends" 98 + status.nextPhase != null && status.nextPhase != MealPhase.CLOSED -> "until ${status.nextPhase.displayName}" 99 + else -> "See you tomorrow!" 114 100 } 101 + 102 + Text( 103 + text = labelText, 104 + style = TextStyle( 105 + fontSize = 10.sp, 106 + color = GlanceTheme.colors.onSurfaceVariant 107 + ) 108 + ) 115 109 } 116 110 }
+2 -1
android/app/src/main/res/layout/widget_loading.xml
··· 2 2 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 3 android:layout_width="match_parent" 4 4 android:layout_height="match_parent" 5 - android:background="@android:color/transparent"> 5 + android:background="@drawable/widget_background" 6 + android:padding="16dp"> 6 7 7 8 <ProgressBar 8 9 android:layout_width="wrap_content"