-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark theme (& Material You theming) for widget #8719
base: main
Are you sure you want to change the base?
Conversation
most recent commit should fix the style build issues @wmontwe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize for the delay in getting back to you. This change is indeed very positive and represents a good starting point, though it still requires additional work. Instead of replacing the existing widget, I suggest that the changes be implemented in a separate module. Maybe guarded with a feature flag or integration in debug and daily only while beta and release disable that widget.
This approach will allow us to enhance the new version while keeping the original widget available.
Ideas/Improvements:
- The Glance Theme should align with our app theme and be compatible with K-9 and TfA. A new common module for widgets could serve this purpose.
- This common module could also house UI elements that can be reused in future widgets.
- The widget currently displays the unified folder but does not yet use account colors to differentiate messages.
- Naming should adhere to the existing scheme.
- It's important to test how the widget performs across both applications.
Please let me know which aspects you would like to address personally. Some of these improvements can be broken down into follow-up tasks to complete the widget development.
android:name=".MessageListWidgetService" | ||
android:permission="android.permission.BIND_REMOTEVIEWS" | ||
/> | ||
<receiver android:name="MyAppWidgetReceiver" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the class from MyAppWidgetReceiver
to MessageListWidgetReceiver
.
import org.koin.core.component.KoinComponent | ||
import org.koin.core.component.inject | ||
|
||
class MyAppWidgetReceiver : GlanceAppWidgetReceiver() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this class from MyAppWidgetReceiver
to MessageListWidgetReceiver
.
override val glanceAppWidget: GlanceAppWidget = MyAppWidget() | ||
} | ||
|
||
class MyAppWidget : GlanceAppWidget(), KoinComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this class from MyAppWidget
to MessageListWidget
.
android:background="@android:color/white" | ||
android:gravity="center" | ||
android:padding="16dp" | ||
android:text="@string/message_list_widget_initializing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message_list_widget_initializing
string could be deleted as it's not used anymore.
private val coreResourceProvider: CoreResourceProvider by inject() | ||
|
||
override suspend fun provideGlance(context: Context, id: GlanceId) { | ||
// In this method, load data needed to render the AppWidget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment.
@@ -1,8 +1,5 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file could be renamed to message_list_widget_provider.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file should be renamed to MessageListWidget
android:permission="android.permission.BIND_REMOTEVIEWS" | ||
/> | ||
<receiver android:name="MyAppWidgetReceiver" | ||
android:label="Message List" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use the previous label message_list_widget_label
.
Ok I think that makes sense. I'll start by moving this moving this into its own module and restoring the old widget |
Completes #3728
Rebuilt the message list widget using Jetpack Glance and incorporated dark mode and material you theming for the color scheme
This is what the widget looks like now when dark mode is enabled: