Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vayun-mathur
Copy link

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:

Screenshot_20250106-153429

@wmontwe wmontwe self-assigned this Jan 6, 2025
@vayun-mathur
Copy link
Author

most recent commit should fix the style build issues @wmontwe

Copy link
Member

@wmontwe wmontwe left a 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"
Copy link
Member

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() {
Copy link
Member

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 {
Copy link
Member

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"
Copy link
Member

@wmontwe wmontwe Jan 10, 2025

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.
Copy link
Member

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"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this line.

Copy link
Member

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

Copy link
Member

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"
Copy link
Member

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.

@vayun-mathur
Copy link
Author

Ok I think that makes sense. I'll start by moving this moving this into its own module and restoring the old widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants